Browse Source

Enhancement in SLIM capabilities + bugfixes in install process

SLIM is now able to edit configuration from CLI, to start instances etc.
Yann Weber 8 years ago
parent
commit
e6e4a03a27

+ 6
- 1
Makefile.am View File

@@ -1,4 +1,9 @@
1
-SUBDIRS=lodel
1
+SUBDIRS=lodel progs plugins
2
+EXTRA_DIST=doc
3
+
4
+lodel2datadir=$(datadir)/lodel2
5
+lodel2_localstate_DATA =
6
+lodel2_localstatedir=$(localstatedir)/lodel2
2 7
 
3 8
 #python=/usr/bin/env python3
4 9
 python=@PYTHON@

+ 3
- 0
configure.ac View File

@@ -13,6 +13,9 @@ AC_CONFIG_FILES([Makefile \
13 13
 	lodel/plugin/Makefile \
14 14
 	lodel/settings/Makefile \
15 15
 	lodel/utils/Makefile \
16
+	progs/Makefile \
17
+	progs/slim/Makefile \
18
+	plugins/Makefile \
16 19
 ])
17 20
 
18 21
 

+ 5
- 0
install/loader.py View File

@@ -17,6 +17,11 @@ if LODEL2_LIB_ABS_PATH is not None:
17 17
 not correct : '%s'" % LODEL2_LIB_ABS_PATH, file=sys.stderr)
18 18
     sys.path.append(LODEL2_LIB_ABS_PATH)
19 19
 
20
+#Set the cwd to the instance dir
21
+instance_dir = os.path.dirname(sys.argv[0])
22
+if len(instance_dir) > 0:
23
+    os.chdir(instance_dir)
24
+
20 25
 try:
21 26
     import lodel
22 27
 except ImportError as e:

+ 2
- 1
lodel/plugin/Makefile.am View File

@@ -1,5 +1,6 @@
1 1
 plugin_PYTHON=*.py
2
-plugindir=$(pkgythondir)/plugin
2
+
3
+plugindir=$(pkgpythondir)/plugin
3 4
 
4 5
 distclean-local:
5 6
 	-rm Makefile Makefile.in

+ 3
- 0
lodel/plugin/plugins.py View File

@@ -321,6 +321,9 @@ class Plugin(object, metaclass=MetaPlugType):
321 321
                     plugin = self.name,
322 322
                     expt = str(e))
323 323
                 raise PluginError(msg)
324
+            except Exception as e:
325
+                msg = "Plugin '%s' :"+str(e)
326
+                raise e.__class__(msg)
324 327
 
325 328
             try:
326 329
                 # loading confpsecs from file

+ 9
- 0
plugins/Makefile.am View File

@@ -0,0 +1,9 @@
1
+plugins_PYTHON=__init__.py
2
+
3
+pluginsdir=$(pkgpythondir)/plugins
4
+
5
+install-data-local:
6
+	mkdir $(pluginsdir); cp -R * $(pluginsdir) && rm $(pluginsdir)/Makefile*
7
+
8
+distclean-local:
9
+	-rm -R Makefile Makefile.in $(pluginsdir)

+ 2
- 2
plugins/webui/confspec.py View File

@@ -2,8 +2,8 @@ from lodel.settings.validator import SettingValidator
2 2
 
