X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/blobdiff_plain/a9b75f96fd7597473097c8ed993612bc3dc35a73..d7f6a32bdc1360e056c06eb5149ef3dfc5e114a1:/Makefile diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 index c5744d5..310b57d --- a/Makefile +++ b/Makefile @@ -36,9 +36,11 @@ MKDIR=mkdir -p links: # 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) doc/{TODO,changelog.old.html} $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/ + $(LN) doc/source/* $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation/source/ + $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation + $(LN) -s $(DESTDIR)/usr/share/doc/iserv-mod-room-reservation $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation + # 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/ @@ -50,18 +52,20 @@ links: # 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 + 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 +ifeq ($(shell id -u),0) + chmod g+w $(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 +endif # 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/ # navigation - if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/; fi + if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/admin ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/admin; fi $(LN) nav/*.mod $(DESTDIR)/usr/share/iserv/www/nav/ - $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin + $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin/ # privileges if [ ! -d $(DESTDIR)/usr/share/iserv/priv/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/priv/; fi @@ -75,22 +79,25 @@ links: # 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/ + $(LN) src/admin/*.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 + $(LN) maint/update-iserv1-iserv2.pl $(DESTDIR)/usr/share/iserv/modules/room-reservation + chmod +x $(DESTDIR)/usr/share/iserv/modules/room-reservation/update-iserv1-iserv2.pl # build doxygen documentation from source sourcedoc: doxygen + mv doc/source/html/* doc/source/ && rm -rf doc/source/html # install everything install: sourcedoc links +ifeq ($(shell echo $USER),root) chkdb -r chkpriv chklocale +endif # uninstalling uninstall: @@ -114,3 +121,11 @@ uninstall: @echo ' psql -c "DROP TABLE mod_roomreservation_bookings;"' @echo After that, all bookings are unrecoverably deleted! @echo + +# clean up +clean: distclean + +distclean: + $(RM) doc/source + +.PHONY: clean