database conversion, removed needless comments and code
[iserv-mod-room-reservation.git] / Makefile
1 #
2 # @file Makefile
3 # Makefile for installing, creating documentation etc
4 # @author: Roland Hieber (roland.hieber@wilhelm-gym.net)
5 # @date: 12.11.2007
6 #
7 # Copyright © 2007 Roland Hieber
8 #
9 # Permission is hereby granted, free of charge, to any person obtaining
10 # copy of this software and associated documentation files (the "Software"),
11 # to deal in the Software without restriction, including without limitation
12 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 # and/or sell copies of the Software, and to permit persons to whom the
14 # Software is furnished to do so, subject to the following conditions:
15 #
16 # The above copyright notice and this permission notice shall be included in
17 # all copies or substantial portions of the Software.
18 #
19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 # THE SOFTWARE.
26 #
27
28 SOURCEFILES=src/*.php includes/*.inc
29 MODULE_DOC_FILES=doc/source/html/* doc/source/latex/*
30 LN=ln -f
31 RM=rm -rf
32 MKDIR=mkdir -p
33
34 # hardlink the files to their destinations
35 # TODO move documentation where Jörg wants it ;)
36 links:
37 $(MKDIR) /usr/share/doc/iserv/mod/room-reservation/source/
38 $(LN) doc/{LICENSE*,TODO,changelog*} /usr/share/doc/iserv/mod/room-reservation/
39 $(LN) doc/source/html/* /usr/share/doc/iserv/mod/room-reservation/source/
40
41 $(LN) img/16/*.png /usr/share/iserv/www/img/default/16/
42 $(LN) img/24/*.png /usr/share/iserv/www/img/default/24/
43 $(LN) img/32/*.png /usr/share/iserv/www/img/default/32/
44
45 $(MKDIR) /usr/share/iserv/www/inc/mod_room-reservation
46 $(LN) includes/*.inc /usr/share/iserv/www/inc/mod_room-reservation/
47 chmod 664 /usr/share/iserv/www/inc/mod_room-reservation/config.inc
48 chown www-data /usr/share/iserv/www/inc/mod_room-reservation/config.inc
49
50 $(LN) lang/*.po /usr/share/iserv/locale/de/
51
52 $(LN) nav/*.mod /usr/share/iserv/www/nav/
53 $(LN) nav/admin/*.mod /usr/share/iserv/www/nav/admin
54
55 $(LN) priv/* /usr/share/iserv/priv/
56
57 $(LN) sql/*.sql /usr/share/iserv/db/
58
59 $(MKDIR) /usr/share/iserv/www/mod_room-reservation/admin
60 $(LN) src/index.php /usr/share/iserv/www/mod_room-reservation/
61 $(LN) src/admin/config.php /usr/share/iserv/www/mod_room-reservation/admin/
62
63 # build doxygen documentation from source
64 sourcedoc:
65 doxygen
66
67 # install everything
68 install: sourcedoc links
69 chkdb -r
70 chkpriv
71
72 @if [ -z "`psql -qc "SELECT * FROM log_module;" 2>&1 |grep ERROR`" -a -z \
73 "`psql -qc \"SELECT COUNT(*) FROM log_module WHERE module = 'Room Reservation Schedule';\" 2>&1 |grep ' 1'`" ]; then \
74 echo psql -c "INSERT INTO log_module VALUES('Room Reservation Schedule');"; \
75 psql -c "INSERT INTO log_module VALUES('Room Reservation Schedule');"; \
76 fi;
77 chklocale
78
79 # uninstalling
80 uninstall:
81 $(RM) /usr/share/doc/iserv/mod/mod_room-reservation
82 $(RM) /usr/share/iserv/locale/de/mod_room-reservation.po
83 $(RM) /usr/share/iserv/db/mod_room-reservation.sql
84 $(RM) /usr/share/iserv/www/nav/79mod_room-reservation.mod
85 $(RM) /usr/share/iserv/priv/mod_room-reservation
86 $(RM) /usr/share/iserv/www/nav/admin/99mod_room-reservation.mod
87 $(RM) /usr/share/iserv/www/img/default/{16,24,32}/mod_room-reservation_{timeslice,index,config}.png
88 $(RM) /usr/share/iserv/www/inc/mod_room-reservation
89 $(RM) /usr/share/iserv/www/mod_room-reservation
90
91 chklocale
92
93 @echo ----------------------------------------------------------------------
94 @echo If you do not need the SQL tables anymore, remove them by running
95 @echo ' psql -c "DROP TABLE mod_roomreservation_bookings;"'
96 @echo After that, all bookings are unrecoverably deleted!
97 @echo ----------------------------------------------------------------------
This page took 0.048296 seconds and 5 git commands to generate.