3 3
 CONFSPEC = {
4 4
     'lodel2.webui': {
5
-        'standalone': ( False,
6
-                        SettingValidator('bool')),
5
+        'standalone': ( 'False',
6
+                        SettingValidator('string')),
7 7
         'listen_address': ( '127.0.0.1',
8 8
                             SettingValidator('dummy')),
9 9
         'listen_port': (    '9090',

+ 23
- 10
plugins/webui/main.py View File

@@ -1,6 +1,7 @@
1 1
 #-*- coding: utf-8 -*-
2 2
 
3 3
 import os, os.path
4
+import sys
4 5
 from lodel.plugin import LodelHook
5 6
 from lodel.settings import Settings
6 7
 
@@ -15,14 +16,26 @@ def root_url():
15 16
 ##@brief uwsgi startup demo
16 17
 @LodelHook('lodel2_loader_main')
17 18
 def uwsgi_fork(hook_name, caller, payload):
19
+    
20
+    standalone = Settings.webui.standalone
21
+    if standalone.lower() == 'false':
22
+        return
23
+    else:
24
+        if standalone.lower() == 'true':
25
+            cmd='{uwsgi} --http-socket {addr}:{port} --module plugins.webui.run'
26
+            cmd = cmd.format(
27
+                        addr = Settings.webui.listen_address,
28
+                        port = Settings.webui.listen_port,
29
+                        uwsgi= Settings.webui.uwsgicmd)
30
+            if Settings.webui.virtualenv is not None:
31
+                cmd += " --virtualenv %s" % Settings.webui.virtualenv
18 32
 
19
-    if Settings.webui.standalone:
20
-        cmd='{uwsgi} --http-socket {addr}:{port} --module plugins.webui.run'
21
-        cmd = cmd.format(
22
-                    addr = Settings.webui.listen_address,
23
-                    port = Settings.webui.listen_port,
24
-                    uwsgi= Settings.webui.uwsgicmd)
25
-        if Settings.webui.virtualenv is not None:
26
-            cmd += " --virtualenv %s" % Settings.webui.virtualenv
27
-
28
-        exit(os.system(cmd))
33
+        elif Settings.webui.standalone == 'uwsgi':
34
+            cmd = '{uwsgi} --ini ./plugins/webui/uwsgi/uwsgi.ini'
35
+            cmd = cmd.format(uwsgi = Settings.webui.uwsgicmd)
36
+        
37
+        try:
38
+            exit(os.system(cmd))
39
+        except Exception as e:
40
+            print("Webui plugin uwsgi fork fails : ", e, file=sys.stderr)
41
+            exit(1)

+ 9
- 5
plugins/webui/run.py View File

@@ -14,13 +14,17 @@ from .exceptions import *
14 14
 from .client import WebUiClient
15 15
 from lodel.auth.exceptions import *
16 16
 
17
-SESSION_FILES_BASE_DIR = Settings.webui.sessions.directory
18
-SESSION_FILES_TEMPLATE = Settings.webui.sessions.file_template
19
-SESSION_EXPIRATION_LIMIT = Settings.webui.sessions.expiration
17
+try:
18
+    SESSION_FILES_BASE_DIR = Settings.webui.sessions.directory
19
+    SESSION_FILES_TEMPLATE = Settings.webui.sessions.file_template
20
+    SESSION_EXPIRATION_LIMIT = Settings.webui.sessions.expiration
20 21
 
21 22
 
22
-COOKIE_SECRET_KEY = bytes(Settings.webui.cookie_secret_key, 'utf-8')
23
-COOKIE_SESSION_ID = Settings.webui.cookie_session_id
23
+    COOKIE_SECRET_KEY = bytes(Settings.webui.cookie_secret_key, 'utf-8')
24
+    COOKIE_SESSION_ID = Settings.webui.cookie_session_id
25
+except Exception as e:
26
+    print("Fails to start : ", e, file=sys.stderr)
27
+    exit(1)
24 28
 
25 29
 from werkzeug.contrib.securecookie import SecureCookie
26 30
 

+ 8
- 0
plugins/webui/uwsgi/uwsgi.ini View File

@@ -0,0 +1,8 @@
1
+[uwsgi]
2
+model = run:application
3
+plugin = python3
4
+module = plugins.webui.run
5
+socket = lodel2.sock
6
+chmod-socket = 666
7
+vacuum = true
8
+die-on-term = true #enable sigterm for killing

+ 14
- 0
progs/Makefile.am View File

@@ -0,0 +1,14 @@
1
+SUBDIRS=slim
2
+
3
+lodel2_scripts_dir = $(datadir)/lodel2/scripts
4
+lodel2_scripts__DATA = create_instance
5
+CLEANFILES = $(lodel2_scripts__DATA)
6
+
7
+do_subst = sed -e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g' 
8
+
9
+create_instance: create_instance.sh
10
+	$(do_subst) < $(srcdir)/create_instance.sh > create_instance
11
+	chmod +x create_instance
12
+
13
+install-data-hook:
14
+	chmod +x $(datadir)/lodel2/scripts/create_instance

+ 636
- 0
progs/Makefile.in View File

@@ -0,0 +1,636 @@
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2
+# @configure_input@
3
+
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
6
+# This Makefile.in is free software; the Free Software Foundation
7
+# gives unlimited permission to copy and/or distribute it,
8
+# with or without modifications, as long as this notice is preserved.
9
+
10
+# This program is distributed in the hope that it will be useful,
11
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
+# PARTICULAR PURPOSE.
14
+
15
+@SET_MAKE@
16
+
17
+VPATH = @srcdir@
18
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
19
+am__make_running_with_option = \
20
+  case $${target_option-} in \
21
+      ?) ;; \
22
+      *) echo "am__make_running_with_option: internal error: invalid" \
23
+              "target option '$${target_option-}' specified" >&2; \
24
+         exit 1;; \
25
+  esac; \
26
+  has_opt=no; \
27
+  sane_makeflags=$$MAKEFLAGS; \
28
+  if $(am__is_gnu_make); then \
29
+    sane_makeflags=$$MFLAGS; \
30
+  else \
31
+    case $$MAKEFLAGS in \
32
+      *\\[\ \	]*) \
33
+        bs=\\; \
34
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
35
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
36
+    esac; \
37
+  fi; \
38
+  skip_next=no; \
39
+  strip_trailopt () \
40
+  { \
41
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
42
+  }; \
43
+  for flg in $$sane_makeflags; do \
44
+    test $$skip_next = yes && { skip_next=no; continue; }; \
45
+    case $$flg in \
46
+      *=*|--*) continue;; \
47
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
48
+      -*I?*) strip_trailopt 'I';; \
49
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
50
+      -*O?*) strip_trailopt 'O';; \
51
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
52
+      -*l?*) strip_trailopt 'l';; \
53
+      -[dEDm]) skip_next=yes;; \
54
+      -[JT]) skip_next=yes;; \
55
+    esac; \
56
+    case $$flg in \
57
+      *$$target_option*) has_opt=yes; break;; \
58
+    esac; \
59
+  done; \
60
+  test $$has_opt = yes
61
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
62
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
63
+pkgdatadir = $(datadir)/@PACKAGE@
64
+pkgincludedir = $(includedir)/@PACKAGE@
65
+pkglibdir = $(libdir)/@PACKAGE@
66
+pkglibexecdir = $(libexecdir)/@PACKAGE@
67
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
68
+install_sh_DATA = $(install_sh) -c -m 644
69
+install_sh_PROGRAM = $(install_sh) -c
70
+install_sh_SCRIPT = $(install_sh) -c
71
+INSTALL_HEADER = $(INSTALL_DATA)
72
+transform = $(program_transform_name)
73
+NORMAL_INSTALL = :
74
+PRE_INSTALL = :
75
+POST_INSTALL = :
76
+NORMAL_UNINSTALL = :
77
+PRE_UNINSTALL = :
78
+POST_UNINSTALL = :
79
+subdir = progs
80
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
81
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
82
+am__aclocal_m4_deps = $(top_srcdir)/m4/python.m4 \
83
+	$(top_srcdir)/m4/python_pyconfigure.m4 \
84
+	$(top_srcdir)/configure.ac
85
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
86
+	$(ACLOCAL_M4)
87
+mkinstalldirs = $(install_sh) -d
88
+CONFIG_CLEAN_FILES =
89
+CONFIG_CLEAN_VPATH_FILES =
90
+AM_V_P = $(am__v_P_@AM_V@)
91
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
92
+am__v_P_0 = false
93
+am__v_P_1 = :
94
+AM_V_GEN = $(am__v_GEN_@AM_V@)
95
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
96
+am__v_GEN_0 = @echo "  GEN     " $@;
97
+am__v_GEN_1 = 
98
+AM_V_at = $(am__v_at_@AM_V@)
99
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
100
+am__v_at_0 = @
101
+am__v_at_1 = 
102
+SOURCES =
103
+DIST_SOURCES =
104
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
105
+	ctags-recursive dvi-recursive html-recursive info-recursive \
106
+	install-data-recursive install-dvi-recursive \
107
+	install-exec-recursive install-html-recursive \
108
+	install-info-recursive install-pdf-recursive \
109
+	install-ps-recursive install-recursive installcheck-recursive \
110
+	installdirs-recursive pdf-recursive ps-recursive \
111
+	tags-recursive uninstall-recursive
112
+am__can_run_installinfo = \
113
+  case $$AM_UPDATE_INFO_DIR in \
114
+    n|no|NO) false;; \
115
+    *) (install-info --version) >/dev/null 2>&1;; \
116
+  esac
117
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
118
+am__vpath_adj = case $$p in \
119
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
120
+    *) f=$$p;; \
121
+  esac;
122
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
123
+am__install_max = 40
124
+am__nobase_strip_setup = \
125
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
126
+am__nobase_strip = \
127
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
128
+am__nobase_list = $(am__nobase_strip_setup); \
129
+  for p in $$list; do echo "$$p $$p"; done | \
130
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
131
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
132
+    if (++n[$$2] == $(am__install_max)) \
133
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
134
+    END { for (dir in files) print dir, files[dir] }'
135
+am__base_list = \
136
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
137
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
138
+am__uninstall_files_from_dir = { \
139
+  test -z "$$files" \
140
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
141
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
142
+         $(am__cd) "$$dir" && rm -f $$files; }; \
143
+  }
144
+am__installdirs = "$(DESTDIR)$(lodel2_scripts_dir)"
145
+DATA = $(lodel2_scripts__DATA)
146
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
147
+  distclean-recursive maintainer-clean-recursive
148
+am__recursive_targets = \
149
+  $(RECURSIVE_TARGETS) \
150
+  $(RECURSIVE_CLEAN_TARGETS) \
151
+  $(am__extra_recursive_targets)
152
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
153
+	distdir
154
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
155
+# Read a list of newline-separated strings from the standard input,
156
+# and print each of them once, without duplicates.  Input order is
157
+# *not* preserved.
158
+am__uniquify_input = $(AWK) '\
159
+  BEGIN { nonempty = 0; } \
160
+  { items[$$0] = 1; nonempty = 1; } \
161
+  END { if (nonempty) { for (i in items) print i; }; } \
162
+'
163
+# Make sure the list of sources is unique.  This is necessary because,
164
+# e.g., the same source file might be shared among _SOURCES variables
165
+# for different programs/libraries.
166
+am__define_uniq_tagged_files = \
167
+  list='$(am__tagged_files)'; \
168
+  unique=`for i in $$list; do \
169
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
170
+  done | $(am__uniquify_input)`
171
+ETAGS = etags
172
+CTAGS = ctags
173
+DIST_SUBDIRS = $(SUBDIRS)
174
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
175
+am__relativize = \
176
+  dir0=`pwd`; \
177
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
178
+  sed_rest='s,^[^/]*/*,,'; \
179
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
180
+  sed_butlast='s,/*[^/]*$$,,'; \
181
+  while test -n "$$dir1"; do \
182
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
183
+    if test "$$first" != "."; then \
184
+      if test "$$first" = ".."; then \
185
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
186
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
187
+      else \
188
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
189
+        if test "$$first2" = "$$first"; then \
190
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
191
+        else \
192
+          dir2="../$$dir2"; \
193
+        fi; \
194
+        dir0="$$dir0"/"$$first"; \
195
+      fi; \
196
+    fi; \
197
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
198
+  done; \
199
+  reldir="$$dir2"
200
+ACLOCAL = @ACLOCAL@
201
+AMTAR = @AMTAR@
202
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
203
+AUTOCONF = @AUTOCONF@
204
+AUTOHEADER = @AUTOHEADER@
205
+AUTOMAKE = @AUTOMAKE@
206
+AWK = @AWK@
207
+CYGPATH_W = @CYGPATH_W@
208
+DEFS = @DEFS@
209
+DOCOK = @DOCOK@
210
+DOXYGEN = @DOXYGEN@
211
+DOXYPY = @DOXYPY@
212
+ECHO_C = @ECHO_C@
213
+ECHO_N = @ECHO_N@
214
+ECHO_T = @ECHO_T@
215
+GRAPHVIZ = @GRAPHVIZ@
216
+INSTALL = @INSTALL@
217
+INSTALL_DATA = @INSTALL_DATA@
218
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
219
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
220
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
221
+LIBOBJS = @LIBOBJS@
222
+LIBS = @LIBS@
223
+LTLIBOBJS = @LTLIBOBJS@
224
+MAKEINFO = @MAKEINFO@
225
+MKDIR_P = @MKDIR_P@
226
+PACKAGE = @PACKAGE@
227
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
228
+PACKAGE_NAME = @PACKAGE_NAME@
229
+PACKAGE_STRING = @PACKAGE_STRING@
230
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
231
+PACKAGE_URL = @PACKAGE_URL@
232
+PACKAGE_VERSION = @PACKAGE_VERSION@
233
+PATH_SEPARATOR = @PATH_SEPARATOR@
234
+PYMONGO = @PYMONGO@
235
+PYTHON = @PYTHON@
236
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
237
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
238
+PYTHON_PREFIX = @PYTHON_PREFIX@
239
+PYTHON_VERSION = @PYTHON_VERSION@
240
+SET_MAKE = @SET_MAKE@
241
+SHELL = @SHELL@
242
+SITEPACKAGES = @SITEPACKAGES@
243
+STRIP = @STRIP@
244
+VERSION = @VERSION@
245
+WEBUI = @WEBUI@
246
+abs_builddir = @abs_builddir@
247
+abs_srcdir = @abs_srcdir@
248
+abs_top_builddir = @abs_top_builddir@
249
+abs_top_srcdir = @abs_top_srcdir@
250
+am__leading_dot = @am__leading_dot@
251
+am__tar = @am__tar@
252
+am__untar = @am__untar@
253
+bindir = @bindir@
254
+build_alias = @build_alias@
255
+builddir = @builddir@
256
+datadir = @datadir@
257
+datarootdir = @datarootdir@
258
+docdir = @docdir@
259
+dvidir = @dvidir@
260
+exec_prefix = @exec_prefix@
261
+host_alias = @host_alias@
262
+htmldir = @htmldir@
263
+includedir = @includedir@
264
+infodir = @infodir@
265
+install_sh = @install_sh@
266
+libdir = @libdir@
267
+libexecdir = @libexecdir@
268
+localedir = @localedir@
269
+localstatedir = @localstatedir@
270
+mandir = @mandir@
271
+mkdir_p = @mkdir_p@
272
+oldincludedir = @oldincludedir@
273
+pdfdir = @pdfdir@
274
+pkgpyexecdir = @pkgpyexecdir@
275
+pkgpythondir = @pkgpythondir@
276
+prefix = @prefix@
277
+program_transform_name = @program_transform_name@
278
+psdir = @psdir@
279
+pyexecdir = @pyexecdir@
280
+pythondir = @pythondir@
281
+sbindir = @sbindir@
282
+sharedstatedir = @sharedstatedir@
283
+srcdir = @srcdir@
284
+sysconfdir = @sysconfdir@
285
+target_alias = @target_alias@
286
+top_build_prefix = @top_build_prefix@
287
+top_builddir = @top_builddir@
288
+top_srcdir = @top_srcdir@
289
+SUBDIRS = slim
290
+lodel2_scripts_dir = $(datadir)/lodel2/scripts
291
+lodel2_scripts__DATA = create_instance
292
+CLEANFILES = $(lodel2_scripts__DATA)
293
+do_subst = sed -e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g' 
294
+all: all-recursive
295
+
296
+.SUFFIXES:
297
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
298
+	@for dep in $?; do \
299
+	  case '$(am__configure_deps)' in \
300
+	    *$$dep*) \
301
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
302
+	        && { if test -f $@; then exit 0; else break; fi; }; \
303
+	      exit 1;; \
304
+	  esac; \
305
+	done; \
306
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu progs/Makefile'; \
307
+	$(am__cd) $(top_srcdir) && \
308
+	  $(AUTOMAKE) --gnu progs/Makefile
309
+.PRECIOUS: Makefile
310
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
311
+	@case '$?' in \
312
+	  *config.status*) \
313
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
314
+	  *) \
315
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
316
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
317
+	esac;
318
+
319
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
320
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
321
+
322
+$(top_srcdir)/configure:  $(am__configure_deps)
323
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
324
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
325
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
326
+$(am__aclocal_m4_deps):
327
+install-lodel2_scripts_DATA: $(lodel2_scripts__DATA)
328
+	@$(NORMAL_INSTALL)
329
+	@list='$(lodel2_scripts__DATA)'; test -n "$(lodel2_scripts_dir)" || list=; \
330
+	if test -n "$$list"; then \
331
+	  echo " $(MKDIR_P) '$(DESTDIR)$(lodel2_scripts_dir)'"; \
332
+	  $(MKDIR_P) "$(DESTDIR)$(lodel2_scripts_dir)" || exit 1; \
333
+	fi; \
334
+	for p in $$list; do \
335
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
336
+	  echo "$$d$$p"; \
337
+	done | $(am__base_list) | \
338
+	while read files; do \
339
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(lodel2_scripts_dir)'"; \
340
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(lodel2_scripts_dir)" || exit $$?; \
341
+	done
342
+
343
+uninstall-lodel2_scripts_DATA:
344
+	@$(NORMAL_UNINSTALL)
345
+	@list='$(lodel2_scripts__DATA)'; test -n "$(lodel2_scripts_dir)" || list=; \
346
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
347
+	dir='$(DESTDIR)$(lodel2_scripts_dir)'; $(am__uninstall_files_from_dir)
348
+
349
+# This directory's subdirectories are mostly independent; you can cd
350
+# into them and run 'make' without going through this Makefile.
351
+# To change the values of 'make' variables: instead of editing Makefiles,
352
+# (1) if the variable is set in 'config.status', edit 'config.status'
353
+#     (which will cause the Makefiles to be regenerated when you run 'make');
354
+# (2) otherwise, pass the desired values on the 'make' command line.
355
+$(am__recursive_targets):
356
+	@fail=; \
357
+	if $(am__make_keepgoing); then \
358
+	  failcom='fail=yes'; \
359
+	else \
360
+	  failcom='exit 1'; \
361
+	fi; \
362
+	dot_seen=no; \
363
+	target=`echo $@ | sed s/-recursive//`; \
364
+	case "$@" in \
365
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
366
+	  *) list='$(SUBDIRS)' ;; \
367
+	esac; \
368
+	for subdir in $$list; do \
369
+	  echo "Making $$target in $$subdir"; \
370
+	  if test "$$subdir" = "."; then \
371
+	    dot_seen=yes; \
372
+	    local_target="$$target-am"; \
373
+	  else \
374
+	    local_target="$$target"; \
375
+	  fi; \
376
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
377
+	  || eval $$failcom; \
378
+	done; \
379
+	if test "$$dot_seen" = "no"; then \
380
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
381
+	fi; test -z "$$fail"
382
+
383
+ID: $(am__tagged_files)
384
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
385
+tags: tags-recursive
386
+TAGS: tags
387
+
388
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
389
+	set x; \
390
+	here=`pwd`; \
391
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
392
+	  include_option=--etags-include; \
393
+	  empty_fix=.; \
394
+	else \
395
+	  include_option=--include; \
396
+	  empty_fix=; \
397
+	fi; \
398
+	list='$(SUBDIRS)'; for subdir in $$list; do \
399
+	  if test "$$subdir" = .; then :; else \
400
+	    test ! -f $$subdir/TAGS || \
401
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
402
+	  fi; \
403
+	done; \
404
+	$(am__define_uniq_tagged_files); \
405
+	shift; \
406
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
407
+	  test -n "$$unique" || unique=$$empty_fix; \
408
+	  if test $$# -gt 0; then \
409
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
410
+	      "$$@" $$unique; \
411
+	  else \
412
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
413
+	      $$unique; \
414
+	  fi; \
415
+	fi
416
+ctags: ctags-recursive
417
+
418
+CTAGS: ctags
419
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
420
+	$(am__define_uniq_tagged_files); \
421
+	test -z "$(CTAGS_ARGS)$$unique" \
422
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
423
+	     $$unique
424
+
425
+GTAGS:
426
+	here=`$(am__cd) $(top_builddir) && pwd` \
427
+	  && $(am__cd) $(top_srcdir) \
428
+	  && gtags -i $(GTAGS_ARGS) "$$here"
429
+cscopelist: cscopelist-recursive
430
+
431
+cscopelist-am: $(am__tagged_files)
432
+	list='$(am__tagged_files)'; \
433
+	case "$(srcdir)" in \
434
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
435
+	  *) sdir=$(subdir)/$(srcdir) ;; \
436
+	esac; \
437
+	for i in $$list; do \
438
+	  if test -f "$$i"; then \
439
+	    echo "$(subdir)/$$i"; \
440
+	  else \
441
+	    echo "$$sdir/$$i"; \
442
+	  fi; \
443
+	done >> $(top_builddir)/cscope.files
444
+
445
+distclean-tags:
446
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
447
+
448
+distdir: $(DISTFILES)
449
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
450
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
451
+	list='$(DISTFILES)'; \
452
+	  dist_files=`for file in $$list; do echo $$file; done | \
453
+	  sed -e "s|^$$srcdirstrip/||;t" \
454
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
455
+	case $$dist_files in \
456
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
457
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
458
+			   sort -u` ;; \
459
+	esac; \
460
+	for file in $$dist_files; do \
461
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
462
+	  if test -d $$d/$$file; then \
463
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
464
+	    if test -d "$(distdir)/$$file"; then \
465
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
466
+	    fi; \
467
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
468
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
469
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
470
+	    fi; \
471
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
472
+	  else \
473
+	    test -f "$(distdir)/$$file" \
474
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
475
+	    || exit 1; \
476
+	  fi; \
477
+	done
478
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
479
+	  if test "$$subdir" = .; then :; else \
480
+	    $(am__make_dryrun) \
481
+	      || test -d "$(distdir)/$$subdir" \
482
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
483
+	      || exit 1; \
484
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
485
+	    $(am__relativize); \
486
+	    new_distdir=$$reldir; \
487
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
488
+	    $(am__relativize); \
489
+	    new_top_distdir=$$reldir; \
490
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
491
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
492
+	    ($(am__cd) $$subdir && \
493
+	      $(MAKE) $(AM_MAKEFLAGS) \
494
+	        top_distdir="$$new_top_distdir" \
495
+	        distdir="$$new_distdir" \
496
+		am__remove_distdir=: \
497
+		am__skip_length_check=: \
498
+		am__skip_mode_fix=: \
499
+	        distdir) \
500
+	      || exit 1; \
501
+	  fi; \
502
+	done
503
+check-am: all-am
504
+check: check-recursive
505
+all-am: Makefile $(DATA)
506
+installdirs: installdirs-recursive
507
+installdirs-am:
508
+	for dir in "$(DESTDIR)$(lodel2_scripts_dir)"; do \
509
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
510
+	done
511
+install: install-recursive
512
+install-exec: install-exec-recursive
513
+install-data: install-data-recursive
514
+uninstall: uninstall-recursive
515
+
516
+install-am: all-am
517
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
518
+
519
+installcheck: installcheck-recursive
520
+install-strip:
521
+	if test -z '$(STRIP)'; then \
522
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
523
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
524
+	      install; \
525
+	else \
526
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
527
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
528
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
529
+	fi
530
+mostlyclean-generic:
531
+
532
+clean-generic:
533
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
534
+
535
+distclean-generic:
536
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
537
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
538
+
539
+maintainer-clean-generic:
540
+	@echo "This command is intended for maintainers to use"
541
+	@echo "it deletes files that may require special tools to rebuild."
542
+clean: clean-recursive
543
+
544
+clean-am: clean-generic mostlyclean-am
545
+
546
+distclean: distclean-recursive
547
+	-rm -f Makefile
548
+distclean-am: clean-am distclean-generic distclean-tags
549
+
550
+dvi: dvi-recursive
551
+
552
+dvi-am:
553
+
554
+html: html-recursive
555
+
556
+html-am:
557
+
558
+info: info-recursive
559
+
560
+info-am:
561
+
562
+install-data-am: install-lodel2_scripts_DATA
563
+	@$(NORMAL_INSTALL)
564
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
565
+install-dvi: install-dvi-recursive
566
+
567
+install-dvi-am:
568
+
569
+install-exec-am:
570
+
571
+install-html: install-html-recursive
572
+
573
+install-html-am:
574
+
575
+install-info: install-info-recursive
576
+
577
+install-info-am:
578
+
579
+install-man:
580
+
581
+install-pdf: install-pdf-recursive
582
+
583
+install-pdf-am:
584
+
585
+install-ps: install-ps-recursive
586
+
587
+install-ps-am:
588
+
589
+installcheck-am:
590
+
591
+maintainer-clean: maintainer-clean-recursive
592
+	-rm -f Makefile
593
+maintainer-clean-am: distclean-am maintainer-clean-generic
594
+
595
+mostlyclean: mostlyclean-recursive
596
+
597
+mostlyclean-am: mostlyclean-generic
598
+
599
+pdf: pdf-recursive
600
+
601
+pdf-am:
602
+
603
+ps: ps-recursive
604
+
605
+ps-am:
606
+
607
+uninstall-am: uninstall-lodel2_scripts_DATA
608
+
609
+.MAKE: $(am__recursive_targets) install-am install-data-am \
610
+	install-strip
611
+
612
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
613
+	check-am clean clean-generic cscopelist-am ctags ctags-am \
614
+	distclean distclean-generic distclean-tags distdir dvi dvi-am \
615
+	html html-am info info-am install install-am install-data \
616
+	install-data-am install-data-hook install-dvi install-dvi-am \
617
+	install-exec install-exec-am install-html install-html-am \
618
+	install-info install-info-am install-lodel2_scripts_DATA \
619
+	install-man install-pdf install-pdf-am install-ps \
620
+	install-ps-am install-strip installcheck installcheck-am \
621
+	installdirs installdirs-am maintainer-clean \
622
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
623
+	pdf-am ps ps-am tags tags-am uninstall uninstall-am \
624
+	uninstall-lodel2_scripts_DATA
625
+
626
+
627
+create_instance: create_instance.sh
628
+	$(do_subst) < $(srcdir)/create_instance.sh > create_instance
629
+	chmod +x create_instance
630
+
631
+install-data-hook:
632
+	chmod +x $(datadir)/lodel2/scripts/create_instance
633
+
634
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
635
+# Otherwise a system limit (for SysV at least) may be exceeded.
636
+.NOEXPORT:

