Browse Source

Enables debian package creation

with make deb . Next commit will update the README
Yann Weber 8 years ago
parent
commit
8f48612c82

+ 19
- 8
Makefile.am View File

1
-SUBDIRS=lodel progs plugins
2
-EXTRA_DIST=plugins runtest examples tests README
3
-CLEANFILES=runtest
1
+SUBDIRS = lodel progs plugins
2
+EXTRA_DIST = plugins runtest examples tests README runtest.sh debian
3
+CLEANFILES = runtest
4
 
4
 
5
 lodel2_localstate_DATA =
5
 lodel2_localstate_DATA =
6
 lodel2_localstatedir=$(localstatedir)/lodel2
6
 lodel2_localstatedir=$(localstatedir)/lodel2
28
 runtest: runtest.sh
28
 runtest: runtest.sh
29
 	$(do_subst) < $(srcdir)/runtest.sh > runtest
29
 	$(do_subst) < $(srcdir)/runtest.sh > runtest
30
 	chmod +x runtest
30
 	chmod +x runtest
31
-	
31
+
32
+#Adding logdir creation on install
33
+install-data-hook:
34
+	mkdir -p ${DESTDIR}$(lodel2_localstatedir)
35
+
36
+#Making debian package
37
+deb: dist
38
+	mkdir debian_package; tar -xvf ${PACKAGE}-${VERSION}.tar.gz -C ./debian_package; cd debian_package/${PACKAGE}-${VERSION}; dpkg-buildpackage -rfakeroot;
32
 
39
 
33
 # Test em update ( examples/em_test.pickle )
40
 # Test em update ( examples/em_test.pickle )
34
 em_test: em_test.py
41
 em_test: em_test.py
39
 	$(python) scripts/refreshdyn.py examples/em_test.pickle $(dyncode_filename) && echo -e "\n\nCode generated in $(dyncode_filename)"
46
 	$(python) scripts/refreshdyn.py examples/em_test.pickle $(dyncode_filename) && echo -e "\n\nCode generated in $(dyncode_filename)"
40
 
47
 
41
 # run tests
48
 # run tests
42
-check:
49
+checks:
43
 	./runtest -v
50
 	./runtest -v
44
 
51
 
45
 unittest: check
52
 unittest: check
46
 
53
 
47
 #Cleaning documentation and dyncode
54
 #Cleaning documentation and dyncode
48
 clean-local: cleandoc
55
 clean-local: cleandoc
49
-	-rm -R doc/html doc/doxygen_sqlite3.db
56
+	-rm -vR doc/html doc/doxygen_sqlite3.db
50
 cleandoc:
57
 cleandoc:
51
-	-rm $(dyncode_filename)
58
+	-rm -v $(dyncode_filename)
52
 
59
 
60
+#other cleans
53
 distclean-local:
61
 distclean-local:
54
-	-rm -R Makefile Makefile.in autom4te.cache/ aclocal.m4 install-sh missing py-compile configure
62
+	-rm -vR debian_package ${PACKAGE}-${VERSION}.tar.gz
63
+
64
+gitclean: distclean cleandoc
65
+	-rm -vR autom4te.cache/ aclocal.m4 install-sh missing py-compile configure; find ./ -name Makefile.in |xargs rm -v
55
 
66
 
56
 .PHONY: cleandoc tests doc
67
 .PHONY: cleandoc tests doc

+ 5
- 0
debian/changelog View File

1
+lodel2 (0.1) UNRELEASED; urgency=medium
2
+
3
+  * First debian package
4
+
5
+ -- Yann Weber <yann.weber@openedition.org>  Fri, 23 Sep 2016 12:09:29 +0200

+ 1
- 0
debian/compat View File

1
+9

+ 14
- 0
debian/control View File

1
+Source: lodel2
2
+Section: python
3
+Priority: optional
4
+Maintainer: lodel2 dev team
5
+Build-Depends: automake, autotools-dev, make
6
+Standards-Version: 0.1.1
7
+
8
+Package: lodel2
9
+Section: python
10
+Description: lodel2 debian package
11
+Architecture: any
12
+Depends: python3, python3-lxml, python3-jinja2, python3-werkzeug, python3-pymongo, uwsgi-plugin-python3
13
+Suggests: pwgen, wamerican, mongodb-server
14
+Provides: lodel

+ 20
- 0
debian/debhelper.log View File

