Browse Source

Autotools propagation of multisite variables

Better access to a few variables into the .am files. Allows for single
point of definition of variables required accross various .am.
For concerns separation, may probably switch from Makefile-common.am.inc
to Makefile-multisite.am.inc.
Quentin Bonaventure 7 years ago
parent
commit
e640ff96e7
4 changed files with 13 additions and 8 deletions
  1. 2
    0
      Makefile-common.am.inc
  2. 5
    1
      lodel/Makefile.am
  3. 2
    2
      lodel/buildconf.py.am.in
  4. 4
    5
      progs/Makefile.am

+ 2
- 0
Makefile-common.am.inc View File

@@ -0,0 +1,2 @@
1
+lodel2_multisite_data_dirname=sites_data
2
+lodel2_multisite_ctx_dirname=.sites_contexts/lodelsites

+ 5
- 1
lodel/Makefile.am View File

@@ -1,3 +1,5 @@
1
+include $(top_builddir)/Makefile-common.am.inc
2
+
1 3
 SUBDIRS=auth editorial_model leapi plugin settings utils plugins validator mlnamedobject
2 4
 EXTRA_DIST = plugins
3 5
 lodel_PYTHON = *.py
@@ -14,7 +16,9 @@ gitclean:
14 16
 logdir = $(localstatedir)/log/lodel2/
15 17
 
16 18
 do_subst = sed 	-e 's,\[@\]LODEL2_VARDIR\[@\],$(localstatedir)/lodel2/,g' \
17
-		-e 's,\[@\]LODEL2_LOGDIR\[@\],$(logdir),g'
19
+		-e 's,\[@\]LODEL2_LOGDIR\[@\],$(logdir),g' \
20
+		-e 's,\[@\]MULTISITE_DATA_DIRNAME\[@\],$(lodel2_multisite_data_dirname),g' \
21
+		-e 's,\[@\]MULTISITE_CTX_DIRNAME\[@\],$(lodel2_multisite_ctx_dirname),g'
18 22
 
19 23
 
20 24
 install-data-hook:

+ 2
- 2
lodel/buildconf.py.am.in View File

@@ -9,8 +9,8 @@ LODEL2VARDIR="[@]LODEL2_VARDIR[@]"
9 9
 LODEL2LOGDIR="[@]LODEL2_LOGDIR[@]"
10 10
 
11 11
 
12
-MULTISITE_DATADIR = 'sites_datas'
13
-MULTISITE_CONTEXTDIR = '.sites_contexts'
12
+MULTISITE_DATADIR = "[@]MULTISITE_DATA_DIRNAME[@]"
13
+MULTISITE_CONTEXTDIR = "[@]MULTISITE_CTX_DIRNAME[@]"
14 14
 MULTISITE_DYNCODE_MODULENAME = 'leapi_dyncode'
15 15
 ##@todo to be generated via autotools
16 16
 LODEL_PKG_PATH = '/usr/lib/python3/dist-package/lodel'

+ 4
- 5
progs/Makefile.am View File

@@ -1,3 +1,5 @@
1
+include $(top_builddir)/Makefile-common.am.inc
2
+
1 3
 SUBDIRS=slim
2 4
 
3 5
 lodel2_scripts_dir = $(datadir)/lodel2/scripts
@@ -8,15 +10,13 @@ EXTRA_DIST = create_instance.sh create_multisite.sh mass_deploy.sh
8 10
 lodel2conf_DATA = mass_deploy.cfg
9 11
 lodel2confdir=$(sysconfdir)/lodel2
10 12
 lodel2statedir=$(localstatedir)/lodel2
11
-lodelsites_data_dirname=sites_data
12
-lodelsites_ctx_dirname=.sites_context/lodelsites
13 13
 
14 14
 do_subst = sed -e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g' \
15 15
 		-e 's,\[@\]LODEL2_PROGSDIR\[@\],$(lodel2_scripts_dir),g' \
16 16
 		-e 's,\[@\]LODEL2_CONFDIR\[@\],$(lodel2confdir),g' \
17 17
 		-e 's,\[@\]LODEL2_VARDIR\[@\],$(lodel2statedir),g' \
18
-		-e 's,\[@\]LODELSITES_DATA_DIRNAME\[@\],$(lodelsites_data_dirname),g' \
19
-		-e 's,\[@\]LODELSITES_CTX_DIRNAME\[@\],$(lodelsites_ctx_dirname),g'
18
+		-e 's,\[@\]LODELSITES_DATA_DIRNAME\[@\],$(lodel2_multisite_data_dirname),g' \
19
+		-e 's,\[@\]LODELSITES_CTX_DIRNAME\[@\],$(lodel2_multisite_ctx_dirname),g'
20 20
 
21 21
 #There is clearly a way to factorise those rules
22 22
 mass_deploy: mass_deploy.sh
@@ -28,7 +28,6 @@ mass_deploy.cfg:
28 28
 
29 29
 create_instance: create_instance.sh
30 30
 	$(do_subst) < $(srcdir)/create_instance.sh > create_instance
31
-#	sed -e 's,\[@\]LODELSITES_DATADIR_NAME\[@\],$(lodelsites_datadir_name),g' < $(srcdir)/create_instance.sh > create_instance
32 31
 	chmod +x create_instance
33 32
 
34 33
 create_multisite: create_multisite.sh

Loading…
Cancel
Save