diff --git a/Makefile.am b/Makefile.am index bf2c965..5849852 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ -SUBDIRS=lodel progs plugins -EXTRA_DIST=plugins runtest examples tests README -CLEANFILES=runtest +SUBDIRS = lodel progs plugins +EXTRA_DIST = plugins runtest examples tests README runtest.sh debian +CLEANFILES = runtest lodel2_localstate_DATA = lodel2_localstatedir=$(localstatedir)/lodel2 @@ -28,7 +28,14 @@ do_subst = sed -e 's,\[@\]INSTALLMODEL_DIR\[@\],$(install_model_dir),g' runtest: runtest.sh $(do_subst) < $(srcdir)/runtest.sh > runtest chmod +x runtest - + +#Adding logdir creation on install +install-data-hook: + mkdir -p ${DESTDIR}$(lodel2_localstatedir) + +#Making debian package +deb: dist + mkdir debian_package; tar -xvf ${PACKAGE}-${VERSION}.tar.gz -C ./debian_package; cd debian_package/${PACKAGE}-${VERSION}; dpkg-buildpackage -rfakeroot; # Test em update ( examples/em_test.pickle ) em_test: em_test.py @@ -39,18 +46,22 @@ dyncode: examples/em_test.pickle $(python) scripts/refreshdyn.py examples/em_test.pickle $(dyncode_filename) && echo -e "\n\nCode generated in $(dyncode_filename)" # run tests -check: +checks: ./runtest -v unittest: check #Cleaning documentation and dyncode clean-local: cleandoc - -rm -R doc/html doc/doxygen_sqlite3.db + -rm -vR doc/html doc/doxygen_sqlite3.db cleandoc: - -rm $(dyncode_filename) + -rm -v $(dyncode_filename) +#other cleans distclean-local: - -rm -R Makefile Makefile.in autom4te.cache/ aclocal.m4 install-sh missing py-compile configure + -rm -vR debian_package ${PACKAGE}-${VERSION}.tar.gz + +gitclean: distclean cleandoc + -rm -vR autom4te.cache/ aclocal.m4 install-sh missing py-compile configure; find ./ -name Makefile.in |xargs rm -v .PHONY: cleandoc tests doc diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..e618a4a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +lodel2 (0.1) UNRELEASED; urgency=medium + + * First debian package + + -- Yann Weber Fri, 23 Sep 2016 12:09:29 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..fd21c58 --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: lodel2 +Section: python +Priority: optional +Maintainer: lodel2 dev team +Build-Depends: automake, autotools-dev, make +Standards-Version: 0.1.1 + +Package: lodel2 +Section: python +Description: lodel2 debian package +Architecture: any +Depends: python3, python3-lxml, python3-jinja2, python3-werkzeug, python3-pymongo, uwsgi-plugin-python3 +Suggests: pwgen, wamerican, mongodb-server +Provides: lodel diff --git a/debian/debhelper.log b/debian/debhelper.log new file mode 100644 index 0000000..a7cd61e --- /dev/null +++ b/debian/debhelper.log @@ -0,0 +1,20 @@ +dh_auto_configure +dh_auto_build +dh_auto_test +dh_prep +dh_auto_install +dh_installdocs +dh_installchangelogs +dh_pysupport +dh_perl +dh_link +dh_compress +dh_fixperms +dh_strip +dh_makeshlibs +dh_shlibdeps +dh_installdeb +dh_gencontrol +dh_md5sums +dh_builddeb +dh_builddeb diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..509453b --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +lodel2_0.1_amd64.deb python optional diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..aee27db --- /dev/null +++ b/debian/rules @@ -0,0 +1,22 @@ +#!/usr/bin/make -f +# consulter debhelper(7) (décommenter lorsque nécessaire) +# afficher chaque commande modifiant un fichier dans le système construit +#DH_VERBOSE = 1 + +# consulter EXAMPLES dans dpkg-buildflags(1) et lire /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +# consulter FEATURE AREAS dans dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# consulter ENVIRONMENT dans dpkg-buildflags(1) +# mainteneurs de paquet à ajouter à CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# mainteneurs de paquet à ajouter à append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + +# principal script d’empaquetage basé sur la syntaxe de dh7 +%: + dh $@ --with python3 + diff --git a/debian/substvars b/debian/substvars new file mode 100644 index 0000000..abd3ebe --- /dev/null +++ b/debian/substvars @@ -0,0 +1 @@ +misc:Depends= diff --git a/debian/tmp/DEBIAN/control b/debian/tmp/DEBIAN/control new file mode 100644 index 0000000..1cee25b --- /dev/null +++ b/debian/tmp/DEBIAN/control @@ -0,0 +1,10 @@ +Package: lodel2 +Version: 0.1 +Architecture: amd64 +Maintainer: lodel2 dev team +Installed-Size: 25 +Depends: python3, python3-lxml, python3-jinja2, python3-werkzeug, python3-pymongo, uwsgi-plugin-python3 +Suggests: pwgen, wamerican, mongodb-server +Provides: lodel +Section: python +Priority: optional diff --git a/debian/tmp/DEBIAN/md5sums b/debian/tmp/DEBIAN/md5sums new file mode 100644 index 0000000..c2b7f45 --- /dev/null +++ b/debian/tmp/DEBIAN/md5sums @@ -0,0 +1 @@ +0377daa43e7232c06b702078dd86b850 usr/share/doc/lodel2/changelog.gz diff --git a/debian/tmp/usr/share/doc/lodel2/changelog.gz b/debian/tmp/usr/share/doc/lodel2/changelog.gz new file mode 100644 index 0000000..ae8d921 Binary files /dev/null and b/debian/tmp/usr/share/doc/lodel2/changelog.gz differ diff --git a/lodel/Makefile.am b/lodel/Makefile.am index 0401ae9..40db679 100644 --- a/lodel/Makefile.am +++ b/lodel/Makefile.am @@ -8,7 +8,7 @@ all-local: buildconf.py lodeldir=$(pkgpythondir)/ -distclean-local: +gitclean: -rm Makefile Makefile.in logdir = $(localstatedir)/log/lodel2/ @@ -18,10 +18,10 @@ do_subst = sed -e 's,\[@\]LODEL2_VARDIR\[@\],$(localstatedir)/lodel2/,g' \ install-data-hook: - -mkdir -p $(logdir) + -mkdir -p ${DESTDIR}$(logdir) uninstall-hook: - -rmdir $(logdir) + -rmdir ${DESTDIR}$(logdir) buildconf.py: buildconf.py.am $(do_subst) < $(srcdir)/buildconf.py.am > buildconf.py diff --git a/lodel/auth/Makefile.am b/lodel/auth/Makefile.am index 0928ba2..d9e746b 100644 --- a/lodel/auth/Makefile.am +++ b/lodel/auth/Makefile.am @@ -2,5 +2,3 @@ SUBDIRS= auth_PYTHON = *.py authdir=$(pkgpythondir)/auth -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/editorial_model/Makefile.am b/lodel/editorial_model/Makefile.am index d6978ce..6876ca2 100644 --- a/lodel/editorial_model/Makefile.am +++ b/lodel/editorial_model/Makefile.am @@ -2,6 +2,3 @@ SUBDIRS=translator em_PYTHON=*.py emdir=$(pkgpythondir)/editorial_model - -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/editorial_model/translator/Makefile.am b/lodel/editorial_model/translator/Makefile.am index ab8057e..3008f8c 100644 --- a/lodel/editorial_model/translator/Makefile.am +++ b/lodel/editorial_model/translator/Makefile.am @@ -1,5 +1,2 @@ translator_PYTHON=*.py translatordir=$(pkgpythondir)/editorial_model/translator - -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/leapi/Makefile.am b/lodel/leapi/Makefile.am index 25529d9..854a6c0 100644 --- a/lodel/leapi/Makefile.am +++ b/lodel/leapi/Makefile.am @@ -3,5 +3,3 @@ SUBDIRS=datahandlers leapi_PYTHON= *.py leapidir=$(pkgpythondir)/leapi -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/leapi/datahandlers/Makefile.am b/lodel/leapi/datahandlers/Makefile.am index 44386b4..f061454 100644 --- a/lodel/leapi/datahandlers/Makefile.am +++ b/lodel/leapi/datahandlers/Makefile.am @@ -1,5 +1,2 @@ dh_PYTHON=*.py dhdir=$(pkgpythondir)/leapi/datahandlers - -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/plugin/Makefile.am b/lodel/plugin/Makefile.am index 4235cdf..f816c33 100644 --- a/lodel/plugin/Makefile.am +++ b/lodel/plugin/Makefile.am @@ -1,6 +1,3 @@ plugin_PYTHON=*.py plugindir=$(pkgpythondir)/plugin - -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/settings/Makefile.am b/lodel/settings/Makefile.am index 2bde5f0..4cfe4b0 100644 --- a/lodel/settings/Makefile.am +++ b/lodel/settings/Makefile.am @@ -1,5 +1,2 @@ settings_PYTHON=*.py settingsdir=$(pkgpythondir)/settings - -distclean-local: - -rm Makefile Makefile.in diff --git a/lodel/utils/Makefile.am b/lodel/utils/Makefile.am index 9e5436d..3013d08 100644 --- a/lodel/utils/Makefile.am +++ b/lodel/utils/Makefile.am @@ -1,5 +1,2 @@ utils_PYTHON=*.py utilsdir=$(pkgpythondir)/utils - -distclean-local: - -rm Makefile Makefile.in diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 9bdf1c6..370cec8 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -3,7 +3,7 @@ plugins_PYTHON=__init__.py pluginsdir=$(pkgpythondir)/plugins install-data-local: - mkdir $(pluginsdir); cp -R * $(pluginsdir) && rm $(pluginsdir)/Makefile* + mkdir ${DESTDIR}$(pluginsdir); cp -R * ${DESTDIR}$(pluginsdir) && rm ${DESTDIR}$(pluginsdir)/Makefile* -distclean-local: - -rm -R Makefile Makefile.in $(pluginsdir) +uninstall-hook: + -rm -R ${DESTDIR}$(pluginsdir) diff --git a/progs/Makefile.am b/progs/Makefile.am index 565e3fb..14a4e29 100644 --- a/progs/Makefile.am +++ b/progs/Makefile.am @@ -26,4 +26,5 @@ create_instance: create_instance.sh chmod +x create_instance install-data-hook: - chmod +x $(datadir)/lodel2/scripts/* + chmod +x ${DESTDIR}$(datadir)/lodel2/scripts/* + diff --git a/progs/mass_deploy.sh b/progs/mass_deploy.sh index 8812efd..d2a89d2 100755 --- a/progs/mass_deploy.sh +++ b/progs/mass_deploy.sh @@ -26,6 +26,7 @@ slim_fails() { else echo "SLIM fails when $1. Abording...." >&2 fi + 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 ;)" exit 1 } diff --git a/progs/slim/Makefile.am b/progs/slim/Makefile.am index e97d323..3fcfe26 100644 --- a/progs/slim/Makefile.am +++ b/progs/slim/Makefile.am @@ -1,5 +1,5 @@ bin_SCRIPTS = slim -CLEANFILES = $(bin_SCRIPTS) +CLEANFILES = $(bin_SCRIPTS) slim_instances.json slim_instances_pid.json EXTRA_DIST = slim.py install_model emfile.pickle lodel2_scripts_dir = $(datadir)/lodel2/scripts @@ -36,5 +36,5 @@ slim: slim.py chmod +x slim install-data-hook: - chmod +x $(install_model_dir)/lodel_admin.py + chmod +x ${DESTDIR}$(install_model_dir)/lodel_admin.py