scripts/create_instance.sh → progs/create_instance.sh View File

@@ -25,11 +25,12 @@ name="$1"
25 25
 instdir="$2"
26 26
 
27 27
 
28
-libdir=$(realpath $(dirname $0)/../)
28
+libdir=[@]PKGPYTHONDIR[@]
29 29
 install_tpl="$3"
30
-install_tpl="${install_tpl:=$libdir/install}"
30
+[ -z "$install_tpl" ] && usage
31 31
 em_file="$4"
32
-em_file="${em_file:=$libdir/examples/em_test.pickle}"
32
+[ -z "$em_file" ] && usage
33
+
33 34
 
34 35
 libdir=$(realpath $libdir)
35 36
 install_tpl=$(realpath $install_tpl)

+ 32
- 0
progs/slim/Makefile.am View File

@@ -0,0 +1,32 @@
1
+bin_SCRIPTS = slim
2
+CLEANFILES = $(bin_SCRIPTS)
3
+EXTRA_DIST = slim.py
4
+
5
+lodel2_scripts_dir = $(datadir)/lodel2/scripts
6
+
7
+slimdatadir = $(datadir)/lodel2/slim/
8
+slimdata_DATA = emfile.pickle
9
+
10
+slim_install_model_dir = $(slimdatadir)/install_model
11
+slim_install_model__DATA = 	install_model/loader.py \
12
+				install_model/lodel_admin.py \
13
+				install_model/Makefile 
14
+
15
+slim_conf_model_dir = $(slim_install_model_dir)/conf.d/
16
+slim_conf_model__DATA = install_model/conf.d/lodel2.ini
17
+
18
+slim_var__DATA = slim_instances.json
19
+slim_var_dir = $(localstatedir)/lodel2/slim/
20
+
21
+
22
+
23
+do_subst = sed -e 's,\[@\]LODEL2_PROGSDIR\[@\],$(lodel2_scripts_dir),g' \
24
+	-e 's,\[@\]SLIM_DATADIR\[@\],$(slimdatadir),g' \
25
+	-e 's,\[@\]SLIM_INSTALLMODEL_DIR\[@\],$(slim_install_model_dir),g' \
26
+	-e 's,\[@\]SLIM_VAR_DIR\[@\],$(slim_var_dir),g' \
27
+	-e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g'
28
+
29
+slim: slim.py
30
+	$(do_subst) < $(srcdir)/slim.py > slim
31
+	chmod +x slim
32
+

