Commit | Line | Data |
---|---|---|
48deaa73 RK |
1 | #! /usr/bin/make -f |
2 | # | |
8f9616f1 | 3 | # Copyright (C) 2004-2008 Richard Kettlewell |
48deaa73 | 4 | # |
e7eb3a27 | 5 | # This program is free software: you can redistribute it and/or modify |
48deaa73 | 6 | # it under the terms of the GNU General Public License as published by |
e7eb3a27 | 7 | # the Free Software Foundation, either version 3 of the License, or |
48deaa73 RK |
8 | # (at your option) any later version. |
9 | # | |
e7eb3a27 RK |
10 | # This program is distributed in the hope that it will be useful, |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
48deaa73 | 15 | # You should have received a copy of the GNU General Public License |
e7eb3a27 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
48deaa73 RK |
17 | # |
18 | ||
f03d4184 | 19 | cgiexecdir=/usr/lib/cgi-bin |
64ac73bb RK |
20 | httpdir=/var/www |
21 | browser=x-www-browser | |
22 | ||
dabc426a RK |
23 | CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) |
24 | CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) | |
25 | CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) | |
26 | LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) | |
27 | export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | |
28 | ||
48deaa73 | 29 | # Options to configure. This can be overridden by the caller if necessary. |
32918782 | 30 | CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}" |
48deaa73 | 31 | |
48deaa73 RK |
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 | ||
7323d699 RK |
44 | # Set DEB_BUILD_OPTIONS=parallel=N to do make -jN |
45 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
46 | NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
47 | PARALLEL = -j$(NUMJOBS) | |
48 | endif | |
49 | ||
48deaa73 RK |
50 | export INSTALL_DATA |
51 | export INSTALL_SCRIPT | |
52 | export INSTALL_PROGRAM | |
53 | ||
410801ac RK |
54 | # We override sendmail to the value defined in policy, in case configure picks |
55 | # up some other sendmail. | |
56 | SENDMAIL=/usr/sbin/sendmail | |
57 | ||
48deaa73 RK |
58 | LIBTOOL=./libtool |
59 | FAKEROOT=fakeroot | |
60 | ||
e2daf70b RK |
61 | SHELL=bash |
62 | ||
af5de747 | 63 | # ./autogen.sh is the script that generates configure etc. It only needs to be |
48deaa73 RK |
64 | # run if building from a checkout rather than a tarball. |
65 | build: | |
eb5f83f4 | 66 | @set -e;if test ! -f configure; then \ |
af5de747 RK |
67 | echo ./autogen.sh;\ |
68 | ./autogen.sh;\ | |
d558cce2 | 69 | fi |
f0533943 | 70 | ./configure ${CONFIGURE} ${CONFIGURE_EXTRA} |
7323d699 | 71 | $(MAKE) SENDMAIL=${SENDMAIL} ${PARALLEL} |
48deaa73 | 72 | |
48deaa73 RK |
73 | pkg-disorder: build |
74 | rm -rf debian/disorder | |
75 | $(MKDIR) debian/disorder | |
76 | $(MKDIR) debian/disorder/DEBIAN | |
77 | $(MKDIR) debian/disorder/usr/share/doc/disorder | |
1b23cbbe | 78 | $(MKDIR) debian/disorder/etc/bash_completion.d |
48deaa73 RK |
79 | $(INSTALL_DATA) debian/copyright \ |
80 | debian/disorder/usr/share/doc/disorder/copyright | |
81 | $(INSTALL_DATA) debian/changelog \ | |
c94f44c1 RK |
82 | debian/disorder/usr/share/doc/disorder/changelog |
83 | gzip -9 debian/disorder/usr/share/doc/disorder/changelog* | |
a987f4a7 RK |
84 | @for f in conffiles templates; do\ |
85 | if test -e debian/$$f.disorder; then\ | |
86 | echo $(INSTALL_DATA) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \ | |
87 | $(INSTALL_DATA) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \ | |
88 | fi;\ | |
89 | done | |
90 | @for f in preinst postinst prerm postrm config; do\ | |
48deaa73 RK |
91 | if test -e debian/$$f.disorder; then\ |
92 | echo $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \ | |
93 | $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \ | |
94 | fi;\ | |
95 | done | |
96 | $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C doc | |
97 | $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C clients | |
0a3004d0 RK |
98 | strip --remove-section=.comment debian/disorder/usr/bin/disorder |
99 | strip --remove-section=.comment debian/disorder/usr/bin/disorderfm | |
48deaa73 | 100 | $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C lib |
1b23cbbe RK |
101 | $(INSTALL_DATA) scripts/completion.bash \ |
102 | debian/disorder/etc/bash_completion.d/disorder | |
48deaa73 RK |
103 | rm -rf debian/disorder/usr/share/man/man8 |
104 | rm -rf debian/disorder/usr/share/disorder/*.html | |
ae13d68e | 105 | rm -rf debian/disorder/usr/share/disorder/*.tmpl |
1b23cbbe | 106 | rmdir debian/disorder/usr/share/disorder |
48deaa73 RK |
107 | rm -f debian/disorder/usr/bin/disorder-playrtp |
108 | rm -f debian/disorder/usr/bin/disobedience | |
109 | rm -f debian/disorder/usr/share/man/man1/disorder-playrtp.1 | |
110 | rm -f debian/disorder/usr/share/man/man1/disobedience.1 | |
ae13d68e RK |
111 | rm -f debian/disorder/usr/share/man/man5/disorder_templates.5 |
112 | rm -f debian/disorder/usr/share/man/man5/disorder_actions.5 | |
113 | rm -f debian/disorder/usr/share/man/man5/disorder_options.5 | |
48deaa73 RK |
114 | $(MKDIR) debian/disorder/etc/disorder |
115 | dpkg-shlibdeps -Tdebian/substvars.disorder \ | |
116 | debian/disorder/usr/bin/* | |
b0a578cb | 117 | $(INSTALL_DATA) CHANGES.html README debian/README.Debian \ |
2ea2b361 | 118 | BUGS README.* docs.css \ |
48deaa73 | 119 | debian/disorder/usr/share/doc/disorder/. |
b0a578cb | 120 | gzip -9f debian/disorder/usr/share/doc/disorder/README \ |
48deaa73 RK |
121 | debian/disorder/usr/share/doc/disorder/README.* \ |
122 | debian/disorder/usr/share/doc/disorder/BUGS \ | |
123 | debian/disorder/usr/share/man/man*/* | |
d9690752 RK |
124 | cd debian/disorder && \ |
125 | find -name DEBIAN -prune -o -type f -print \ | |
126 | | sed 's/^\.\///' \ | |
127 | | xargs md5sum > DEBIAN/md5sums | |
48deaa73 RK |
128 | dpkg-gencontrol -isp -pdisorder -Pdebian/disorder -Tdebian/substvars.disorder |
129 | chown -R root:root debian/disorder | |
130 | chmod -R g-ws debian/disorder | |
131 | dpkg --build debian/disorder .. | |
132 | ||
48deaa73 RK |
133 | pkg-disorder-server: build |
134 | rm -rf debian/disorder-server | |
135 | $(MKDIR) debian/disorder-server | |
136 | $(MKDIR) debian/disorder-server/DEBIAN | |
137 | $(MKDIR) debian/disorder-server/usr/share/doc/disorder-server | |
cf0c0430 RK |
138 | $(MKDIR) debian/disorder-server/usr/share/lintian/overrides |
139 | $(INSTALL_DATA) debian/overrides.disorder-server \ | |
140 | debian/disorder-server/usr/share/lintian/overrides/disorder-server | |
48deaa73 RK |
141 | $(INSTALL_DATA) debian/copyright \ |
142 | debian/disorder-server/usr/share/doc/disorder-server/copyright | |
143 | $(INSTALL_DATA) debian/changelog \ | |
c94f44c1 RK |
144 | debian/disorder-server/usr/share/doc/disorder-server/changelog |
145 | gzip -9 debian/disorder-server/usr/share/doc/disorder-server/changelog* | |
a349d8f9 | 146 | @for f in preinst postinst prerm postrm config; do\ |
48deaa73 RK |
147 | if test -e debian/$$f.disorder-server; then\ |
148 | echo $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \ | |
149 | $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \ | |
150 | fi;\ | |
151 | done | |
a349d8f9 RK |
152 | @for f in conffiles templates; do\ |
153 | if test -e debian/$$f.disorder-server; then\ | |
154 | echo $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \ | |
155 | $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \ | |
156 | fi;\ | |
157 | done | |
64ac73bb RK |
158 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images |
159 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server | |
160 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates | |
64ac73bb RK |
161 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins |
162 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds | |
163 | $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc | |
48deaa73 RK |
164 | rm -rf debian/disorder-server/usr/share/man/man1 |
165 | rm -rf debian/disorder-server/usr/share/man/man3 | |
ae13d68e | 166 | rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5 |
e600bdf3 | 167 | rm -f debian/disorder-server/usr/share/man/man5/disorder_preferences.5 |
ae13d68e | 168 | rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5 |
a349d8f9 RK |
169 | find debian/disorder-server -name '*.la' -print0 | xargs -r0 rm -f |
170 | find debian/disorder-server -name '*.so.0' -print0 | xargs -r0 rm -f | |
171 | @for f in debian/disorder-server/usr/lib/disorder/*.so.0.0.0; do \ | |
172 | echo mv $$f $${f/.0.0.0};\ | |
173 | mv $$f $${f/.0.0.0};\ | |
174 | done | |
a349d8f9 RK |
175 | find debian/disorder-server -name '*.so' -print0 | xargs -r0 strip --strip-unneeded |
176 | find debian/disorder-server -name '*.so' -print0 | xargs -r0 chmod -x | |
48deaa73 RK |
177 | $(MKDIR) debian/disorder-server/etc/disorder |
178 | $(MKDIR) debian/disorder-server/etc/init.d | |
f03d4184 | 179 | $(MKDIR) debian/disorder-server${cgiexecdir} |
48deaa73 | 180 | $(MKDIR) debian/disorder-server/var/lib/disorder |
2ea2b361 | 181 | $(MKDIR) debian/disorder-server/etc/cron.daily |
48deaa73 RK |
182 | $(INSTALL_SCRIPT) examples/disorder.init \ |
183 | debian/disorder-server/etc/init.d/disorder | |
184 | $(INSTALL_DATA) debian/etc.disorder.config \ | |
185 | debian/disorder-server/etc/disorder/config | |
8f9616f1 | 186 | $(INSTALL_DATA) templates/options \ |
48deaa73 | 187 | debian/disorder-server/etc/disorder/options |
8f9616f1 RK |
188 | $(INSTALL_DATA) debian/etc.disorder.options.user \ |
189 | debian/disorder-server/etc/disorder/options.user | |
2ea2b361 | 190 | $(INSTALL_SCRIPT) debian/disorder.daily debian/disorder-server/etc/cron.daily/disorder |
4cbafe13 | 191 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \ |
f03d4184 | 192 | $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder |
a987f4a7 | 193 | gzip -9f debian/disorder-server/usr/share/man/man*/* |
48deaa73 | 194 | dpkg-shlibdeps -Tdebian/substvars.disorder-server \ |
f03d4184 | 195 | debian/disorder-server${cgiexecdir}/disorder \ |
48deaa73 | 196 | debian/disorder-server/usr/sbin/* \ |
a349d8f9 | 197 | debian/disorder-server/usr/lib/disorder/*.so |
48deaa73 RK |
198 | rm -rf debian/disorder-server/usr/share/doc/disorder-server |
199 | ln -s disorder debian/disorder-server/usr/share/doc/disorder-server | |
0a3004d0 RK |
200 | strip --remove-section=.comment \ |
201 | debian/disorder-server/usr/sbin/* \ | |
202 | debian/disorder-server${cgiexecdir}/* \ | |
0a3004d0 | 203 | debian/disorder-server/usr/lib/disorder/*.so |
d9690752 RK |
204 | cd debian/disorder-server && \ |
205 | find -name DEBIAN -prune -o -type f -print \ | |
206 | | sed 's/^\.\///' \ | |
207 | | xargs md5sum > DEBIAN/md5sums | |
48deaa73 RK |
208 | dpkg-gencontrol -isp -pdisorder-server -Pdebian/disorder-server -Tdebian/substvars.disorder-server |
209 | chown -R root:root debian/disorder-server | |
210 | chmod -R g-ws debian/disorder-server | |
211 | dpkg --build debian/disorder-server .. | |
212 | ||
48deaa73 RK |
213 | pkg-disorder-playrtp: build |
214 | rm -rf debian/disorder-playrtp | |
215 | $(MKDIR) debian/disorder-playrtp | |
216 | $(MKDIR) debian/disorder-playrtp/DEBIAN | |
217 | $(MKDIR) debian/disorder-playrtp/usr/share/doc/disorder-playrtp | |
218 | $(INSTALL_DATA) debian/copyright \ | |
219 | debian/disorder-playrtp/usr/share/doc/disorder-playrtp/copyright | |
220 | $(INSTALL_DATA) debian/changelog \ | |
c94f44c1 RK |
221 | debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog |
222 | gzip -9 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog* | |
48deaa73 RK |
223 | @for f in preinst postinst prerm postrm conffiles templates config; do\ |
224 | if test -e debian/$$f.disorder-playrtp; then\ | |
225 | echo $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \ | |
226 | $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \ | |
227 | fi;\ | |
228 | done | |
229 | $(MKDIR) debian/disorder-playrtp/usr/bin | |
230 | $(MKDIR) debian/disorder-playrtp/usr/share/man/man1 | |
231 | $(INSTALL_PROGRAM) clients/disorder-playrtp \ | |
232 | debian/disorder-playrtp/usr/bin/disorder-playrtp | |
0a3004d0 | 233 | strip --remove-section=.comment debian/disorder-playrtp/usr/bin/disorder-playrtp |
48deaa73 RK |
234 | $(INSTALL_DATA) doc/disorder-playrtp.1 \ |
235 | debian/disorder-playrtp/usr/share/man/man1/disorder-playrtp.1 | |
236 | dpkg-shlibdeps -Tdebian/substvars.disorder-playrtp \ | |
237 | debian/disorder-playrtp/usr/bin/* | |
238 | $(INSTALL_DATA) debian/README.RTP \ | |
239 | debian/disorder-playrtp/usr/share/doc/disorder-playrtp/README | |
bfa2f233 RK |
240 | $(INSTALL_DATA) CHANGES.html debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES.html |
241 | gzip -9f debian/disorder-playrtp/usr/share/man/man*/* | |
d9690752 RK |
242 | cd debian/disorder-playrtp && \ |
243 | find -name DEBIAN -prune -o -type f -print \ | |
244 | | sed 's/^\.\///' \ | |
245 | | xargs md5sum > DEBIAN/md5sums | |
48deaa73 RK |
246 | dpkg-gencontrol -isp -pdisorder-playrtp -Pdebian/disorder-playrtp -Tdebian/substvars.disorder-playrtp |
247 | chown -R root:root debian/disorder-playrtp | |
248 | chmod -R g-ws debian/disorder-playrtp | |
249 | dpkg --build debian/disorder-playrtp .. | |
250 | ||
48deaa73 RK |
251 | pkg-disobedience: build |
252 | rm -rf debian/disobedience | |
253 | $(MKDIR) debian/disobedience | |
254 | $(MKDIR) debian/disobedience/DEBIAN | |
255 | $(MKDIR) debian/disobedience/usr/share/doc/disobedience | |
256 | $(INSTALL_DATA) debian/copyright \ | |
257 | debian/disobedience/usr/share/doc/disobedience/copyright | |
258 | $(INSTALL_DATA) debian/changelog \ | |
c94f44c1 RK |
259 | debian/disobedience/usr/share/doc/disobedience/changelog |
260 | gzip -9 debian/disobedience/usr/share/doc/disobedience/changelog* | |
48deaa73 RK |
261 | @for f in preinst postinst prerm postrm conffiles templates config; do\ |
262 | if test -e debian/$$f.disobedience; then\ | |
263 | echo $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \ | |
264 | $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \ | |
265 | fi;\ | |
266 | done | |
267 | $(MKDIR) debian/disobedience/usr/bin | |
268 | $(MKDIR) debian/disobedience/usr/share/man/man1 | |
269 | $(MKDIR) debian/disobedience/usr/share/pixmaps | |
270 | $(MKDIR) debian/disobedience/usr/share/menu | |
868adf23 | 271 | $(MKDIR) debian/disobedience/usr/share/doc-base |
48deaa73 | 272 | $(MAKE) -C disobedience install DESTDIR=`pwd`/debian/disobedience |
0a3004d0 | 273 | strip --remove-section=.comment debian/disobedience/usr/bin/disobedience |
48deaa73 RK |
274 | $(INSTALL_DATA) doc/disobedience.1 \ |
275 | debian/disobedience/usr/share/man/man1/disobedience.1 | |
276 | $(INSTALL_DATA) images/disobedience16x16.xpm \ | |
277 | images/disobedience32x32.xpm \ | |
278 | debian/disobedience/usr/share/pixmaps | |
279 | $(INSTALL_DATA) debian/usr.share.menu.disobedience \ | |
280 | debian/disobedience/usr/share/menu/disobedience | |
868adf23 RK |
281 | $(INSTALL_DATA) debian/disobedience-manual \ |
282 | debian/disobedience/usr/share/doc-base/disobedience-manual | |
a987f4a7 | 283 | gzip -9f debian/disobedience/usr/share/man/man*/* |
48deaa73 RK |
284 | dpkg-shlibdeps -Tdebian/substvars.disobedience \ |
285 | debian/disobedience/usr/bin/* | |
286 | rm -rf debian/disobedience/usr/share/doc/disobedience | |
287 | ln -s disorder debian/disobedience/usr/share/doc/disobedience | |
d9690752 RK |
288 | cd debian/disobedience && \ |
289 | find -name DEBIAN -prune -o -type f -print \ | |
290 | | sed 's/^\.\///' \ | |
291 | | xargs md5sum > DEBIAN/md5sums | |
48deaa73 RK |
292 | dpkg-gencontrol -isp -pdisobedience -Pdebian/disobedience -Tdebian/substvars.disobedience |
293 | chown -R root:root debian/disobedience | |
294 | chmod -R g-ws debian/disobedience | |
295 | dpkg --build debian/disobedience .. | |
296 | ||
48deaa73 RK |
297 | DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}') |
298 | DSC=disorder_$(DEBVERSION).dsc | |
299 | DEBSRC=disorder_$(DEBVERSION).tar.gz | |
300 | VERSION=$(shell $(MAKE) echo-version) | |
301 | ||
302 | source: | |
303 | $(MAKE) dist | |
304 | rm -rf disorder-$(VERSION) | |
305 | tar xfz disorder-$(VERSION).tar.gz | |
306 | dpkg-source -b disorder-$(VERSION) | |
307 | rm -rf disorder-$(VERSION) disorder-$(VERSION).tar.gz | |
308 | ||
309 | source-check: source | |
310 | rm -rf disorder-$(DEBVERSION) | |
311 | dpkg-source -x $(DSC) | |
312 | cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT) | |
313 | ||
48deaa73 | 314 | binary: binary-arch binary-indep |
eb5f83f4 RK |
315 | binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \ |
316 | pkg-disobedience | |
48deaa73 RK |
317 | binary-indep: |
318 | ||
eb5f83f4 | 319 | clean: |
e4821ef7 | 320 | if test -f Makefile; then $(MAKE) distclean; fi |
48deaa73 RK |
321 | rm -f config.cache |
322 | rm -f debian/files | |
323 | rm -f debian/substvars.* | |
eb5f83f4 RK |
324 | rm -rf debian/disorder |
325 | rm -rf debian/disorder-server | |
326 | rm -rf debian/disorder-playrtp | |
327 | rm -rf debian/disobedience | |
328 | ||
329 | .PHONY: clean build pkg-disorder pkg-disorder-server pkg-disorder-playrtp \ | |
330 | pkg-disobedience source source-check binary binary-arch binary-indep |