chiark / gitweb /
Improve server man page a bit
[disorder] / debian / rules
1 #! /usr/bin/make -f
2 #
3 # Copyright (C) 2004-2008 Richard Kettlewell
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 cgiexecdir=/usr/lib/cgi-bin
22 httpdir=/var/www
23 browser=x-www-browser
24
25 # Options to configure.  This can be overridden by the caller if necessary.
26 CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}"
27
28 # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
29 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
30 CFLAGS=-O0 -g
31 else
32 CFLAGS=-O2 -g
33 endif
34 export CFLAGS
35
36 # Install commands.  You wouldn't normally override these.
37 INSTALL=install
38 INSTALL_DATA=$(INSTALL) -p -o root -g root -m 644
39 INSTALL_PROGRAM=$(INSTALL) -p -o root -g root -m 755
40 INSTALL_SCRIPT=$(INSTALL) -p -o root -g root -m 755
41 MKDIR=mkdir -p -m 755
42
43 # Set DEB_BUILD_OPTIONS=nostrip to install debuggable executables.
44 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
45 INSTALL_PROGRAM += -s
46 endif
47
48 export INSTALL_DATA
49 export INSTALL_SCRIPT
50 export INSTALL_PROGRAM
51
52 # We override sendmail to the value defined in policy, in case configure picks
53 # up some other sendmail.
54 SENDMAIL=/usr/sbin/sendmail
55
56 LIBTOOL=./libtool
57 FAKEROOT=fakeroot
58
59 # ./prepare is the script that generates configure etc.  It only needs to be
60 # run if building from a checkout rather than a tarball.
61 build:
62         @set -e;if test ! -f configure; then \
63           echo ./prepare;\
64           ./prepare;\
65         fi
66         @set -e;if test ! -f config.status; then \
67           echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
68           ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
69         else\
70           echo ./config.status;\
71           ./config.status;\
72         fi
73         $(MAKE) SENDMAIL=${SENDMAIL}
74
75 pkg-disorder: build
76         rm -rf debian/disorder
77         $(MKDIR) debian/disorder
78         $(MKDIR) debian/disorder/DEBIAN
79         $(MKDIR) debian/disorder/usr/share/doc/disorder
80         $(MKDIR) debian/disorder/etc/bash_completion.d
81         $(INSTALL_DATA) debian/copyright \
82                 debian/disorder/usr/share/doc/disorder/copyright
83         $(INSTALL_DATA) debian/changelog \
84                 debian/disorder/usr/share/doc/disorder/changelog.Debian
85         gzip -9 debian/disorder/usr/share/doc/disorder/changelog.Debian
86         @for f in preinst postinst prerm postrm conffiles templates config; do\
87           if test -e debian/$$f.disorder; then\
88             echo $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
89             $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
90           fi;\
91         done
92         $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C doc
93         $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C clients
94         $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C lib
95         $(INSTALL_DATA) scripts/completion.bash \
96                 debian/disorder/etc/bash_completion.d/disorder
97         rm -rf debian/disorder/usr/share/man/man8
98         rm -rf debian/disorder/usr/share/disorder/*.html
99         rm -rf debian/disorder/usr/share/disorder/*.tmpl
100         rmdir debian/disorder/usr/share/disorder
101         rm -f debian/disorder/usr/bin/disorder-playrtp
102         rm -f debian/disorder/usr/bin/disobedience
103         rm -f debian/disorder/usr/share/man/man1/disorder-playrtp.1
104         rm -f debian/disorder/usr/share/man/man1/disobedience.1
105         rm -f debian/disorder/usr/share/man/man5/disorder_templates.5
106         rm -f debian/disorder/usr/share/man/man5/disorder_actions.5
107         rm -f debian/disorder/usr/share/man/man5/disorder_options.5
108         $(MKDIR) debian/disorder/etc/disorder
109         dpkg-shlibdeps -Tdebian/substvars.disorder \
110                 debian/disorder/usr/bin/*
111         $(INSTALL_DATA) CHANGES.html README debian/README.Debian \
112                 BUGS README.* \
113                 debian/disorder/usr/share/doc/disorder/.
114         gzip -9f debian/disorder/usr/share/doc/disorder/README \
115                  debian/disorder/usr/share/doc/disorder/README.* \
116                  debian/disorder/usr/share/doc/disorder/BUGS \
117                  debian/disorder/usr/share/man/man*/*
118         dpkg-gencontrol -isp -pdisorder -Pdebian/disorder -Tdebian/substvars.disorder
119         chown -R root:root debian/disorder
120         chmod -R g-ws debian/disorder
121         dpkg --build debian/disorder ..
122
123 pkg-disorder-server: build
124         rm -rf debian/disorder-server
125         $(MKDIR) debian/disorder-server
126         $(MKDIR) debian/disorder-server/DEBIAN
127         $(MKDIR) debian/disorder-server/usr/share/doc/disorder-server
128         $(INSTALL_DATA) debian/copyright \
129                 debian/disorder-server/usr/share/doc/disorder-server/copyright
130         $(INSTALL_DATA) debian/changelog \
131                 debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian
132         gzip -9 debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian
133         @for f in preinst postinst prerm postrm conffiles templates config; do\
134           if test -e debian/$$f.disorder-server; then\
135             echo $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
136             $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
137           fi;\
138         done
139         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
140         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
141         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
142         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C driver
143         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins
144         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds
145         $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc
146         rm -rf debian/disorder-server/usr/share/man/man1
147         rm -rf debian/disorder-server/usr/share/man/man3
148         rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
149         rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
150         $(MKDIR) debian/disorder-server/etc/disorder
151         $(MKDIR) debian/disorder-server/etc/init.d
152         $(MKDIR) debian/disorder-server${cgiexecdir}
153         $(MKDIR) debian/disorder-server/var/lib/disorder
154         $(INSTALL_SCRIPT) examples/disorder.init \
155                 debian/disorder-server/etc/init.d/disorder
156         $(INSTALL_DATA) debian/etc.disorder.config \
157                 debian/disorder-server/etc/disorder/config
158         $(INSTALL_DATA) templates/options \
159                 debian/disorder-server/etc/disorder/options
160         $(INSTALL_DATA) debian/etc.disorder.options.user \
161                 debian/disorder-server/etc/disorder/options.user
162         $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
163                 $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
164         dpkg-shlibdeps -Tdebian/substvars.disorder-server \
165                 debian/disorder-server${cgiexecdir}/disorder \
166                 debian/disorder-server/usr/sbin/* \
167                 debian/disorder-server/usr/lib/disorder/*.so*
168         rm -rf debian/disorder-server/usr/share/doc/disorder-server
169         ln -s disorder debian/disorder-server/usr/share/doc/disorder-server
170         dpkg-gencontrol -isp -pdisorder-server -Pdebian/disorder-server -Tdebian/substvars.disorder-server
171         chown -R root:root debian/disorder-server
172         chmod -R g-ws debian/disorder-server
173         dpkg --build debian/disorder-server ..
174
175 pkg-disorder-playrtp: build
176         rm -rf debian/disorder-playrtp
177         $(MKDIR) debian/disorder-playrtp
178         $(MKDIR) debian/disorder-playrtp/DEBIAN
179         $(MKDIR) debian/disorder-playrtp/usr/share/doc/disorder-playrtp
180         $(INSTALL_DATA) debian/copyright \
181                 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/copyright
182         $(INSTALL_DATA) debian/changelog \
183                 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog.Debian
184         gzip -9 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog.Debian
185         @for f in preinst postinst prerm postrm conffiles templates config; do\
186           if test -e debian/$$f.disorder-playrtp; then\
187             echo $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \
188             $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \
189           fi;\
190         done
191         $(MKDIR) debian/disorder-playrtp/usr/bin
192         $(MKDIR) debian/disorder-playrtp/usr/share/man/man1
193         $(INSTALL_PROGRAM) clients/disorder-playrtp \
194                 debian/disorder-playrtp/usr/bin/disorder-playrtp
195         $(INSTALL_DATA) doc/disorder-playrtp.1 \
196                 debian/disorder-playrtp/usr/share/man/man1/disorder-playrtp.1
197         dpkg-shlibdeps -Tdebian/substvars.disorder-playrtp \
198                 debian/disorder-playrtp/usr/bin/*
199         $(INSTALL_DATA) debian/README.RTP \
200                 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/README
201         $(INSTALL_DATA) CHANGES.html debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES.html
202         gzip -9f debian/disorder-playrtp/usr/share/man/man*/*
203         dpkg-gencontrol -isp -pdisorder-playrtp -Pdebian/disorder-playrtp -Tdebian/substvars.disorder-playrtp
204         chown -R root:root debian/disorder-playrtp
205         chmod -R g-ws debian/disorder-playrtp
206         dpkg --build debian/disorder-playrtp ..
207
208 pkg-disobedience: build
209         rm -rf debian/disobedience
210         $(MKDIR) debian/disobedience
211         $(MKDIR) debian/disobedience/DEBIAN
212         $(MKDIR) debian/disobedience/usr/share/doc/disobedience
213         $(INSTALL_DATA) debian/copyright \
214                 debian/disobedience/usr/share/doc/disobedience/copyright
215         $(INSTALL_DATA) debian/changelog \
216                 debian/disobedience/usr/share/doc/disobedience/changelog.Debian
217         gzip -9 debian/disobedience/usr/share/doc/disobedience/changelog.Debian
218         @for f in preinst postinst prerm postrm conffiles templates config; do\
219           if test -e debian/$$f.disobedience; then\
220             echo $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \
221             $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \
222           fi;\
223         done
224         $(MKDIR) debian/disobedience/usr/bin
225         $(MKDIR) debian/disobedience/usr/share/man/man1
226         $(MKDIR) debian/disobedience/usr/share/pixmaps
227         $(MKDIR) debian/disobedience/usr/share/menu
228         $(MAKE) -C disobedience install DESTDIR=`pwd`/debian/disobedience
229         $(INSTALL_DATA) doc/disobedience.1 \
230                 debian/disobedience/usr/share/man/man1/disobedience.1
231         $(INSTALL_DATA) images/disobedience16x16.xpm \
232                         images/disobedience32x32.xpm \
233                         debian/disobedience/usr/share/pixmaps
234         $(INSTALL_DATA) debian/usr.share.menu.disobedience \
235                 debian/disobedience/usr/share/menu/disobedience
236         dpkg-shlibdeps -Tdebian/substvars.disobedience \
237                 debian/disobedience/usr/bin/*
238         rm -rf debian/disobedience/usr/share/doc/disobedience
239         ln -s disorder debian/disobedience/usr/share/doc/disobedience
240         dpkg-gencontrol -isp -pdisobedience -Pdebian/disobedience -Tdebian/substvars.disobedience
241         chown -R root:root debian/disobedience
242         chmod -R g-ws debian/disobedience
243         dpkg --build debian/disobedience ..
244
245 DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}')
246 DSC=disorder_$(DEBVERSION).dsc
247 DEBSRC=disorder_$(DEBVERSION).tar.gz
248 VERSION=$(shell $(MAKE) echo-version)
249
250 source:
251         $(MAKE) dist
252         rm -rf disorder-$(VERSION)
253         tar xfz disorder-$(VERSION).tar.gz
254         dpkg-source -b disorder-$(VERSION)
255         rm -rf disorder-$(VERSION) disorder-$(VERSION).tar.gz
256
257 source-check: source
258         rm -rf disorder-$(DEBVERSION)
259         dpkg-source -x $(DSC)
260         cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT)
261
262 binary: binary-arch binary-indep
263 binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
264              pkg-disobedience
265 binary-indep: 
266
267 clean:
268         -$(MAKE) distclean
269         rm -f config.cache
270         rm -f debian/files
271         rm -f debian/substvars.*
272         rm -rf debian/disorder
273         rm -rf debian/disorder-server
274         rm -rf debian/disorder-playrtp
275         rm -rf debian/disobedience
276
277 .PHONY: clean build pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
278         pkg-disobedience source source-check binary binary-arch binary-indep