+ 578
- 0
progs/slim/Makefile.in View File

@@ -0,0 +1,578 @@
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2
+# @configure_input@
3
+
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
+
6
+# This Makefile.in is free software; the Free Software Foundation
7
+# gives unlimited permission to copy and/or distribute it,
8
+# with or without modifications, as long as this notice is preserved.
9
+
10
+# This program is distributed in the hope that it will be useful,
11
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
+# PARTICULAR PURPOSE.
14
+
15
+@SET_MAKE@
16
+
17
+
18
+VPATH = @srcdir@
19
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
20
+am__make_running_with_option = \
21
+  case $${target_option-} in \
22
+      ?) ;; \
23
+      *) echo "am__make_running_with_option: internal error: invalid" \
24
+              "target option '$${target_option-}' specified" >&2; \
25
+         exit 1;; \
26
+  esac; \
27
+  has_opt=no; \
28
+  sane_makeflags=$$MAKEFLAGS; \
29
+  if $(am__is_gnu_make); then \
30
+    sane_makeflags=$$MFLAGS; \
31
+  else \
32
+    case $$MAKEFLAGS in \
33
+      *\\[\ \	]*) \
34
+        bs=\\; \
35
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
36
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
37
+    esac; \
38
+  fi; \
39
+  skip_next=no; \
40
+  strip_trailopt () \
41
+  { \
42
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
43
+  }; \
44
+  for flg in $$sane_makeflags; do \
45
+    test $$skip_next = yes && { skip_next=no; continue; }; \
46
+    case $$flg in \
47
+      *=*|--*) continue;; \
48
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
49
+      -*I?*) strip_trailopt 'I';; \
50
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
51
+      -*O?*) strip_trailopt 'O';; \
52
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
53
+      -*l?*) strip_trailopt 'l';; \
54
+      -[dEDm]) skip_next=yes;; \
55
+      -[JT]) skip_next=yes;; \
56
+    esac; \
57
+    case $$flg in \
58
+      *$$target_option*) has_opt=yes; break;; \
59
+    esac; \
60
+  done; \
61
+  test $$has_opt = yes
62
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
63
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
64
+pkgdatadir = $(datadir)/@PACKAGE@
65
+pkgincludedir = $(includedir)/@PACKAGE@
66
+pkglibdir = $(libdir)/@PACKAGE@
67
+pkglibexecdir = $(libexecdir)/@PACKAGE@
68
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
69
+install_sh_DATA = $(install_sh) -c -m 644
70
+install_sh_PROGRAM = $(install_sh) -c
71
+install_sh_SCRIPT = $(install_sh) -c
72
+INSTALL_HEADER = $(INSTALL_DATA)
73
+transform = $(program_transform_name)
74
+NORMAL_INSTALL = :
75
+PRE_INSTALL = :
76
+POST_INSTALL = :
77
+NORMAL_UNINSTALL = :
78
+PRE_UNINSTALL = :
79
+POST_UNINSTALL = :
80
+subdir = progs/slim
81
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
82
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
83
+am__aclocal_m4_deps = $(top_srcdir)/m4/python.m4 \
84
+	$(top_srcdir)/m4/python_pyconfigure.m4 \
85
+	$(top_srcdir)/configure.ac
86
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
87
+	$(ACLOCAL_M4)
88
+mkinstalldirs = $(install_sh) -d
89
+CONFIG_CLEAN_FILES =
90
+CONFIG_CLEAN_VPATH_FILES =
91
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
92
+am__vpath_adj = case $$p in \
93
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
94
+    *) f=$$p;; \
95
+  esac;
96
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
97
+am__install_max = 40
98
+am__nobase_strip_setup = \
99
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
100
+am__nobase_strip = \
101
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
102
+am__nobase_list = $(am__nobase_strip_setup); \
103
+  for p in $$list; do echo "$$p $$p"; done | \
104
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
105
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
106
+    if (++n[$$2] == $(am__install_max)) \
107
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
108
+    END { for (dir in files) print dir, files[dir] }'
109
+am__base_list = \
110
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
111
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
112
+am__uninstall_files_from_dir = { \
113
+  test -z "$$files" \
114
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
115
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
116
+         $(am__cd) "$$dir" && rm -f $$files; }; \
117
+  }
118
+am__installdirs = "$(DESTDIR)$(bindir)" \
119
+	"$(DESTDIR)$(slim_conf_model_dir)" \
120
+	"$(DESTDIR)$(slim_install_model_dir)" \
121
+	"$(DESTDIR)$(slim_var_dir)" "$(DESTDIR)$(slimdatadir)"
122
+SCRIPTS = $(bin_SCRIPTS)
123
+AM_V_P = $(am__v_P_@AM_V@)
124
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
125
+am__v_P_0 = false
126
+am__v_P_1 = :
127
+AM_V_GEN = $(am__v_GEN_@AM_V@)
128
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
129
+am__v_GEN_0 = @echo "  GEN     " $@;
130
+am__v_GEN_1 = 
131
+AM_V_at = $(am__v_at_@AM_V@)
132
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
133
+am__v_at_0 = @
134
+am__v_at_1 = 
135
+SOURCES =
136
+DIST_SOURCES =
137
+am__can_run_installinfo = \
138
+  case $$AM_UPDATE_INFO_DIR in \
139
+    n|no|NO) false;; \
140
+    *) (install-info --version) >/dev/null 2>&1;; \
141
+  esac
142
+DATA = $(slim_conf_model__DATA) $(slim_install_model__DATA) \
143
+	$(slim_var__DATA) $(slimdata_DATA)
144
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
145
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
146
+ACLOCAL = @ACLOCAL@
147
+AMTAR = @AMTAR@
148
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
149
+AUTOCONF = @AUTOCONF@
150
+AUTOHEADER = @AUTOHEADER@
151
+AUTOMAKE = @AUTOMAKE@
152
+AWK = @AWK@
153
+CYGPATH_W = @CYGPATH_W@
154
+DEFS = @DEFS@
155
+DOCOK = @DOCOK@
156
+DOXYGEN = @DOXYGEN@
157
+DOXYPY = @DOXYPY@
158
+ECHO_C = @ECHO_C@
159
+ECHO_N = @ECHO_N@
160
+ECHO_T = @ECHO_T@
161
+GRAPHVIZ = @GRAPHVIZ@
162
+INSTALL = @INSTALL@
163
+INSTALL_DATA = @INSTALL_DATA@
164
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
165
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
166
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
167
+LIBOBJS = @LIBOBJS@
168
+LIBS = @LIBS@
169
+LTLIBOBJS = @LTLIBOBJS@
170
+MAKEINFO = @MAKEINFO@
171
+MKDIR_P = @MKDIR_P@
172
+PACKAGE = @PACKAGE@
173
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
174
+PACKAGE_NAME = @PACKAGE_NAME@
175
+PACKAGE_STRING = @PACKAGE_STRING@
176
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
177
+PACKAGE_URL = @PACKAGE_URL@
178
+PACKAGE_VERSION = @PACKAGE_VERSION@
179
+PATH_SEPARATOR = @PATH_SEPARATOR@
180
+PYMONGO = @PYMONGO@
181
+PYTHON = @PYTHON@
182
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
183
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
184
+PYTHON_PREFIX = @PYTHON_PREFIX@
185
+PYTHON_VERSION = @PYTHON_VERSION@
186
+SET_MAKE = @SET_MAKE@
187
+SHELL = @SHELL@
188
+SITEPACKAGES = @SITEPACKAGES@
189
+STRIP = @STRIP@
190
+VERSION = @VERSION@
191
+WEBUI = @WEBUI@
192
+abs_builddir = @abs_builddir@
193
+abs_srcdir = @abs_srcdir@
194
+abs_top_builddir = @abs_top_builddir@
195
+abs_top_srcdir = @abs_top_srcdir@
196
+am__leading_dot = @am__leading_dot@
197
+am__tar = @am__tar@
198
+am__untar = @am__untar@
199
+bindir = @bindir@
200
+build_alias = @build_alias@
201
+builddir = @builddir@
202
+datadir = @datadir@
203
+datarootdir = @datarootdir@
204
+docdir = @docdir@
205
+dvidir = @dvidir@
206
+exec_prefix = @exec_prefix@
207
+host_alias = @host_alias@
208
+htmldir = @htmldir@
209
+includedir = @includedir@
210
+infodir = @infodir@
211
+install_sh = @install_sh@
212
+libdir = @libdir@
213
+libexecdir = @libexecdir@
214
+localedir = @localedir@
215
+localstatedir = @localstatedir@
216
+mandir = @mandir@
217
+mkdir_p = @mkdir_p@
218
+oldincludedir = @oldincludedir@
219
+pdfdir = @pdfdir@
220
+pkgpyexecdir = @pkgpyexecdir@
221
+pkgpythondir = @pkgpythondir@
222
+prefix = @prefix@
223
+program_transform_name = @program_transform_name@
224
+psdir = @psdir@
225
+pyexecdir = @pyexecdir@
226
+pythondir = @pythondir@
227
+sbindir = @sbindir@
228
+sharedstatedir = @sharedstatedir@
229
+srcdir = @srcdir@
230
+sysconfdir = @sysconfdir@
231
+target_alias = @target_alias@
232
+top_build_prefix = @top_build_prefix@
233
+top_builddir = @top_builddir@
234
+top_srcdir = @top_srcdir@
235
+bin_SCRIPTS = slim
236
+CLEANFILES = $(bin_SCRIPTS)
237
+EXTRA_DIST = slim.py
238
+lodel2_scripts_dir = $(datadir)/lodel2/scripts
239
+slimdatadir = $(datadir)/lodel2/slim/
240
+slimdata_DATA = emfile.pickle
241
+slim_install_model_dir = $(slimdatadir)/install_model
242
+slim_install_model__DATA = install_model/loader.py \
243
+				install_model/lodel_admin.py \
244
+				install_model/Makefile 
245
+
246
+slim_conf_model_dir = $(slim_install_model_dir)/conf.d/
247
+slim_conf_model__DATA = install_model/conf.d/lodel2.ini
248
+slim_var__DATA = slim_instances.json
249
+slim_var_dir = $(localstatedir)/lodel2/slim/
250
+do_subst = sed -e 's,\[@\]LODEL2_PROGSDIR\[@\],$(lodel2_scripts_dir),g' \
251
+	-e 's,\[@\]SLIM_DATADIR\[@\],$(slimdatadir),g' \
252
+	-e 's,\[@\]SLIM_INSTALLMODEL_DIR\[@\],$(slim_install_model_dir),g' \
253
+	-e 's,\[@\]SLIM_VAR_DIR\[@\],$(slim_var_dir),g' \
254
+	-e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g'
255
+
256
+all: all-am
257
+
258
+.SUFFIXES:
259
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
260
+	@for dep in $?; do \
261
+	  case '$(am__configure_deps)' in \
262
+	    *$$dep*) \
263
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
264
+	        && { if test -f $@; then exit 0; else break; fi; }; \
265
+	      exit 1;; \
266
+	  esac; \
267
+	done; \
268
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu progs/slim/Makefile'; \
269
+	$(am__cd) $(top_srcdir) && \
270
+	  $(AUTOMAKE) --gnu progs/slim/Makefile
271
+.PRECIOUS: Makefile
272
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
273
+	@case '$?' in \
274
+	  *config.status*) \
275
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
276
+	  *) \
277
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
278
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
279
+	esac;
280
+
281
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
282
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
283
+
284
+$(top_srcdir)/configure:  $(am__configure_deps)
285
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
286
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
287
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
288
+$(am__aclocal_m4_deps):
289
+install-binSCRIPTS: $(bin_SCRIPTS)
290
+	@$(NORMAL_INSTALL)
291
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
292
+	if test -n "$$list"; then \
293
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
294
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
295
+	fi; \
296
+	for p in $$list; do \
297
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
298
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
299
+	done | \
300
+	sed -e 'p;s,.*/,,;n' \
301
+	    -e 'h;s|.*|.|' \
302
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
303
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
304
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
305
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
306
+	      if (++n[d] == $(am__install_max)) { \
307
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
308
+	    else { print "f", d "/" $$4, $$1 } } \
309
+	  END { for (d in files) print "f", d, files[d] }' | \
310
+	while read type dir files; do \
311
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
312
+	     test -z "$$files" || { \
313
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
314
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
315
+	     } \
316
+	; done
317
+
318
+uninstall-binSCRIPTS:
319
+	@$(NORMAL_UNINSTALL)
320
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
321
+	files=`for p in $$list; do echo "$$p"; done | \
322
+	       sed -e 's,.*/,,;$(transform)'`; \
323
+	dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
324
+install-slim_conf_model_DATA: $(slim_conf_model__DATA)
325
+	@$(NORMAL_INSTALL)
326
+	@list='$(slim_conf_model__DATA)'; test -n "$(slim_conf_model_dir)" || list=; \
327
+	if test -n "$$list"; then \
328
+	  echo " $(MKDIR_P) '$(DESTDIR)$(slim_conf_model_dir)'"; \
329
+	  $(MKDIR_P) "$(DESTDIR)$(slim_conf_model_dir)" || exit 1; \
330
+	fi; \
331
+	for p in $$list; do \
332
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
333
+	  echo "$$d$$p"; \
334
+	done | $(am__base_list) | \
335
+	while read files; do \
336
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(slim_conf_model_dir)'"; \
337
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(slim_conf_model_dir)" || exit $$?; \
338
+	done
339
+
340
+uninstall-slim_conf_model_DATA:
341
+	@$(NORMAL_UNINSTALL)
342
+	@list='$(slim_conf_model__DATA)'; test -n "$(slim_conf_model_dir)" || list=; \
343
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
344
+	dir='$(DESTDIR)$(slim_conf_model_dir)'; $(am__uninstall_files_from_dir)
345
+install-slim_install_model_DATA: $(slim_install_model__DATA)
346
+	@$(NORMAL_INSTALL)
347
+	@list='$(slim_install_model__DATA)'; test -n "$(slim_install_model_dir)" || list=; \
348
+	if test -n "$$list"; then \
349
+	  echo " $(MKDIR_P) '$(DESTDIR)$(slim_install_model_dir)'"; \
350
+	  $(MKDIR_P) "$(DESTDIR)$(slim_install_model_dir)" || exit 1; \
351
+	fi; \
352
+	for p in $$list; do \
353
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
354
+	  echo "$$d$$p"; \
355
+	done | $(am__base_list) | \
356
+	while read files; do \
357
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(slim_install_model_dir)'"; \
358
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(slim_install_model_dir)" || exit $$?; \
359
+	done
360
+
361
+uninstall-slim_install_model_DATA:
362
+	@$(NORMAL_UNINSTALL)
363
+	@list='$(slim_install_model__DATA)'; test -n "$(slim_install_model_dir)" || list=; \
364
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
365
+	dir='$(DESTDIR)$(slim_install_model_dir)'; $(am__uninstall_files_from_dir)
366
+install-slim_var_DATA: $(slim_var__DATA)
367
+	@$(NORMAL_INSTALL)
368
+	@list='$(slim_var__DATA)'; test -n "$(slim_var_dir)" || list=; \
369
+	if test -n "$$list"; then \
370
+	  echo " $(MKDIR_P) '$(DESTDIR)$(slim_var_dir)'"; \
371
+	  $(MKDIR_P) "$(DESTDIR)$(slim_var_dir)" || exit 1; \
372
+	fi; \
373
+	for p in $$list; do \
374
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
375
+	  echo "$$d$$p"; \
376
+	done | $(am__base_list) | \
377
+	while read files; do \
378
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(slim_var_dir)'"; \
379
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(slim_var_dir)" || exit $$?; \
380
+	done
381
+
382
+uninstall-slim_var_DATA:
383
+	@$(NORMAL_UNINSTALL)
384
+	@list='$(slim_var__DATA)'; test -n "$(slim_var_dir)" || list=; \
385
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
386
+	dir='$(DESTDIR)$(slim_var_dir)'; $(am__uninstall_files_from_dir)
387
+install-slimdataDATA: $(slimdata_DATA)
388
+	@$(NORMAL_INSTALL)
389
+	@list='$(slimdata_DATA)'; test -n "$(slimdatadir)" || list=; \
390
+	if test -n "$$list"; then \
391
+	  echo " $(MKDIR_P) '$(DESTDIR)$(slimdatadir)'"; \
392
+	  $(MKDIR_P) "$(DESTDIR)$(slimdatadir)" || exit 1; \
393
+	fi; \
394
+	for p in $$list; do \
395
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
396
+	  echo "$$d$$p"; \
397
+	done | $(am__base_list) | \
398
+	while read files; do \
399
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(slimdatadir)'"; \
400
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(slimdatadir)" || exit $$?; \
401
+	done
402
+
403
+uninstall-slimdataDATA:
404
+	@$(NORMAL_UNINSTALL)
405
+	@list='$(slimdata_DATA)'; test -n "$(slimdatadir)" || list=; \
406
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
407
+	dir='$(DESTDIR)$(slimdatadir)'; $(am__uninstall_files_from_dir)
408
+tags TAGS:
409
+
410
+ctags CTAGS:
411
+
412
+cscope cscopelist:
413
+
414
+
415
+distdir: $(DISTFILES)
416
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
417
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
418
+	list='$(DISTFILES)'; \
419
+	  dist_files=`for file in $$list; do echo $$file; done | \
420
+	  sed -e "s|^$$srcdirstrip/||;t" \
421
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
422
+	case $$dist_files in \
423
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
424
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
425
+			   sort -u` ;; \
426
+	esac; \
427
+	for file in $$dist_files; do \
428
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
429
+	  if test -d $$d/$$file; then \
430
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
431
+	    if test -d "$(distdir)/$$file"; then \
432
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
433
+	    fi; \
434
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
435
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
436
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
437
+	    fi; \
438
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
439
+	  else \
440
+	    test -f "$(distdir)/$$file" \
441
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
442
+	    || exit 1; \
443
+	  fi; \
444
+	done
445
+check-am: all-am
446
+check: check-am
447
+all-am: Makefile $(SCRIPTS) $(DATA)
448
+installdirs:
449
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(slim_conf_model_dir)" "$(DESTDIR)$(slim_install_model_dir)" "$(DESTDIR)$(slim_var_dir)" "$(DESTDIR)$(slimdatadir)"; do \
450
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
451
+	done
452
+install: install-am
453
+install-exec: install-exec-am
454
+install-data: install-data-am
455
+uninstall: uninstall-am
456
+
457
+install-am: all-am
458
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
459
+
460
+installcheck: installcheck-am
461
+install-strip:
462
+	if test -z '$(STRIP)'; then \
463
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
464
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
465
+	      install; \
466
+	else \
467
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
468
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
469
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
470
+	fi
471
+mostlyclean-generic:
472
+
473
+clean-generic:
474
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
475
+
476
+distclean-generic:
477
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
478
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
479
+
480
+maintainer-clean-generic:
481
+	@echo "This command is intended for maintainers to use"
482
+	@echo "it deletes files that may require special tools to rebuild."
483
+clean: clean-am
484
+
485
+clean-am: clean-generic mostlyclean-am
486
+
487
+distclean: distclean-am
488
+	-rm -f Makefile
489
+distclean-am: clean-am distclean-generic
490
+
491
+dvi: dvi-am
492
+
493
+dvi-am:
494
+
495
+html: html-am
496
+
497
+html-am:
498
+
499
+info: info-am
500
+
501
+info-am:
502
+
503
+install-data-am: install-slim_conf_model_DATA \
504
+	install-slim_install_model_DATA install-slim_var_DATA \
505
+	install-slimdataDATA
506
+
507
+install-dvi: install-dvi-am
508
+
509
+install-dvi-am:
510
+
511
+install-exec-am: install-binSCRIPTS
512
+
513
+install-html: install-html-am
514
+
515
+install-html-am:
516
+
517
+install-info: install-info-am
518
+
519
+install-info-am:
520
+
521
+install-man:
522
+
523
+install-pdf: install-pdf-am
524
+
525
+install-pdf-am:
526
+
527
+install-ps: install-ps-am
528
+
529
+install-ps-am:
530
+
531
+installcheck-am:
532
+
533
+maintainer-clean: maintainer-clean-am
534
+	-rm -f Makefile
535
+maintainer-clean-am: distclean-am maintainer-clean-generic
536
+
537
+mostlyclean: mostlyclean-am
538
+
539
+mostlyclean-am: mostlyclean-generic
540
+
541
+pdf: pdf-am
542
+
543
+pdf-am:
544
+
545
+ps: ps-am
546
+
547
+ps-am:
548
+
549
+uninstall-am: uninstall-binSCRIPTS uninstall-slim_conf_model_DATA \
550
+	uninstall-slim_install_model_DATA uninstall-slim_var_DATA \
551
+	uninstall-slimdataDATA
552
+
553
+.MAKE: install-am install-strip
554
+
555
+.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
556
+	ctags-am distclean distclean-generic distdir dvi dvi-am html \
557
+	html-am info info-am install install-am install-binSCRIPTS \
558
+	install-data install-data-am install-dvi install-dvi-am \
559
+	install-exec install-exec-am install-html install-html-am \
560
+	install-info install-info-am install-man install-pdf \
561
+	install-pdf-am install-ps install-ps-am \
562
+	install-slim_conf_model_DATA install-slim_install_model_DATA \
563
+	install-slim_var_DATA install-slimdataDATA install-strip \
564
+	installcheck installcheck-am installdirs maintainer-clean \
565
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
566
+	pdf-am ps ps-am tags-am uninstall uninstall-am \
567
+	uninstall-binSCRIPTS uninstall-slim_conf_model_DATA \
568
+	uninstall-slim_install_model_DATA uninstall-slim_var_DATA \
569
+	uninstall-slimdataDATA
570
+
571
+
572
+slim: slim.py
573
+	$(do_subst) < $(srcdir)/slim.py > slim
574
+	chmod +x slim
575
+
576
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
577
+# Otherwise a system limit (for SysV at least) may be exceeded.
578
+.NOEXPORT:

