db_user migration
[iserv-mod-room-reservation.git] / Makefile
old mode 100755 (executable)
new mode 100644 (file)
index bb76eae..41d1775
--- a/Makefile
+++ b/Makefile
-# @file Makefile\r
-# Makefile for installing, creating documentation etc.\r
-# @author: Roland Hieber (roland.hieber@wilhelm-gym.net)\r
-# @date: 12.11.2007\r
-# \r
-# Copyright © 2007 Roland Hieber\r
-# \r
-# Permission is hereby granted, free of charge, to any person obtaining\r
-# copy of this software and associated documentation files (the "Software"),\r
-# to deal in the Software without restriction, including without limitation\r
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
-# and/or sell copies of the Software, and to permit persons to whom the\r
-# Software is furnished to do so, subject to the following conditions:\r
-# \r
-# The above copyright notice and this permission notice shall be included in\r
-# all copies or substantial portions of the Software.\r
-#  \r
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-# 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
-RM=rm -rf\r
-MKDIR=mkdir -p\r
-\r
-# hardlink the files to their destinations\r
-# TODO move documentation where Jörg wants it ;)\r
-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
-       # 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
-       # 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
-       # 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
-       $(LN) nav/*.mod $(DESTDIR)/usr/share/iserv/www/nav/\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
-       $(LN) priv/* $(DESTDIR)/usr/share/iserv/priv/\r
-       \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
-       doxygen\r
-\r
-# install everything\r
-install: sourcedoc links\r
-       chkdb -r\r
-       chkpriv\r
-       chklocale\r
-\r
-# uninstalling\r
-uninstall:\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
-       \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
+# @file Makefile
+# Makefile for installing, creating documentation etc.
+# @author: Roland Hieber (roland.hieber@wilhelm-gym.net)
+# @date: 12.11.2007
+# 
+# Copyright © 2007 Roland Hieber
+# 
+# Permission is hereby granted, free of charge, to any person obtaining
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#  
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+PACKAGENAME:=iserv-mod-room-reservation
+VERSION:=$(shell grep "^$(PACKAGENAME)" debian/changelog | head -1 | sed -e "s/$(PACKAGENAME) (\([0-9.]\+\).*).*/\1/ ")
+
+SHELL=/bin/bash
+DESTDIR?=
+LN=ln -f
+RM=rm -rf
+MKDIR=mkdir -p
+
+# hardlink the files to their destinations
+links: sourcedoc
+       # documentation
+       $(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
+       $(LN) img/16/*.png $(DESTDIR)/usr/share/iserv/www/img/default/16/
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/24/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/24/; fi
+       $(LN) img/24/*.png $(DESTDIR)/usr/share/iserv/www/img/default/24/
+       if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/32/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/32/; fi
+       $(LN) img/32/*.png $(DESTDIR)/usr/share/iserv/www/img/default/32/
+       
+       # includes
+       $(MKDIR) $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation
+       $(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/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/
+       
+       # privileges
+       if [ ! -d $(DESTDIR)/usr/share/iserv/priv/ ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/priv/; fi
+       $(LN) priv/* $(DESTDIR)/usr/share/iserv/priv/
+       
+       # SQL tables
+       if [ ! -d $(DESTDIR)/usr/share/iserv/db/log_module ]; then $(MKDIR) $(DESTDIR)/usr/share/iserv/db/log_module; fi
+       $(LN) sql/*.sql $(DESTDIR)/usr/share/iserv/db/
+       $(LN) sql/log_module/* $(DESTDIR)/usr/share/iserv/db/log_module
+       
+       # web pages
+       $(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) 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:
+       cat Doxyfile.in | sed -e "s/{{{VERSION}}}/$(VERSION)/" \
+               -e "s/{{{PACKAGENAME}}}/$(PACKAGENAME)/" > Doxyfile
+       doxygen
+       mv doc/source/html/* doc/source/ && rm -rf doc/source/html
+
+# install everything
+install: links
+ifeq ($(USER),root)
+       chkdb -r
+       chkpriv
+       chklocale
+endif
+
+# uninstalling
+uninstall:
+       $(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
+       $(RM) $(DESTDIR)/usr/share/iserv/www/nav/79mod_room-reservation.mod
+       $(RM) $(DESTDIR)/usr/share/iserv/priv/mod_room-reservation
+       $(RM) $(DESTDIR)/usr/share/iserv/www/nav/admin/99mod_room-reservation.mod
+       $(RM) $(DESTDIR)/usr/share/iserv/www/img/default/{16,24,32}/mod_room-reservation_{timeslice,index,config}.png
+       $(RM) $(DESTDIR)/usr/share/iserv/www/inc/mod_room-reservation
+       $(RM) $(DESTDIR)/usr/share/iserv/www/mod_room-reservation
+       $(RM) $(DESTDIR)/usr/share/iserv/modules/room-reservation
+       
+       psql -c "DELETE FROM log_module WHERE module='Room Reservation Schedule';"
+       chklocale
+       
+       @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
+
+# clean up
+clean: distclean
+       if [ -e Doxyfile ]; then rm Doxyfile; fi
+
+distclean:
+       $(RM) doc/source
+
+.PHONY: clean distclean install
+
This page took 0.030129 seconds and 4 git commands to generate.