chiark / gitweb /
Add documentation and administrivia about `disorder-gstdecode'.
[disorder] / debian / rules
CommitLineData
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 19cgiexecdir=/usr/lib/cgi-bin
64ac73bb
RK
20httpdir=/var/www
21browser=x-www-browser
22
48deaa73 23# Options to configure. This can be overridden by the caller if necessary.
32918782 24CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}"
48deaa73
RK
25
26# Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
27ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
28CFLAGS=-O0 -g
29else
30CFLAGS=-O2 -g
31endif
32export CFLAGS
33
34# Install commands. You wouldn't normally override these.
35INSTALL=install
36INSTALL_DATA=$(INSTALL) -p -o root -g root -m 644
37INSTALL_PROGRAM=$(INSTALL) -p -o root -g root -m 755
38INSTALL_SCRIPT=$(INSTALL) -p -o root -g root -m 755
39MKDIR=mkdir -p -m 755
40
41# Set DEB_BUILD_OPTIONS=nostrip to install debuggable executables.
42ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
43INSTALL_PROGRAM += -s
44endif
45
7323d699
RK
46# Set DEB_BUILD_OPTIONS=parallel=N to do make -jN
47ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
48NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
49PARALLEL = -j$(NUMJOBS)
50endif
51
48deaa73
RK
52export INSTALL_DATA
53export INSTALL_SCRIPT
54export INSTALL_PROGRAM
55
410801ac
RK
56# We override sendmail to the value defined in policy, in case configure picks
57# up some other sendmail.
58SENDMAIL=/usr/sbin/sendmail
59
48deaa73
RK
60LIBTOOL=./libtool
61FAKEROOT=fakeroot
62
e2daf70b
RK
63SHELL=bash
64
af5de747 65# ./autogen.sh is the script that generates configure etc. It only needs to be
48deaa73
RK
66# run if building from a checkout rather than a tarball.
67build:
eb5f83f4 68 @set -e;if test ! -f configure; then \
af5de747
RK
69 echo ./autogen.sh;\
70 ./autogen.sh;\
d558cce2 71 fi
eb5f83f4 72 @set -e;if test ! -f config.status; then \
48deaa73
RK
73 echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
74 ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
75 else\
76 echo ./config.status;\
77 ./config.status;\
78 fi
7323d699 79 $(MAKE) SENDMAIL=${SENDMAIL} ${PARALLEL}
48deaa73 80
48deaa73
RK
81pkg-disorder: build
82 rm -rf debian/disorder
83 $(MKDIR) debian/disorder
84 $(MKDIR) debian/disorder/DEBIAN
85 $(MKDIR) debian/disorder/usr/share/doc/disorder
1b23cbbe 86 $(MKDIR) debian/disorder/etc/bash_completion.d
48deaa73
RK
87 $(INSTALL_DATA) debian/copyright \
88 debian/disorder/usr/share/doc/disorder/copyright
89 $(INSTALL_DATA) debian/changelog \
c94f44c1
RK
90 debian/disorder/usr/share/doc/disorder/changelog
91 gzip -9 debian/disorder/usr/share/doc/disorder/changelog*
a987f4a7
RK
92 @for f in conffiles templates; do\
93 if test -e debian/$$f.disorder; then\
94 echo $(INSTALL_DATA) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
95 $(INSTALL_DATA) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
96 fi;\
97 done
98 @for f in preinst postinst prerm postrm config; do\
48deaa73
RK
99 if test -e debian/$$f.disorder; then\
100 echo $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
101 $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
102 fi;\
103 done
104 $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C doc
105 $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C clients
0a3004d0
RK
106 strip --remove-section=.comment debian/disorder/usr/bin/disorder
107 strip --remove-section=.comment debian/disorder/usr/bin/disorderfm
48deaa73 108 $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C lib
1b23cbbe
RK
109 $(INSTALL_DATA) scripts/completion.bash \
110 debian/disorder/etc/bash_completion.d/disorder
48deaa73
RK
111 rm -rf debian/disorder/usr/share/man/man8
112 rm -rf debian/disorder/usr/share/disorder/*.html
ae13d68e 113 rm -rf debian/disorder/usr/share/disorder/*.tmpl
1b23cbbe 114 rmdir debian/disorder/usr/share/disorder
48deaa73
RK
115 rm -f debian/disorder/usr/bin/disorder-playrtp
116 rm -f debian/disorder/usr/bin/disobedience
117 rm -f debian/disorder/usr/share/man/man1/disorder-playrtp.1
118 rm -f debian/disorder/usr/share/man/man1/disobedience.1
ae13d68e
RK
119 rm -f debian/disorder/usr/share/man/man5/disorder_templates.5
120 rm -f debian/disorder/usr/share/man/man5/disorder_actions.5
121 rm -f debian/disorder/usr/share/man/man5/disorder_options.5
48deaa73
RK
122 $(MKDIR) debian/disorder/etc/disorder
123 dpkg-shlibdeps -Tdebian/substvars.disorder \
124 debian/disorder/usr/bin/*
b0a578cb 125 $(INSTALL_DATA) CHANGES.html README debian/README.Debian \
2ea2b361 126 BUGS README.* docs.css \
48deaa73 127 debian/disorder/usr/share/doc/disorder/.
b0a578cb 128 gzip -9f debian/disorder/usr/share/doc/disorder/README \
48deaa73
RK
129 debian/disorder/usr/share/doc/disorder/README.* \
130 debian/disorder/usr/share/doc/disorder/BUGS \
131 debian/disorder/usr/share/man/man*/*
d9690752
RK
132 cd debian/disorder && \
133 find -name DEBIAN -prune -o -type f -print \
134 | sed 's/^\.\///' \
135 | xargs md5sum > DEBIAN/md5sums
48deaa73
RK
136 dpkg-gencontrol -isp -pdisorder -Pdebian/disorder -Tdebian/substvars.disorder
137 chown -R root:root debian/disorder
138 chmod -R g-ws debian/disorder
139 dpkg --build debian/disorder ..
140
48deaa73
RK
141pkg-disorder-server: build
142 rm -rf debian/disorder-server
143 $(MKDIR) debian/disorder-server
144 $(MKDIR) debian/disorder-server/DEBIAN
145 $(MKDIR) debian/disorder-server/usr/share/doc/disorder-server
cf0c0430
RK
146 $(MKDIR) debian/disorder-server/usr/share/lintian/overrides
147 $(INSTALL_DATA) debian/overrides.disorder-server \
148 debian/disorder-server/usr/share/lintian/overrides/disorder-server
48deaa73
RK
149 $(INSTALL_DATA) debian/copyright \
150 debian/disorder-server/usr/share/doc/disorder-server/copyright
151 $(INSTALL_DATA) debian/changelog \
c94f44c1
RK
152 debian/disorder-server/usr/share/doc/disorder-server/changelog
153 gzip -9 debian/disorder-server/usr/share/doc/disorder-server/changelog*
a349d8f9 154 @for f in preinst postinst prerm postrm config; do\
48deaa73
RK
155 if test -e debian/$$f.disorder-server; then\
156 echo $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
157 $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
158 fi;\
159 done
a349d8f9
RK
160 @for f in conffiles templates; do\
161 if test -e debian/$$f.disorder-server; then\
162 echo $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
163 $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
164 fi;\
165 done
64ac73bb
RK
166 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
167 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
168 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
64ac73bb
RK
169 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins
170 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds
171 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc
48deaa73
RK
172 rm -rf debian/disorder-server/usr/share/man/man1
173 rm -rf debian/disorder-server/usr/share/man/man3
ae13d68e 174 rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
e600bdf3 175 rm -f debian/disorder-server/usr/share/man/man5/disorder_preferences.5
ae13d68e 176 rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
7207a21b 177 rm -f debian/disorder-server/usr/sbin/disorder-gstdecode
a349d8f9
RK
178 find debian/disorder-server -name '*.la' -print0 | xargs -r0 rm -f
179 find debian/disorder-server -name '*.so.0' -print0 | xargs -r0 rm -f
180 @for f in debian/disorder-server/usr/lib/disorder/*.so.0.0.0; do \
181 echo mv $$f $${f/.0.0.0};\
182 mv $$f $${f/.0.0.0};\
183 done
a349d8f9
RK
184 find debian/disorder-server -name '*.so' -print0 | xargs -r0 strip --strip-unneeded
185 find debian/disorder-server -name '*.so' -print0 | xargs -r0 chmod -x
48deaa73
RK
186 $(MKDIR) debian/disorder-server/etc/disorder
187 $(MKDIR) debian/disorder-server/etc/init.d
f03d4184 188 $(MKDIR) debian/disorder-server${cgiexecdir}
48deaa73 189 $(MKDIR) debian/disorder-server/var/lib/disorder
2ea2b361 190 $(MKDIR) debian/disorder-server/etc/cron.daily
48deaa73
RK
191 $(INSTALL_SCRIPT) examples/disorder.init \
192 debian/disorder-server/etc/init.d/disorder
193 $(INSTALL_DATA) debian/etc.disorder.config \
194 debian/disorder-server/etc/disorder/config
8f9616f1 195 $(INSTALL_DATA) templates/options \
48deaa73 196 debian/disorder-server/etc/disorder/options
8f9616f1
RK
197 $(INSTALL_DATA) debian/etc.disorder.options.user \
198 debian/disorder-server/etc/disorder/options.user
2ea2b361 199 $(INSTALL_SCRIPT) debian/disorder.daily debian/disorder-server/etc/cron.daily/disorder
4cbafe13 200 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
f03d4184 201 $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
a987f4a7 202 gzip -9f debian/disorder-server/usr/share/man/man*/*
48deaa73 203 dpkg-shlibdeps -Tdebian/substvars.disorder-server \
f03d4184 204 debian/disorder-server${cgiexecdir}/disorder \
48deaa73 205 debian/disorder-server/usr/sbin/* \
a349d8f9 206 debian/disorder-server/usr/lib/disorder/*.so
48deaa73
RK
207 rm -rf debian/disorder-server/usr/share/doc/disorder-server
208 ln -s disorder debian/disorder-server/usr/share/doc/disorder-server
0a3004d0
RK
209 strip --remove-section=.comment \
210 debian/disorder-server/usr/sbin/* \
211 debian/disorder-server${cgiexecdir}/* \
0a3004d0 212 debian/disorder-server/usr/lib/disorder/*.so
d9690752
RK
213 cd debian/disorder-server && \
214 find -name DEBIAN -prune -o -type f -print \
215 | sed 's/^\.\///' \
216 | xargs md5sum > DEBIAN/md5sums
48deaa73
RK
217 dpkg-gencontrol -isp -pdisorder-server -Pdebian/disorder-server -Tdebian/substvars.disorder-server
218 chown -R root:root debian/disorder-server
219 chmod -R g-ws debian/disorder-server
220 dpkg --build debian/disorder-server ..
221
48deaa73
RK
222pkg-disorder-playrtp: build
223 rm -rf debian/disorder-playrtp
224 $(MKDIR) debian/disorder-playrtp
225 $(MKDIR) debian/disorder-playrtp/DEBIAN
226 $(MKDIR) debian/disorder-playrtp/usr/share/doc/disorder-playrtp
227 $(INSTALL_DATA) debian/copyright \
228 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/copyright
229 $(INSTALL_DATA) debian/changelog \
c94f44c1
RK
230 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog
231 gzip -9 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog*
48deaa73
RK
232 @for f in preinst postinst prerm postrm conffiles templates config; do\
233 if test -e debian/$$f.disorder-playrtp; then\
234 echo $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \
235 $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \
236 fi;\
237 done
238 $(MKDIR) debian/disorder-playrtp/usr/bin
239 $(MKDIR) debian/disorder-playrtp/usr/share/man/man1
240 $(INSTALL_PROGRAM) clients/disorder-playrtp \
241 debian/disorder-playrtp/usr/bin/disorder-playrtp
0a3004d0 242 strip --remove-section=.comment debian/disorder-playrtp/usr/bin/disorder-playrtp
48deaa73
RK
243 $(INSTALL_DATA) doc/disorder-playrtp.1 \
244 debian/disorder-playrtp/usr/share/man/man1/disorder-playrtp.1
245 dpkg-shlibdeps -Tdebian/substvars.disorder-playrtp \
246 debian/disorder-playrtp/usr/bin/*
247 $(INSTALL_DATA) debian/README.RTP \
248 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/README
bfa2f233
RK
249 $(INSTALL_DATA) CHANGES.html debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES.html
250 gzip -9f debian/disorder-playrtp/usr/share/man/man*/*
d9690752
RK
251 cd debian/disorder-playrtp && \
252 find -name DEBIAN -prune -o -type f -print \
253 | sed 's/^\.\///' \
254 | xargs md5sum > DEBIAN/md5sums
48deaa73
RK
255 dpkg-gencontrol -isp -pdisorder-playrtp -Pdebian/disorder-playrtp -Tdebian/substvars.disorder-playrtp
256 chown -R root:root debian/disorder-playrtp
257 chmod -R g-ws debian/disorder-playrtp
258 dpkg --build debian/disorder-playrtp ..
259
7207a21b
MW
260pkg-disorder-gstdecode: build
261 rm -rf debian/disorder-gstdecode
262 $(MKDIR) debian/disorder-gstdecode
263 $(MKDIR) debian/disorder-gstdecode/DEBIAN
264 $(MKDIR) debian/disorder-gstdecode/usr/share/doc/disorder-gstdecode
265 $(INSTALL_DATA) debian/copyright \
266 debian/disorder-gstdecode/usr/share/doc/disorder-gstdecode/copyright
267 $(INSTALL_DATA) debian/changelog \
268 debian/disorder-gstdecode/usr/share/doc/disorder-gstdecode/changelog
269 gzip -9 debian/disorder-gstdecode/usr/share/doc/disorder-gstdecode/changelog*
270 @for f in preinst postinst prerm postrm conffiles templates config; do\
271 if test -e debian/$$f.disorder-gstdecode; then\
272 echo $(INSTALL_SCRIPT) debian/$$f.disorder-gstdecode debian/disorder-gstdecode/DEBIAN/$$f; \
273 $(INSTALL_SCRIPT) debian/$$f.disorder-gstdecode debian/disorder-gstdecode/DEBIAN/$$f; \
274 fi;\
275 done
276 $(MKDIR) debian/disorder-gstdecode/usr/sbin
c764e832 277 $(MKDIR) debian/disorder-gstdecode/usr/share/man/man8
7207a21b
MW
278 $(INSTALL_PROGRAM) server/disorder-gstdecode \
279 debian/disorder-gstdecode/usr/sbin/disorder-gstdecode
280 strip --remove-section=.comment debian/disorder-gstdecode/usr/sbin/disorder-gstdecode
c764e832
MW
281 $(INSTALL_DATA) doc/disorder-gstdecode.8 \
282 debian/disorder-gstdecode/usr/share/man/man8/disorder-gstdecode.8
7207a21b
MW
283 dpkg-shlibdeps -Tdebian/substvars.disorder-gstdecode \
284 debian/disorder-gstdecode/usr/sbin/*
285 $(INSTALL_DATA) CHANGES.html debian/disorder-gstdecode/usr/share/doc/disorder-gstdecode/CHANGES.html
c764e832 286 gzip -9f debian/disorder-gstdecode/usr/share/man/man*/*
7207a21b
MW
287 cd debian/disorder-gstdecode && \
288 find -name DEBIAN -prune -o -type f -print \
289 | sed 's/^\.\///' \
290 | xargs md5sum > DEBIAN/md5sums
291 dpkg-gencontrol -isp -pdisorder-gstdecode -Pdebian/disorder-gstdecode -Tdebian/substvars.disorder-gstdecode
292 chown -R root:root debian/disorder-gstdecode
293 chmod -R g-ws debian/disorder-gstdecode
294 dpkg --build debian/disorder-gstdecode ..
295
48deaa73
RK
296pkg-disobedience: build
297 rm -rf debian/disobedience
298 $(MKDIR) debian/disobedience
299 $(MKDIR) debian/disobedience/DEBIAN
300 $(MKDIR) debian/disobedience/usr/share/doc/disobedience
301 $(INSTALL_DATA) debian/copyright \
302 debian/disobedience/usr/share/doc/disobedience/copyright
303 $(INSTALL_DATA) debian/changelog \
c94f44c1
RK
304 debian/disobedience/usr/share/doc/disobedience/changelog
305 gzip -9 debian/disobedience/usr/share/doc/disobedience/changelog*
48deaa73
RK
306 @for f in preinst postinst prerm postrm conffiles templates config; do\
307 if test -e debian/$$f.disobedience; then\
308 echo $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \
309 $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \
310 fi;\
311 done
312 $(MKDIR) debian/disobedience/usr/bin
313 $(MKDIR) debian/disobedience/usr/share/man/man1
314 $(MKDIR) debian/disobedience/usr/share/pixmaps
315 $(MKDIR) debian/disobedience/usr/share/menu
868adf23 316 $(MKDIR) debian/disobedience/usr/share/doc-base
48deaa73 317 $(MAKE) -C disobedience install DESTDIR=`pwd`/debian/disobedience
0a3004d0 318 strip --remove-section=.comment debian/disobedience/usr/bin/disobedience
48deaa73
RK
319 $(INSTALL_DATA) doc/disobedience.1 \
320 debian/disobedience/usr/share/man/man1/disobedience.1
321 $(INSTALL_DATA) images/disobedience16x16.xpm \
322 images/disobedience32x32.xpm \
323 debian/disobedience/usr/share/pixmaps
324 $(INSTALL_DATA) debian/usr.share.menu.disobedience \
325 debian/disobedience/usr/share/menu/disobedience
868adf23
RK
326 $(INSTALL_DATA) debian/disobedience-manual \
327 debian/disobedience/usr/share/doc-base/disobedience-manual
a987f4a7 328 gzip -9f debian/disobedience/usr/share/man/man*/*
48deaa73
RK
329 dpkg-shlibdeps -Tdebian/substvars.disobedience \
330 debian/disobedience/usr/bin/*
331 rm -rf debian/disobedience/usr/share/doc/disobedience
332 ln -s disorder debian/disobedience/usr/share/doc/disobedience
d9690752
RK
333 cd debian/disobedience && \
334 find -name DEBIAN -prune -o -type f -print \
335 | sed 's/^\.\///' \
336 | xargs md5sum > DEBIAN/md5sums
48deaa73
RK
337 dpkg-gencontrol -isp -pdisobedience -Pdebian/disobedience -Tdebian/substvars.disobedience
338 chown -R root:root debian/disobedience
339 chmod -R g-ws debian/disobedience
340 dpkg --build debian/disobedience ..
341
48deaa73
RK
342DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}')
343DSC=disorder_$(DEBVERSION).dsc
344DEBSRC=disorder_$(DEBVERSION).tar.gz
345VERSION=$(shell $(MAKE) echo-version)
346
347source:
348 $(MAKE) dist
349 rm -rf disorder-$(VERSION)
350 tar xfz disorder-$(VERSION).tar.gz
351 dpkg-source -b disorder-$(VERSION)
352 rm -rf disorder-$(VERSION) disorder-$(VERSION).tar.gz
353
354source-check: source
355 rm -rf disorder-$(DEBVERSION)
356 dpkg-source -x $(DSC)
357 cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT)
358
48deaa73 359binary: binary-arch binary-indep
eb5f83f4 360binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
7207a21b 361 pkg-disorder-gstdecode pkg-disobedience
48deaa73
RK
362binary-indep:
363
eb5f83f4 364clean:
e4821ef7 365 if test -f Makefile; then $(MAKE) distclean; fi
48deaa73
RK
366 rm -f config.cache
367 rm -f debian/files
368 rm -f debian/substvars.*
eb5f83f4
RK
369 rm -rf debian/disorder
370 rm -rf debian/disorder-server
371 rm -rf debian/disorder-playrtp
372 rm -rf debian/disobedience
373
374.PHONY: clean build pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
375 pkg-disobedience source source-check binary binary-arch binary-indep