progs/slim_ressources/emfile.pickle → progs/slim/emfile.pickle View File


progs/slim_ressources/slim_install_model/Makefile → progs/slim/install_model/Makefile View File


progs/slim_ressources/slim_install_model/conf.d/lodel2.ini → progs/slim/install_model/conf.d/lodel2.ini View File


progs/slim_ressources/slim_install_model/loader.py → progs/slim/install_model/loader.py View File


progs/slim_ressources/slim_install_model/lodel_admin.py → progs/slim/install_model/lodel_admin.py View File


progs/slim.py → progs/slim/slim.py View File

@@ -2,14 +2,6 @@
2 2
 #-*- coding: utf-8 -*-
3 3
 
4 4
 
5
-INSTANCES_ABSPATH="/tmp/lodel2_instances"
6
-STORE_FILE='./instances.json'
7
-CREATION_SCRIPT='../scripts/create_instance.sh'
8
-INSTALL_TPL = './slim_ressources/slim_install_model'
9
-EMFILE = './slim_ressources/emfile.pickle'
10
-
11
-CONFFILE='conf.d/lodel2.ini'
12
-
13 5
 import os, os.path
14 6
 import sys
15 7
 import shutil
@@ -18,13 +10,32 @@ import logging
18 10
 import re
19 11
 import json
