added comments, added DESTDIR variable for dh_* packaging scripts
authorrohieb <devnull@localhost>
Sun, 20 Jul 2008 01:12:04 +0000 (03:12 +0200)
committerrohieb <devnull@localhost>
Sun, 20 Jul 2008 01:12:04 +0000 (03:12 +0200)
Makefile

index 9796850..bb76eae 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@
 # THE SOFTWARE.\r
 #\r
 \r
+DESTDIR?=\r
 SOURCEFILES=src/*.php includes/*.inc\r
 MODULE_DOC_FILES=doc/source/html/* doc/source/latex/*\r
 LN=ln -f\r
@@ -33,37 +34,53 @@ MKDIR=mkdir -p
 # hardlink the files to their destinations\r
 # TODO move documentation where Jörg wants it ;)\r
 links:\r
-       $(MKDIR) /usr/share/doc/iserv/mod/room-reservation/source/\r
-       $(LN) doc/{LICENSE*,TODO,changelog*} /usr/share/doc/iserv/mod/room-reservation/\r
-       $(LN) doc/source/html/* /usr/share/doc/iserv/mod/room-reservation/source/\r
+       # documentation\r
+       $(MKDIR) $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/source/\r
+       $(LN) doc/{LICENSE*,TODO,changelog*} $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/\r
+       $(LN) doc/source/html/* $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/source/\r
        \r
-       $(LN) img/16/*.png /usr/share/iserv/www/img/default/16/\r
-       $(LN) img/24/*.png /usr/share/iserv/www/img/default/24/\r
-       $(LN) img/32/*.png /usr/share/iserv/www/img/default/32/\r
+       # images\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/16/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/16/; fi\r
+       $(LN) img/16/*.png $(DESTDIR)/usr/share/iserv/www/img/default/16/\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/24/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/24/; fi\r
+       $(LN) img/24/*.png $(DESTDIR)/usr/share/iserv/www/img/default/24/\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/32/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/32/; fi\r
+       $(LN) img/32/*.png $(DESTDIR)/usr/share/iserv/www/img/default/32/\r
        \r
-       $(MKDIR) /usr/share/iserv/www/inc/mod_room-reservation\r
-       $(LN) includes/*.inc /usr/share/iserv/www/inc/mod_room-reservation/\r
-       touch /usr/share/iserv/www/inc/mod_room-reservation/config.inc\r
-       chmod 664 /usr/share/iserv/www/inc/mod_room-reservation/config.inc\r
-       chown www-data /usr/share/iserv/www/inc/mod_room-reservation/config.inc\r
+       # includes\r
+       $(MKDIR) $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation\r
+       $(LN) includes/*.inc $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/\r
+       touch $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc\r
+       chmod 664 $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc\r
+       chown www-data $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc\r
        \r
-       $(LN) lang/*.po /usr/share/iserv/locale/de/\r
+       # i18n\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/locale/de/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/locale/de/; fi\r
+       $(LN) lang/*.po $(DESTDIR)/usr/share/iserv/locale/de/\r
        \r
-       $(LN) nav/*.mod /usr/share/iserv/www/nav/\r
-       $(LN) nav/admin/*.mod /usr/share/iserv/www/nav/admin\r
-\r
-       $(LN) priv/* /usr/share/iserv/priv/\r
+       # navigation\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/; fi\r
+       $(LN) nav/*.mod $(DESTDIR)/usr/share/iserv/www/nav/\r
+       $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin\r
        \r
-       $(LN) sql/*.sql /usr/share/iserv/db/\r
-       $(LN) sql/log_module/* /usr/share/iserv/db/log_module\r
+       # privileges\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/priv/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/priv/; fi\r
+       $(LN) priv/* $(DESTDIR)/usr/share/iserv/priv/\r
        \r
-       $(MKDIR) /usr/share/iserv/www/mod_room-reservation/admin\r
-       $(LN) src/index.php /usr/share/iserv/www/mod_room-reservation/\r
-       $(LN) src/admin/config.php /usr/share/iserv/www/mod_room-reservation/admin/\r
-\r
-       $(MKDIR) /usr/share/iserv/modules/room-reservation\r
-       $(LN) update-iserv1-iserv2.pl /usr/share/iserv/modules/room-reservation\r
-       chmod 755 /usr/share/iserv/modules/room-reservation/update-iserv1-iserv2.pl\r
+       # SQL tables\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/db/log_module ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/db/log_module; fi\r
+       $(LN) sql/*.sql $(DESTDIR)/usr/share/iserv/db/\r
+       $(LN) sql/log_module/* $(DESTDIR)/usr/share/iserv/db/log_module\r
+       \r
+       # web pages\r
+       $(MKDIR) $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/admin\r
+       $(LN) src/index.php $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/\r
+       $(LN) src/admin/config.php $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/admin/\r
+       \r
+       # additional files\r
+       $(MKDIR) $(DESTDIR)/usr/share/iserv/modules/room-reservation\r
+       $(LN) update-iserv1-iserv2.pl $(DESTDIR)/usr/share/iserv/modules/room-reservation\r
+       chmod 755 $(DESTDIR)/usr/share/iserv/modules/room-reservation/update-iserv1-iserv2.pl\r
 \r
 # build doxygen documentation from source\r
 sourcedoc:\r
@@ -77,17 +94,17 @@ install: sourcedoc links
 \r
 # uninstalling\r
 uninstall:\r
-       $(RM) /usr/share/doc/iserv/mod/mod_room-reservation\r
-       $(RM) /usr/share/iserv/locale/de/mod_room-reservation.po\r
-       $(RM) /usr/share/iserv/db/mod_room-reservation.sql\r
-       $(RM) /usr/share/iserv/db/log_module/mod_room-reservation\r
-       $(RM) /usr/share/iserv/www/nav/79mod_room-reservation.mod\r
-       $(RM) /usr/share/iserv/priv/mod_room-reservation\r
-       $(RM) /usr/share/iserv/www/nav/admin/99mod_room-reservation.mod\r
-       $(RM) /usr/share/iserv/www/img/default/{16,24,32}/mod_room-reservation_{timeslice,index,config}.png\r
-       $(RM) /usr/share/iserv/www/inc/mod_room-reservation\r
-       $(RM) /usr/share/iserv/www/mod_room-reservation\r
-       $(RM) /usr/share/iserv/modules/room-reservation\r
+       $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/mod_room-reservation\r
+       $(RM) $(DESTDIR)/usr/share/iserv/locale/de/mod_room-reservation.po\r
+       $(RM) $(DESTDIR)/usr/share/iserv/db/mod_room-reservation.sql\r
+       $(RM) $(DESTDIR)/usr/share/iserv/db/log_module/mod_room-reservation\r
+       $(RM) $(DESTDIR)/usr/share/iserv/www/nav/79mod_room-reservation.mod\r
+       $(RM) $(DESTDIR)/usr/share/iserv/priv/mod_room-reservation\r
+       $(RM) $(DESTDIR)/usr/share/iserv/www/nav/admin/99mod_room-reservation.mod\r
+       $(RM) $(DESTDIR)/usr/share/iserv/www/img/default/{16,24,32}/mod_room-reservation_{timeslice,index,config}.png\r
+       $(RM) $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation\r
+       $(RM) $(DESTDIR)/usr/share/iserv/www/mod_room-reservation\r
+       $(RM) $(DESTDIR)/usr/share/iserv/modules/room-reservation\r
        \r
        psql -c "DELETE FROM log_module WHERE module='Room Reservation Schedule';"\r
        chklocale\r
This page took 0.032484 seconds and 4 git commands to generate.