X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/blobdiff_plain/4d5dcc113d39c479e71473937af94c6585c66349..e001039de1df26ee538b9b357aa8647cbce5e325:/Makefile diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 index bb76eae..a004aff --- a/Makefile +++ b/Makefile @@ -33,12 +33,14 @@ 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/ - + $(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 @@ -73,24 +77,26 @@ 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 ($(shell echo $USER),root) chkdb -r chkpriv chklocale +endif # uninstalling uninstall: @@ -109,8 +115,16 @@ uninstall: psql -c "DELETE FROM log_module WHERE module='Room Reservation Schedule';" chklocale - @echo ---------------------------------------------------------------------- + @echo @echo If you do not need the SQL tables anymore, remove them by running @echo ' psql -c "DROP TABLE mod_roomreservation_bookings;"' @echo After that, all bookings are unrecoverably deleted! - @echo ---------------------------------------------------------------------- + @echo + +# clean up +clean: distclean + +distclean: + $(RM) doc/source + +.PHONY: clean