20 12
 import configparser
13
+import subprocess
21 14
 
22 15
 logging.basicConfig(level=logging.INFO)
23 16
 
24
-CREATION_SCRIPT=os.path.join(os.path.dirname(__file__), CREATION_SCRIPT)
25
-STORE_FILE=os.path.join(os.path.dirname(__file__), STORE_FILE)
26
-INSTALL_TPL=os.path.join(os.path.dirname(__file__), INSTALL_TPL)
27
-EMFILE=os.path.join(os.path.dirname(__file__), EMFILE)
17
+INSTANCES_ABSPATH="/tmp/lodel2_instances"
18
+CONFFILE='conf.d/lodel2.ini'
19
+try:
20
+    STORE_FILE = os.path.join("[@]SLIM_VAR_DIR[@]", 'slim_instances.json')
21
+    PID_FILE = os.path.join("[@]SLIM_VAR_DIR[@]", 'slim_instances_pid.json')
22
+    CREATION_SCRIPT = os.path.join("[@]LODEL2_PROGSDIR[@]", 'create_instance')
23
+    INSTALL_TPL = "[@]SLIM_INSTALLMODEL_DIR[@]"
24
+    EMFILE = os.path.join("[@]SLIM_DATADIR[@]", 'emfile.pickle')
25
+
26
+except SyntaxError:
27
+    STORE_FILE='./instances.json'
28
+    PID_FILE = './slim_instances_pid.json'
29
+    CREATION_SCRIPT='../scripts/create_instance.sh'
30
+    INSTALL_TPL = './slim_ressources/slim_install_model'
31
+    EMFILE = './slim_ressources/emfile.pickle'
32
+
33
+
34
+
35
+    CREATION_SCRIPT=os.path.join(os.path.dirname(__file__), CREATION_SCRIPT)
36
+    STORE_FILE=os.path.join(os.path.dirname(__file__), STORE_FILE)
37
+    INSTALL_TPL=os.path.join(os.path.dirname(__file__), INSTALL_TPL)
38
+    EMFILE=os.path.join(os.path.dirname(__file__), EMFILE)
28 39
 
