X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/blobdiff_plain/a9b75f96fd7597473097c8ed993612bc3dc35a73..062e33d96c5178956e9a07e1b58e2ea9a9898aa8:/Makefile diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 index c5744d5..b847b0d --- a/Makefile +++ b/Makefile @@ -25,19 +25,19 @@ # DESTDIR?= -SOURCEFILES=src/*.php includes/*.inc -MODULE_DOC_FILES=doc/source/html/* doc/source/latex/* LN=ln -f RM=rm -rf MKDIR=mkdir -p # hardlink the files to their destinations -# TODO move documentation where Jörg wants it ;) -links: +links: sourcedoc # 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/ + $(MKDIR) $(DESTDIR)/usr/share/doc/iserv-mod-room-reservation/source/ + if [ ! -d $(DESTDIR)/usr/share/doc/iserv/mod/ ]; then $(MKDIR) $(DESTDIR)/usr/share/doc/iserv/mod/; fi + $(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 ../../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 @@ -49,19 +49,21 @@ 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 + $(LN) inc/*.inc $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation/ + 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 ($(USER),root) + chmod u+rw $(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 @@ -73,28 +75,31 @@ links: $(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/ + $(MKDIR) $(DESTDIR)/usr/share/iserv/www/mod_room-reservation + $(LN) src/{config,index}.php $(DESTDIR)/usr/share/iserv/www/mod_room-reservation/ # 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 +install: links +ifeq ($(USER),root) chkdb -r chkpriv chklocale +endif # uninstalling uninstall: - $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/mod_room-reservation + $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/room-reservation + $(RM) $(DESTDIR)/usr/share/doc/iserv-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 @@ -114,3 +119,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 distclean install