Commit | Line | Data |
---|---|---|
48deaa73 RK |
1 | #! /usr/bin/make -f |
2 | # | |
8f9616f1 | 3 | # Copyright (C) 2004-2008 Richard Kettlewell |
48deaa73 RK |
4 | # |
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
18 | # USA | |
19 | # | |
20 | ||
21 | # Options to configure. This can be overridden by the caller if necessary. | |
e73dc0ae | 22 | CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=x-www-browser |
48deaa73 RK |
23 | |
24 | # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build. | |
25 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) | |
26 | CFLAGS=-O0 -g | |
27 | else | |
28 | CFLAGS=-O2 -g | |
29 | endif | |
30 | export CFLAGS | |
31 | ||
32 | # Install commands. You wouldn't normally override these. | |
33 | INSTALL=install | |
34 | INSTALL_DATA=$(INSTALL) -p -o root -g root -m 644 | |
35 | INSTALL_PROGRAM=$(INSTALL) -p -o root -g root -m 755 | |
36 | INSTALL_SCRIPT=$(INSTALL) -p -o root -g root -m 755 | |
37 | MKDIR=mkdir -p -m 755 | |
38 | ||
39 | # Set DEB_BUILD_OPTIONS=nostrip to install debuggable executables. | |
40 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) | |
41 | INSTALL_PROGRAM += -s | |
42 | endif | |
43 | ||
44 | export INSTALL_DATA | |
45 | export INSTALL_SCRIPT | |
46 | export INSTALL_PROGRAM | |
47 | ||
48 | LIBTOOL=./libtool | |
49 | FAKEROOT=fakeroot | |
50 | ||
48deaa73 RK |
51 | # ./prepare is the script that generates configure etc. It only needs to be |
52 | # run if building from a checkout rather than a tarball. | |
53 | build: | |
eb5f83f4 | 54 | @set -e;if test ! -f configure; then \ |
d558cce2 RK |
55 | echo ./prepare;\ |
56 | ./prepare;\ | |
57 | fi | |
eb5f83f4 | 58 | @set -e;if test ! -f config.status; then \ |
48deaa73 RK |
59 | echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\ |
60 | ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\ | |
61 | else\ | |
62 | echo ./config.status;\ | |
63 | ./config.status;\ | |
64 | fi | |
65 | $(MAKE) | |
66 | ||
48deaa73 RK |
67 | pkg-disorder: build |
68 | rm -rf debian/disorder | |
69 | $(MKDIR) debian/disorder | |
70 | $(MKDIR) debian/disorder/DEBIAN | |
71 | $(MKDIR) debian/disorder/usr/share/doc/disorder | |
1b23cbbe | 72 | $(MKDIR) debian/disorder/etc/bash_completion.d |
48deaa73 RK |
73 | $(INSTALL_DATA) debian/copyright \ |
74 | debian/disorder/usr/share/doc/disorder/copyright | |
75 | $(INSTALL_DATA) debian/changelog \ | |
76 | debian/disorder/usr/share/doc/disorder/changelog.Debian | |
77 | gzip -9 debian/disorder/usr/share/doc/disorder/changelog.Debian | |
78 | @for f in preinst postinst prerm postrm conffiles templates config; do\ | |
79 | if test -e debian/$$f.disorder; then\ | |
80 | echo $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \ | |
81 | $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \ | |
82 | fi;\ | |
83 | done | |
84 | $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C doc | |
85 | $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C clients | |
86 | $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C lib | |
1b23cbbe RK |
87 | $(INSTALL_DATA) scripts/completion.bash \ |
88 | debian/disorder/etc/bash_completion.d/disorder | |
48deaa73 RK |
89 | rm -rf debian/disorder/usr/share/man/man8 |
90 | rm -rf debian/disorder/usr/share/disorder/*.html | |
ae13d68e | 91 | rm -rf debian/disorder/usr/share/disorder/*.tmpl |
1b23cbbe | 92 | rmdir debian/disorder/usr/share/disorder |
48deaa73 RK |
93 | rm -f debian/disorder/usr/bin/disorder-playrtp |
94 | rm -f debian/disorder/usr/bin/disobedience | |
95 | rm -f debian/disorder/usr/share/man/man1/disorder-playrtp.1 | |
96 | rm -f debian/disorder/usr/share/man/man1/disobedience.1 | |
ae13d68e RK |
97 | rm -f debian/disorder/usr/share/man/man5/disorder_templates.5 |
98 | rm -f debian/disorder/usr/share/man/man5/disorder_actions.5 | |
99 | rm -f debian/disorder/usr/share/man/man5/disorder_options.5 | |
48deaa73 RK |
100 | $(MKDIR) debian/disorder/etc/disorder |
101 | dpkg-shlibdeps -Tdebian/substvars.disorder \ | |
102 | debian/disorder/usr/bin/* | |
b0a578cb | 103 | $(INSTALL_DATA) CHANGES.html README debian/README.Debian \ |
48deaa73 RK |
104 | BUGS README.* \ |
105 | debian/disorder/usr/share/doc/disorder/. | |
b0a578cb | 106 | gzip -9f debian/disorder/usr/share/doc/disorder/README \ |
48deaa73 RK |
107 | debian/disorder/usr/share/doc/disorder/README.* \ |
108 | debian/disorder/usr/share/doc/disorder/BUGS \ | |
109 | debian/disorder/usr/share/man/man*/* | |
110 | dpkg-gencontrol -isp -pdisorder -Pdebian/disorder -Tdebian/substvars.disorder | |
111 | chown -R root:root debian/disorder | |
112 | chmod -R g-ws debian/disorder | |
113 | dpkg --build debian/disorder .. | |
114 | ||
48deaa73 RK |
115 | pkg-disorder-server: build |
116 | rm -rf debian/disorder-server | |
117 | $(MKDIR) debian/disorder-server | |
118 | $(MKDIR) debian/disorder-server/DEBIAN | |
119 | $(MKDIR) debian/disorder-server/usr/share/doc/disorder-server | |
120 | $(INSTALL_DATA) debian/copyright \ | |
121 | debian/disorder-server/usr/share/doc/disorder-server/copyright | |
122 | $(INSTALL_DATA) debian/changelog \ | |
123 | debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian | |
124 | gzip -9 debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian | |
125 | @for f in preinst postinst prerm postrm conffiles templates config; do\ | |
126 | if test -e debian/$$f.disorder-server; then\ | |
127 | echo $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \ | |
128 | $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \ | |
129 | fi;\ | |
130 | done | |
131 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C images | |
132 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C server | |
133 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C templates | |
134 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C driver | |
135 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C plugins | |
136 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C sounds | |
137 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C doc | |
138 | rm -rf debian/disorder-server/usr/share/man/man1 | |
139 | rm -rf debian/disorder-server/usr/share/man/man3 | |
ae13d68e RK |
140 | rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5 |
141 | rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5 | |
48deaa73 RK |
142 | $(MKDIR) debian/disorder-server/etc/disorder |
143 | $(MKDIR) debian/disorder-server/etc/init.d | |
f2c185d6 | 144 | $(MKDIR) debian/disorder-server/usr/lib/cgi-bin |
48deaa73 RK |
145 | $(MKDIR) debian/disorder-server/var/lib/disorder |
146 | $(INSTALL_SCRIPT) examples/disorder.init \ | |
147 | debian/disorder-server/etc/init.d/disorder | |
148 | $(INSTALL_DATA) debian/etc.disorder.config \ | |
149 | debian/disorder-server/etc/disorder/config | |
8f9616f1 | 150 | $(INSTALL_DATA) templates/options \ |
48deaa73 | 151 | debian/disorder-server/etc/disorder/options |
8f9616f1 RK |
152 | $(INSTALL_DATA) debian/etc.disorder.options.user \ |
153 | debian/disorder-server/etc/disorder/options.user | |
3c03f557 | 154 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder.cgi \ |
f2c185d6 | 155 | $(shell pwd)/debian/disorder-server/usr/lib/cgi-bin/disorder |
48deaa73 | 156 | dpkg-shlibdeps -Tdebian/substvars.disorder-server \ |
f2c185d6 | 157 | debian/disorder-server/usr/lib/cgi-bin/disorder \ |
48deaa73 RK |
158 | debian/disorder-server/usr/sbin/* \ |
159 | debian/disorder-server/usr/lib/disorder/*.so* | |
48deaa73 RK |
160 | rm -rf debian/disorder-server/usr/share/doc/disorder-server |
161 | ln -s disorder debian/disorder-server/usr/share/doc/disorder-server | |
162 | dpkg-gencontrol -isp -pdisorder-server -Pdebian/disorder-server -Tdebian/substvars.disorder-server | |
163 | chown -R root:root debian/disorder-server | |
164 | chmod -R g-ws debian/disorder-server | |
165 | dpkg --build debian/disorder-server .. | |
166 | ||
48deaa73 RK |
167 | pkg-disorder-playrtp: build |
168 | rm -rf debian/disorder-playrtp | |
169 | $(MKDIR) debian/disorder-playrtp | |
170 | $(MKDIR) debian/disorder-playrtp/DEBIAN | |
171 | $(MKDIR) debian/disorder-playrtp/usr/share/doc/disorder-playrtp | |
172 | $(INSTALL_DATA) debian/copyright \ | |
173 | debian/disorder-playrtp/usr/share/doc/disorder-playrtp/copyright | |
174 | $(INSTALL_DATA) debian/changelog \ | |
175 | debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog.Debian | |
176 | gzip -9 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog.Debian | |
177 | @for f in preinst postinst prerm postrm conffiles templates config; do\ | |
178 | if test -e debian/$$f.disorder-playrtp; then\ | |
179 | echo $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \ | |
180 | $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \ | |
181 | fi;\ | |
182 | done | |
183 | $(MKDIR) debian/disorder-playrtp/usr/bin | |
184 | $(MKDIR) debian/disorder-playrtp/usr/share/man/man1 | |
185 | $(INSTALL_PROGRAM) clients/disorder-playrtp \ | |
186 | debian/disorder-playrtp/usr/bin/disorder-playrtp | |
187 | $(INSTALL_DATA) doc/disorder-playrtp.1 \ | |
188 | debian/disorder-playrtp/usr/share/man/man1/disorder-playrtp.1 | |
189 | dpkg-shlibdeps -Tdebian/substvars.disorder-playrtp \ | |
190 | debian/disorder-playrtp/usr/bin/* | |
191 | $(INSTALL_DATA) debian/README.RTP \ | |
192 | debian/disorder-playrtp/usr/share/doc/disorder-playrtp/README | |
193 | $(INSTALL_DATA) CHANGES debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES | |
194 | gzip -9f debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES \ | |
195 | debian/disorder-playrtp/usr/share/man/man*/* | |
196 | dpkg-gencontrol -isp -pdisorder-playrtp -Pdebian/disorder-playrtp -Tdebian/substvars.disorder-playrtp | |
197 | chown -R root:root debian/disorder-playrtp | |
198 | chmod -R g-ws debian/disorder-playrtp | |
199 | dpkg --build debian/disorder-playrtp .. | |
200 | ||
48deaa73 RK |
201 | pkg-disobedience: build |
202 | rm -rf debian/disobedience | |
203 | $(MKDIR) debian/disobedience | |
204 | $(MKDIR) debian/disobedience/DEBIAN | |
205 | $(MKDIR) debian/disobedience/usr/share/doc/disobedience | |
206 | $(INSTALL_DATA) debian/copyright \ | |
207 | debian/disobedience/usr/share/doc/disobedience/copyright | |
208 | $(INSTALL_DATA) debian/changelog \ | |
209 | debian/disobedience/usr/share/doc/disobedience/changelog.Debian | |
210 | gzip -9 debian/disobedience/usr/share/doc/disobedience/changelog.Debian | |
211 | @for f in preinst postinst prerm postrm conffiles templates config; do\ | |
212 | if test -e debian/$$f.disobedience; then\ | |
213 | echo $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \ | |
214 | $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \ | |
215 | fi;\ | |
216 | done | |
217 | $(MKDIR) debian/disobedience/usr/bin | |
218 | $(MKDIR) debian/disobedience/usr/share/man/man1 | |
219 | $(MKDIR) debian/disobedience/usr/share/pixmaps | |
220 | $(MKDIR) debian/disobedience/usr/share/menu | |
221 | $(MAKE) -C disobedience install DESTDIR=`pwd`/debian/disobedience | |
222 | $(INSTALL_DATA) doc/disobedience.1 \ | |
223 | debian/disobedience/usr/share/man/man1/disobedience.1 | |
224 | $(INSTALL_DATA) images/disobedience16x16.xpm \ | |
225 | images/disobedience32x32.xpm \ | |
226 | debian/disobedience/usr/share/pixmaps | |
227 | $(INSTALL_DATA) debian/usr.share.menu.disobedience \ | |
228 | debian/disobedience/usr/share/menu/disobedience | |
229 | dpkg-shlibdeps -Tdebian/substvars.disobedience \ | |
230 | debian/disobedience/usr/bin/* | |
231 | rm -rf debian/disobedience/usr/share/doc/disobedience | |
232 | ln -s disorder debian/disobedience/usr/share/doc/disobedience | |
233 | dpkg-gencontrol -isp -pdisobedience -Pdebian/disobedience -Tdebian/substvars.disobedience | |
234 | chown -R root:root debian/disobedience | |
235 | chmod -R g-ws debian/disobedience | |
236 | dpkg --build debian/disobedience .. | |
237 | ||
48deaa73 RK |
238 | DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}') |
239 | DSC=disorder_$(DEBVERSION).dsc | |
240 | DEBSRC=disorder_$(DEBVERSION).tar.gz | |
241 | VERSION=$(shell $(MAKE) echo-version) | |
242 | ||
243 | source: | |
244 | $(MAKE) dist | |
245 | rm -rf disorder-$(VERSION) | |
246 | tar xfz disorder-$(VERSION).tar.gz | |
247 | dpkg-source -b disorder-$(VERSION) | |
248 | rm -rf disorder-$(VERSION) disorder-$(VERSION).tar.gz | |
249 | ||
250 | source-check: source | |
251 | rm -rf disorder-$(DEBVERSION) | |
252 | dpkg-source -x $(DSC) | |
253 | cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT) | |
254 | ||
48deaa73 | 255 | binary: binary-arch binary-indep |
eb5f83f4 RK |
256 | binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \ |
257 | pkg-disobedience | |
48deaa73 RK |
258 | binary-indep: |
259 | ||
eb5f83f4 | 260 | clean: |
48deaa73 RK |
261 | -$(MAKE) distclean |
262 | rm -f config.cache | |
263 | rm -f debian/files | |
264 | rm -f debian/substvars.* | |
eb5f83f4 RK |
265 | rm -rf debian/disorder |
266 | rm -rf debian/disorder-server | |
267 | rm -rf debian/disorder-playrtp | |
268 | rm -rf debian/disobedience | |
269 | ||
270 | .PHONY: clean build pkg-disorder pkg-disorder-server pkg-disorder-playrtp \ | |
271 | pkg-disobedience source source-check binary binary-arch binary-indep |