1
+dh_auto_configure
2
+dh_auto_build
3
+dh_auto_test
4
+dh_prep
5
+dh_auto_install
6
+dh_installdocs
7
+dh_installchangelogs
8
+dh_pysupport
9
+dh_perl
10
+dh_link
11
+dh_compress
12
+dh_fixperms
13
+dh_strip
14
+dh_makeshlibs
15
+dh_shlibdeps
16
+dh_installdeb
17
+dh_gencontrol
18
+dh_md5sums
19
+dh_builddeb
20
+dh_builddeb

+ 1
- 0
debian/files View File

1
+lodel2_0.1_amd64.deb python optional

+ 22
- 0
debian/rules View File

1
+#!/usr/bin/make -f
2
+# consulter debhelper(7) (décommenter lorsque nécessaire)
3
+# afficher chaque commande modifiant un fichier dans le système construit
4
+#DH_VERBOSE = 1
5
+
6
+# consulter EXAMPLES dans dpkg-buildflags(1) et lire /usr/share/dpkg/*
7
+DPKG_EXPORT_BUILDFLAGS = 1
8
+include /usr/share/dpkg/default.mk
9
+
10
+# consulter FEATURE AREAS dans dpkg-buildflags(1)
11
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
12
+
13
+# consulter ENVIRONMENT dans dpkg-buildflags(1)
14
+# mainteneurs de paquet à ajouter à CFLAGS
15
+#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
16
+# mainteneurs de paquet à ajouter à append LDFLAGS
17
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
18
+
19
+# principal script d’empaquetage basé sur la syntaxe de dh7
20
+%:
21
+	dh $@ --with python3
22
+

+ 1
- 0
debian/substvars View File

1
+misc:Depends=

+ 10
- 0
debian/tmp/DEBIAN/control View File

1
+Package: lodel2
2
+Version: 0.1
3
+Architecture: amd64
4
+Maintainer: lodel2 dev team
5
+Installed-Size: 25
6
+Depends: python3, python3-lxml, python3-jinja2, python3-werkzeug, python3-pymongo, uwsgi-plugin-python3
7
+Suggests: pwgen, wamerican, mongodb-server
8
+Provides: lodel
9
+Section: python
10
+Priority: optional

+ 1
- 0
debian/tmp/DEBIAN/md5sums View File

1
+0377daa43e7232c06b702078dd86b850  usr/share/doc/lodel2/changelog.gz

BIN
debian/tmp/usr/share/doc/lodel2/changelog.gz View File


+ 3
- 3
lodel/Makefile.am View File

8
 
8
 
9
 lodeldir=$(pkgpythondir)/
9
 lodeldir=$(pkgpythondir)/
10
 
10
 
11
-distclean-local:
11
+gitclean:
12
 	-rm Makefile Makefile.in
12
 	-rm Makefile Makefile.in
13
 
13
 
14
 logdir = $(localstatedir)/log/lodel2/
14
 logdir = $(localstatedir)/log/lodel2/
18
 
18
 
19
 
19
 
20
 install-data-hook:
20
 install-data-hook:
21
-	-mkdir -p $(logdir)
21
+	-mkdir -p ${DESTDIR}$(logdir)
22
 
22
 
23
 uninstall-hook:
23
 uninstall-hook:
24
-	-rmdir $(logdir)
24
+	-rmdir ${DESTDIR}$(logdir)
25
 
25
 
26
 buildconf.py: buildconf.py.am
26
 buildconf.py: buildconf.py.am
27
 	$(do_subst) < $(srcdir)/buildconf.py.am > buildconf.py
27
 	$(do_subst) < $(srcdir)/buildconf.py.am > buildconf.py

+ 0
- 2
lodel/auth/Makefile.am View File

2
 auth_PYTHON = *.py
2
 auth_PYTHON = *.py
3
 authdir=$(pkgpythondir)/auth
3
 authdir=$(pkgpythondir)/auth
4
 
4
 
5
-distclean-local:
6
-	-rm Makefile Makefile.in

+ 0
- 3
lodel/editorial_model/Makefile.am View File

2
 
2
 
3
 em_PYTHON=*.py
3
 em_PYTHON=*.py
4
 emdir=$(pkgpythondir)/editorial_model
4
 emdir=$(pkgpythondir)/editorial_model
5
-
6
-distclean-local:
7
-	-rm Makefile Makefile.in

+ 0
- 3
lodel/editorial_model/translator/Makefile.am View File

1
 translator_PYTHON=*.py
