From: rohieb Date: Sun, 20 Jul 2008 01:12:04 +0000 (+0200) Subject: added comments, added DESTDIR variable for dh_* packaging scripts X-Git-Tag: REL_3.0-beta~14 X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/commitdiff_plain/4d5dcc113d39c479e71473937af94c6585c66349 added comments, added DESTDIR variable for dh_* packaging scripts --- diff --git a/Makefile b/Makefile index 9796850..bb76eae 100755 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ # THE SOFTWARE. # +DESTDIR?= SOURCEFILES=src/*.php includes/*.inc MODULE_DOC_FILES=doc/source/html/* doc/source/latex/* LN=ln -f @@ -33,37 +34,53 @@ MKDIR=mkdir -p # hardlink the files to their destinations # TODO move documentation where Jörg wants it ;) links: - $(MKDIR) /usr/share/doc/iserv/mod/room-reservation/source/ - $(LN) doc/{LICENSE*,TODO,changelog*} /usr/share/doc/iserv/mod/room-reservation/ - $(LN) doc/source/html/* /usr/share/doc/iserv/mod/room-reservation/source/ + # documentation + $(MKDIR) $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/source/ + $(LN) doc/{LICENSE*,TODO,changelog*} $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/ + $(LN) doc/source/html/* $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/source/ - $(LN) img/16/*.png /usr/share/iserv/www/img/default/16/ - $(LN) img/24/*.png /usr/share/iserv/www/img/default/24/ - $(LN) img/32/*.png /usr/share/iserv/www/img/default/32/ + # images + if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/16/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/16/; fi + $(LN) img/16/*.png $(DESTDIR)/usr/share/iserv/www/img/default/16/ + if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/24/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/24/; fi + $(LN) img/24/*.png $(DESTDIR)/usr/share/iserv/www/img/default/24/ + if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/32/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/32/; fi + $(LN) img/32/*.png $(DESTDIR)/usr/share/iserv/www/img/default/32/ - $(MKDIR) /usr/share/iserv/www/inc/mod_room-reservation - $(LN) includes/*.inc /usr/share/iserv/www/inc/mod_room-reservation/ - touch /usr/share/iserv/www/inc/mod_room-reservation/config.inc - chmod 664 /usr/share/iserv/www/inc/mod_room-reservation/config.inc - chown www-data /usr/share/iserv/www/inc/mod_room-reservation/config.inc + # includes + $(MKDIR) $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation + $(LN) includes/*.inc $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/ + touch $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc + chmod 664 $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc + chown www-data $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc - $(LN) lang/*.po /usr/share/iserv/locale/de/ + # i18n + if [ ! -d $(DESTDIR)/usr/share/iserv/locale/de/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/locale/de/; fi + $(LN) lang/*.po $(DESTDIR)/usr/share/iserv/locale/de/ - $(LN) nav/*.mod /usr/share/iserv/www/nav/ - $(LN) nav/admin/*.mod /usr/share/iserv/www/nav/admin - - $(LN) priv/* /usr/share/iserv/priv/ + # navigation + if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/; fi + $(LN) nav/*.mod $(DESTDIR)/usr/share/iserv/www/nav/ + $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin - $(LN) sql/*.sql /usr/share/iserv/db/ - $(LN) sql/log_module/* /usr/share/iserv/db/log_module + # privileges + if [ ! -d $(DESTDIR)/usr/share/iserv/priv/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/priv/; fi + $(LN) priv/* $(DESTDIR)/usr/share/iserv/priv/ - $(MKDIR) /usr/share/iserv/www/mod_room-reservation/admin - $(LN) src/index.php /usr/share/iserv/www/mod_room-reservation/ - $(LN) src/admin/config.php /usr/share/iserv/www/mod_room-reservation/admin/ - - $(MKDIR) /usr/share/iserv/modules/room-reservation - $(LN) update-iserv1-iserv2.pl /usr/share/iserv/modules/room-reservation - chmod 755 /usr/share/iserv/modules/room-reservation/update-iserv1-iserv2.pl + # SQL tables + if [ ! -d $(DESTDIR)/usr/share/iserv/db/log_module ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/db/log_module; fi + $(LN) sql/*.sql $(DESTDIR)/usr/share/iserv/db/ + $(LN) sql/log_module/* $(DESTDIR)/usr/share/iserv/db/log_module + + # web pages + $(MKDIR) $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/admin + $(LN) src/index.php $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/ + $(LN) src/admin/config.php $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/admin/ + + # additional files + $(MKDIR) $(DESTDIR)/usr/share/iserv/modules/room-reservation + $(LN) update-iserv1-iserv2.pl $(DESTDIR)/usr/share/iserv/modules/room-reservation + chmod 755 $(DESTDIR)/usr/share/iserv/modules/room-reservation/update-iserv1-iserv2.pl # build doxygen documentation from source sourcedoc: @@ -77,17 +94,17 @@ install: sourcedoc links # uninstalling uninstall: - $(RM) /usr/share/doc/iserv/mod/mod_room-reservation - $(RM) /usr/share/iserv/locale/de/mod_room-reservation.po - $(RM) /usr/share/iserv/db/mod_room-reservation.sql - $(RM) /usr/share/iserv/db/log_module/mod_room-reservation - $(RM) /usr/share/iserv/www/nav/79mod_room-reservation.mod - $(RM) /usr/share/iserv/priv/mod_room-reservation - $(RM) /usr/share/iserv/www/nav/admin/99mod_room-reservation.mod - $(RM) /usr/share/iserv/www/img/default/{16,24,32}/mod_room-reservation_{timeslice,index,config}.png - $(RM) /usr/share/iserv/www/inc/mod_room-reservation - $(RM) /usr/share/iserv/www/mod_room-reservation - $(RM) /usr/share/iserv/modules/room-reservation + $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/mod_room-reservation + $(RM) $(DESTDIR)/usr/share/iserv/locale/de/mod_room-reservation.po + $(RM) $(DESTDIR)/usr/share/iserv/db/mod_room-reservation.sql + $(RM) $(DESTDIR)/usr/share/iserv/db/log_module/mod_room-reservation + $(RM) $(DESTDIR)/usr/share/iserv/www/nav/79mod_room-reservation.mod + $(RM) $(DESTDIR)/usr/share/iserv/priv/mod_room-reservation + $(RM) $(DESTDIR)/usr/share/iserv/www/nav/admin/99mod_room-reservation.mod + $(RM) $(DESTDIR)/usr/share/iserv/www/img/default/{16,24,32}/mod_room-reservation_{timeslice,index,config}.png + $(RM) $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation + $(RM) $(DESTDIR)/usr/share/iserv/www/mod_room-reservation + $(RM) $(DESTDIR)/usr/share/iserv/modules/room-reservation psql -c "DELETE FROM log_module WHERE module='Room Reservation Schedule';" chklocale