29 40
 
30 41
 #STORE_FILE syntax :
@@ -125,6 +136,9 @@ def new_instance(name):
125 136
 ##@brief Delete an instance
126 137
 #@param name str : the instance name
127 138
 def delete_instance(name):
139
+    if get_pid(name) is not None:
140
+        logging.error("The instance '%s' is started. Stop it before deleting \
141
+it" % name)
128 142
     store_datas = get_store_datas()
129 143
     logging.warning("Deleting instance %s" % name)
130 144
     logging.info("Deleting instance folder %s" % store_datas[name]['path'])
@@ -135,7 +149,7 @@ def delete_instance(name):
135 149
 
136 150
 ##@brief returns stored datas
137 151
 def get_store_datas():
138
-    if not os.path.isfile(STORE_FILE):
152
+    if not os.path.isfile(STORE_FILE) or os.stat(STORE_FILE).st_size == 0:
139 153
         return dict()
140 154
     else:
141 155
         with open(STORE_FILE, 'r') as sfp:
@@ -152,6 +166,45 @@ def validate_names(names):
152 166
             print("\t%s" % name, file=sys.stderr)
153 167
         exit(1)
154 168
 
169
+##@brief Returns the PID dict
170
+#@return a dict with instance name as key an PID as value
171
+def get_pids():
172
+    if not os.path.isfile(PID_FILE):
173
+        return dict()
174
+    with open(PID_FILE, 'r') as pdf:
175
+        return json.load(pfd)
176
+
177
+##@brief Save a dict of pid
178
+#@param pid_dict dict : key is instance name values are pid
179
+def save_pids(pid_dict):
180
+    with open(PID_FILE, 'w+') as pfd:
181
+        json.dump(pid_dict, pfd)
182
+
183
+##@brief Given an instance name returns its PID
184
+#@return False or an int
185
+def get_pid(name):
186
+    pid_datas = get_pids()
187
+    if name not in pid_datas:
188
+        return False
189
+    else:
190
+        return pid_datas[name]
191
+
192
+##@brief Start an instance
193
+#@param names list : instance name list
194
+def start_instance(names):
195
+    pids = get_pids()
196
+    store_datas = get_store_datas()
197
+    
198
+    for name in names:
199
+        if name in pids:
200
+            logging.warning("The instance %s is allready running" % name)
201
+            continue
202
+        os.chdir(store_datas[name]['path'])
203
+        args = [sys.executable, 'loader.py']
204
+        curexec = subprocess.Popen(args)
205
+        pids[name] = curexec.pid
206
+        logging.info("Instance '%s' started. PID %d" % (name, curexec.pid))
207
+
155 208
 ##@brief Check if instance are specified
156 209
 def get_specified(args):
157 210
     if args.all:
@@ -355,4 +408,7 @@ or with -a)")
355 408
             exit(1)
356 409
         for name in names:
357 410
             set_conf(name, args)
411
+    elif args.start:
412
+        names = get_specified(args)
413
+        start_instance(names)
358 414
         

+ 0
- 0
progs/slim/slim_instances.json View File


Loading…
Cancel
Save