Browse Source

Makes create_mongodb.sh and its conffile handled by autotools

Yann Weber 8 years ago
parent
commit
38659c6b6d
4 changed files with 23 additions and 6 deletions
  1. 1
    1
      README
  2. 13
    4
      progs/Makefile.am
  3. 0
    0
      progs/create_mongodb_config.cfg
  4. 9
    1
      progs/mass_deploy.sh

+ 1
- 1
README View File

@@ -7,7 +7,7 @@ Dependencies :
7 7
 
8 8
 Build & install :
9 9
 	./bootstrap.sh
10
-	./configure
10
+	./configure --sysconfdir=/etc --localstatedir=/var --prefix=/usr
11 11
 	make
12 12
 	make install
13 13
 

+ 13
- 4
progs/Makefile.am View File

@@ -1,19 +1,28 @@
1 1
 SUBDIRS=slim
2 2
 
3 3
 lodel2_scripts_dir = $(datadir)/lodel2/scripts
4
-lodel2_scripts__DATA = create_instance mass_deploy
5
-CLEANFILES = $(lodel2_scripts__DATA)
4
+lodel2_scripts__DATA = create_instance mass_deploy create_mongodb.sh
5
+CLEANFILES = create_instance mass_deploy
6 6
 
7
-do_subst = sed -e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g' 
7
+lodel2conf_DATA = ./create_mongodb_config.cfg
8
+lodel2confdir=$(sysconfdir)/lodel2
9
+
10
+
11
+do_subst = sed 	-e 's,\[@\]PKGPYTHONDIR\[@\],$(pkgpythondir),g' \
12
+		-e 's,\[@\]LODEL2_PROGSDIR\[@\],$(lodel2_scripts_dir),g' \
13
+		-e 's,\[@\]LODEL2_CONFDIR\[@\],$(lodel2confdir),g'
8 14
 
9 15
 #There is clearly a way to factorise those rules
10 16
 mass_deploy: mass_deploy.sh
11 17
 	$(do_subst) < $(srcdir)/mass_deploy.sh > mass_deploy
12 18
 	chmod +x mass_deploy
13 19
 
20
+create_mongodb.sh: ;
21
+create_mongodb_config.cfg: ;
22
+
14 23
 create_instance: create_instance.sh
15 24
 	$(do_subst) < $(srcdir)/create_instance.sh > create_instance
16 25
 	chmod +x create_instance
17 26
 
18 27
 install-data-hook:
19
-	chmod +x $(datadir)/lodel2/scripts/create_instance $(datadir)/lodel2/scripts/mass_deploy
28
+	chmod +x $(datadir)/lodel2/scripts/*

progs/config.cfg → progs/create_mongodb_config.cfg View File


+ 9
- 1
progs/mass_deploy.sh View File

@@ -7,6 +7,14 @@ else
7 7
 	random_name=$RANDOM
8 8
 fi
9 9
 
10
+if hash mongo 2>/dev/null
11
+then
12
+	echo "Mongo found"
13
+else
14
+	echo "You need mongo on this host to do a mass deploy !" >&2
15
+	exit
16
+fi
17
+
10 18
 ninstance=$1
11 19
 instance=${ninstance:=50}
12 20
 
@@ -29,6 +37,6 @@ do
29 37
 	slim -n $iname -s --interface web
30 38
 	slim -n $iname -m
31 39
 	slim -n $iname -s --datasource_connectors mongodb --host localhost --user lodel2 --password lodel2 --db_name $iname
32
-	create_mongodb.sh localhost 27015 $iname lodel2 lodel2 config.cfg
40
+	[@]LODEL2_PROGSDIR[@]/create_mongodb.sh localhost 27015 $iname lodel2 lodel2 [@]LODEL2_CONFDIR[@]/create_mongodb_config.cfg
33 41
 done
34 42
 

Loading…
Cancel
Save