1
 translator_PYTHON=*.py
2
 translatordir=$(pkgpythondir)/editorial_model/translator
2
 translatordir=$(pkgpythondir)/editorial_model/translator
3
-
4
-distclean-local:
5
-	-rm Makefile Makefile.in

+ 0
- 2
lodel/leapi/Makefile.am View File

3
 leapi_PYTHON= *.py
3
 leapi_PYTHON= *.py
4
 leapidir=$(pkgpythondir)/leapi
4
 leapidir=$(pkgpythondir)/leapi
5
 
5
 
6
-distclean-local:
7
-	-rm Makefile Makefile.in

+ 0
- 3
lodel/leapi/datahandlers/Makefile.am View File

1
 dh_PYTHON=*.py
1
 dh_PYTHON=*.py
2
 dhdir=$(pkgpythondir)/leapi/datahandlers
2
 dhdir=$(pkgpythondir)/leapi/datahandlers
3
-
4
-distclean-local:
5
-	-rm Makefile Makefile.in

+ 0
- 3
lodel/plugin/Makefile.am View File

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

+ 0
- 3
lodel/settings/Makefile.am View File

1
 settings_PYTHON=*.py
1
 settings_PYTHON=*.py
2
 settingsdir=$(pkgpythondir)/settings
2
 settingsdir=$(pkgpythondir)/settings
3
-
4
-distclean-local:
5
-	-rm Makefile Makefile.in

+ 0
- 3
lodel/utils/Makefile.am View File

1
 utils_PYTHON=*.py
1
 utils_PYTHON=*.py
2
 utilsdir=$(pkgpythondir)/utils
2
 utilsdir=$(pkgpythondir)/utils
3
-
4
-distclean-local:
5
-	-rm Makefile Makefile.in

+ 3
- 3
plugins/Makefile.am View File

3
 pluginsdir=$(pkgpythondir)/plugins
3
 pluginsdir=$(pkgpythondir)/plugins
4
 
4
 
5
 install-data-local:
5
 install-data-local:
6
-	mkdir $(pluginsdir); cp -R * $(pluginsdir) && rm $(pluginsdir)/Makefile*
6
+	mkdir ${DESTDIR}$(pluginsdir); cp -R * ${DESTDIR}$(pluginsdir) && rm ${DESTDIR}$(pluginsdir)/Makefile*
7
 
7
 
8
-distclean-local:
9
-	-rm -R Makefile Makefile.in $(pluginsdir)
8
+uninstall-hook:
9
+	-rm -R ${DESTDIR}$(pluginsdir)

+ 2
- 1
progs/Makefile.am View File

26
 	chmod +x create_instance
26
 	chmod +x create_instance
27
 
27
 
28
 install-data-hook:
28
 install-data-hook:
29
-	chmod +x $(datadir)/lodel2/scripts/*
29
+	chmod +x ${DESTDIR}$(datadir)/lodel2/scripts/*
30
+

+ 1
- 0
progs/mass_deploy.sh View File

26
 	else
26
 	else
27
 		echo "SLIM fails when $1. Abording...." >&2
27
 		echo "SLIM fails when $1. Abording...." >&2
28
 	fi
28
 	fi
29
+	echo "It can be a good idea to run '$0 purgedb' and 'slim -p' now that mass_deploy just crashed. Those commands should be able to clean the mess ;)"
29
 	exit 1
30
 	exit 1
30
 }
31
 }
31
 
32
 

+ 2
- 2
progs/slim/Makefile.am View File

1
 bin_SCRIPTS = slim
1
 bin_SCRIPTS = slim
2
-CLEANFILES = $(bin_SCRIPTS)
2
+CLEANFILES = $(bin_SCRIPTS) slim_instances.json slim_instances_pid.json
3
 EXTRA_DIST = slim.py install_model emfile.pickle
3
 EXTRA_DIST = slim.py install_model emfile.pickle
4
 
4
 
5
 lodel2_scripts_dir = $(datadir)/lodel2/scripts
5
 lodel2_scripts_dir = $(datadir)/lodel2/scripts
36
 	chmod +x slim
36
 	chmod +x slim
37
 
37
 
38
 install-data-hook:
38
 install-data-hook:
39
-	chmod +x $(install_model_dir)/lodel_admin.py
39
+	chmod +x ${DESTDIR}$(install_model_dir)/lodel_admin.py
40
 
40
 

Loading…
Cancel
Save