documentation was symlinked wrong
[iserv-mod-room-reservation.git] / Makefile
old mode 100755 (executable)
new mode 100644 (file)
index bb76eae..310b57d
--- a/Makefile
+++ b/Makefile
@@ -36,9 +36,11 @@ MKDIR=mkdir -p
 links:\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) doc/{TODO,changelog.old.html} $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/\r
+       $(LN) doc/source/* $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/source/\r
+       $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation\r
+       $(LN) -s $(DESTDIR)/usr/share/doc/iserv-mod-room-reservation $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation\r
+\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
@@ -50,18 +52,20 @@ links:
        # 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
+       if [ ! -e $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc ] ; then touch $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/config.inc; fi\r
+ifeq ($(shell id -u),0)\r
+       chmod g+w $(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
+endif\r
        \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
        # navigation\r
-       if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/; fi\r
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/admin ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/admin; fi\r
        $(LN) nav/*.mod $(DESTDIR)/usr/share/iserv/www/nav/\r
-       $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin\r
+       $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin/\r
        \r
        # privileges\r
        if [ ! -d $(DESTDIR)/usr/share/iserv/priv/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/priv/; fi\r
@@ -75,22 +79,25 @@ links:
        # 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
+       $(LN) src/admin/*.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
+       $(LN) maint/update-iserv1-iserv2.pl $(DESTDIR)/usr/share/iserv/modules/room-reservation\r
+       chmod +x $(DESTDIR)/usr/share/iserv/modules/room-reservation/update-iserv1-iserv2.pl\r
 \r
 # build doxygen documentation from source\r
 sourcedoc:\r
        doxygen\r
+       mv doc/source/html/* doc/source/ && rm -rf doc/source/html\r
 \r
 # install everything\r
 install: sourcedoc links\r
+ifeq ($(shell echo $USER),root)\r
        chkdb -r\r
        chkpriv\r
        chklocale\r
+endif\r
 \r
 # uninstalling\r
 uninstall:\r
@@ -109,8 +116,16 @@ uninstall:
        psql -c "DELETE FROM log_module WHERE module='Room Reservation Schedule';"\r
        chklocale\r
        \r
-       @echo ----------------------------------------------------------------------\r
+       @echo\r
        @echo If you do not need the SQL tables anymore, remove them by running\r
        @echo '  psql -c "DROP TABLE mod_roomreservation_bookings;"'\r
        @echo After that, all bookings are unrecoverably deleted!\r
-       @echo ----------------------------------------------------------------------\r
+       @echo\r
+\r
+# clean up\r
+clean: distclean\r
+\r
+distclean:\r
+       $(RM) doc/source\r
+\r
+.PHONY: clean\r
This page took 0.032608 seconds and 4 git commands to generate.