Makefile: forgot maint/update-config.sh, maint/* will do it
[iserv-mod-error-reporter.git] / Makefile
1 #
2 # @file Makefile
3 # Makefile for installing, creating documentation etc.
4 # @author Roland Hieber (roland.hieber@wilhelm-gym.net)
5 # @date 06.10.2007
6 # @package iserv_errorreporter
7 #
8 # Copyright © 2007 Roland Hieber
9 #
10 # Permission is hereby granted, free of charge, to any person obtaining
11 # copy of this software and associated documentation files (the "Software"),
12 # to deal in the Software without restriction, including without limitation
13 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 # and/or sell copies of the Software, and to permit persons to whom the
15 # Software is furnished to do so, subject to the following conditions:
16 #
17 # The above copyright notice and this permission notice shall be included in
18 # all copies or substantial portions of the Software.
19 #
20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 # THE SOFTWARE.
27 #
28
29 INSTALLDIR=/opt/iserv
30 LN=ln -f
31 RM=rm -rf
32 CHOWN=chown -f
33 MKDIR=mkdir -p
34
35 # hardlink the files to their destinations
36 links: sourcedoc
37 # documentation
38 $(MKDIR) $(DESTDIR)/usr/share/doc/iserv-mod-error-reporter/source/
39 if [ ! -d $(DESTDIR)/usr/share/doc/iserv/mod/ ]; then $(MKDIR) $(DESTDIR)/usr/share/doc/iserv/mod/; fi
40 $(LN) doc/{TODO,changelog.old.html} debian/copyright $(DESTDIR)/usr/share/doc/iserv-mod-error-reporter
41 $(LN) doc/source/* $(DESTDIR)/usr/share/doc/iserv-mod-error-reporter/source/
42 $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/error-reporter # remove old link
43 $(LN) -s ../../iserv-mod-error-reporter $(DESTDIR)/usr/share/doc/iserv/mod/error-reporter
44
45 # images
46 if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/16 ] ; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/16; fi
47 if [ ! -d $(DESTDIR)/usr/share/iserv/www/img/default/32 ] ; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/img/default/32; fi
48 $(LN) img/16/*.png $(DESTDIR)/usr/share/iserv/www/img/default/16
49 $(LN) img/32/*.png $(DESTDIR)/usr/share/iserv/www/img/default/32
50
51 # localization
52 if [ ! -d $(DESTDIR)/usr/share/iserv/locale/de ] ; then $(MKDIR) $(DESTDIR)/usr/share/iserv/locale/de; fi
53 $(LN) lang/mod_error-reporter.po $(DESTDIR)/usr/share/iserv/locale/de
54
55 # SQL data
56 if [ ! -d $(DESTDIR)/usr/share/iserv/db/log_module ] ; then $(MKDIR) $(DESTDIR)/usr/share/iserv/db/log_module; fi
57 $(LN) sql/mod_error-reporter.sql $(DESTDIR)/usr/share/iserv/db/
58 $(LN) sql/log_module/mod_error-reporter $(DESTDIR)/usr/share/iserv/db/log_module
59
60 # privileges
61 if [ ! -d $(DESTDIR)/usr/share/iserv/priv ] ; then $(MKDIR) $(DESTDIR)/usr/share/iserv/priv; fi
62 $(LN) priv/mod_error-reporter $(DESTDIR)/usr/share/iserv/priv
63
64 # includes
65 $(MKDIR) $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter
66 $(LN) inc/{class*,init,functions}.inc $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter
67 if [ ! -e $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter/config.inc ] ; then touch $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter/config.inc; fi
68 ifeq ($(USER),root)
69 chmod u+rw $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter/config.inc
70 chown www-data $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter/config.inc
71 endif
72
73 # navigation
74 if [ ! -d $(DESTDIR)/usr/share/iserv/www/nav/admin ] ; then $(MKDIR) $(DESTDIR)/usr/share/iserv/www/nav/admin; fi
75 $(LN) nav/*.mod $(DESTDIR)/usr/share/iserv/www/nav
76 $(LN) nav/admin/*.mod $(DESTDIR)/usr/share/iserv/www/nav/admin
77
78 # web pages
79 $(MKDIR) $(DESTDIR)/usr/share/iserv/www/mod_error-reporter
80 $(LN) src/{config,detail,index}.php $(DESTDIR)/usr/share/iserv/www/mod_error-reporter
81
82 # maintenance files
83 $(MKDIR) $(DESTDIR)/usr/share/iserv/modules/error-reporter
84 $(LN) maint/* $(DESTDIR)/usr/share/iserv/modules/error-reporter
85
86 # build doxygen documentation from source
87 sourcedoc:
88 doxygen
89 mv doc/source/html/* doc/source/ && rm -rf doc/source/html
90
91 install: links
92 ifeq ($(USER),root)
93 chklocale
94 chkpriv
95 chkdb -r
96 endif
97
98 # uninstalling
99 uninstall:
100 $(RM) $(DESTDIR)/usr/share/doc/iserv/mod/error-reporter
101 $(RM) $(DESTDIR)/usr/share/doc/iserv-mod-error-reporter
102 $(RM) $(DESTDIR)/usr/share/iserv/www/img/{16,32}/mod_error-reporter.png
103 $(RM) $(DESTDIR)/usr/share/iserv/sql/mod_error-reporter.sql
104 $(RM) $(DESTDIR)/usr/share/iserv/sql/log_module/mod_error-reporter
105 $(RM) $(DESTDIR)/usr/share/iserv/priv/mod_error-reporter
106 $(RM) $(DESTDIR)/usr/share/iserv/www/inc/mod_error-reporter
107 $(RM) $(DESTDIR)/usr/share/iserv/www/nav/79mod_error-reporter.mod
108 $(RM) $(DESTDIR)/usr/share/iserv/www/nav/admin/99mod_error-reporter.mod
109 $(RM) $(DESTDIR)/usr/share/iserv/www/mod_error-reporter
110
111 ifeq ($(USER),root)
112 chklocale
113 chkpriv
114 psql -c "DELETE FROM log_module WHERE module='Error Report Wizard';"
115 endif
116
117 @echo
118 @echo If you do not need the SQL tables anymore, remove them by running
119 @echo ' psql -c "DROP TABLE mod_errorreports;"'
120 @echo After that, all reported errors are unrecoverably deleted!
121 @echo
122
123 # clean up
124 clean: distclean
125
126 distclean:
127 $(RM) doc/source
128
129 .PHONY: clean distclean install
This page took 0.055197 seconds and 5 git commands to generate.