chiark / gitweb /
Fix man page conflict
[disorder] / debian / rules
... / ...
CommitLineData
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 3 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,
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#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#
18
19cgiexecdir=/usr/lib/cgi-bin
20httpdir=/var/www
21browser=x-www-browser
22
23# Options to configure. This can be overridden by the caller if necessary.
24CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}"
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
46export INSTALL_DATA
47export INSTALL_SCRIPT
48export INSTALL_PROGRAM
49
50# We override sendmail to the value defined in policy, in case configure picks
51# up some other sendmail.
52SENDMAIL=/usr/sbin/sendmail
53
54LIBTOOL=./libtool
55FAKEROOT=fakeroot
56
57# ./prepare is the script that generates configure etc. It only needs to be
58# run if building from a checkout rather than a tarball.
59build:
60 @set -e;if test ! -f configure; then \
61 echo ./prepare;\
62 ./prepare;\
63 fi
64 @set -e;if test ! -f config.status; then \
65 echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
66 ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
67 else\
68 echo ./config.status;\
69 ./config.status;\
70 fi
71 $(MAKE) SENDMAIL=${SENDMAIL}
72
73pkg-disorder: build
74 rm -rf debian/disorder
75 $(MKDIR) debian/disorder
76 $(MKDIR) debian/disorder/DEBIAN
77 $(MKDIR) debian/disorder/usr/share/doc/disorder
78 $(MKDIR) debian/disorder/etc/bash_completion.d
79 $(INSTALL_DATA) debian/copyright \
80 debian/disorder/usr/share/doc/disorder/copyright
81 $(INSTALL_DATA) debian/changelog \
82 debian/disorder/usr/share/doc/disorder/changelog.Debian
83 gzip -9 debian/disorder/usr/share/doc/disorder/changelog.Debian
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\
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
98 $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C lib
99 $(INSTALL_DATA) scripts/completion.bash \
100 debian/disorder/etc/bash_completion.d/disorder
101 rm -rf debian/disorder/usr/share/man/man8
102 rm -rf debian/disorder/usr/share/disorder/*.html
103 rm -rf debian/disorder/usr/share/disorder/*.tmpl
104 rmdir debian/disorder/usr/share/disorder
105 rm -f debian/disorder/usr/bin/disorder-playrtp
106 rm -f debian/disorder/usr/bin/disobedience
107 rm -f debian/disorder/usr/share/man/man1/disorder-playrtp.1
108 rm -f debian/disorder/usr/share/man/man1/disobedience.1
109 rm -f debian/disorder/usr/share/man/man5/disorder_templates.5
110 rm -f debian/disorder/usr/share/man/man5/disorder_actions.5
111 rm -f debian/disorder/usr/share/man/man5/disorder_options.5
112 $(MKDIR) debian/disorder/etc/disorder
113 dpkg-shlibdeps -Tdebian/substvars.disorder \
114 debian/disorder/usr/bin/*
115 $(INSTALL_DATA) CHANGES.html README debian/README.Debian \
116 BUGS README.* \
117 debian/disorder/usr/share/doc/disorder/.
118 gzip -9f debian/disorder/usr/share/doc/disorder/README \
119 debian/disorder/usr/share/doc/disorder/README.* \
120 debian/disorder/usr/share/doc/disorder/BUGS \
121 debian/disorder/usr/share/man/man*/*
122 dpkg-gencontrol -isp -pdisorder -Pdebian/disorder -Tdebian/substvars.disorder
123 chown -R root:root debian/disorder
124 chmod -R g-ws debian/disorder
125 dpkg --build debian/disorder ..
126
127pkg-disorder-server: build
128 rm -rf debian/disorder-server
129 $(MKDIR) debian/disorder-server
130 $(MKDIR) debian/disorder-server/DEBIAN
131 $(MKDIR) debian/disorder-server/usr/share/doc/disorder-server
132 $(INSTALL_DATA) debian/copyright \
133 debian/disorder-server/usr/share/doc/disorder-server/copyright
134 $(INSTALL_DATA) debian/changelog \
135 debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian
136 gzip -9 debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian
137 @for f in preinst postinst prerm postrm config; do\
138 if test -e debian/$$f.disorder-server; then\
139 echo $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
140 $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
141 fi;\
142 done
143 @for f in conffiles templates; do\
144 if test -e debian/$$f.disorder-server; then\
145 echo $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
146 $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
147 fi;\
148 done
149 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
150 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
151 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
152 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C driver
153 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins
154 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds
155 $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc
156 rm -rf debian/disorder-server/usr/share/man/man1
157 rm -rf debian/disorder-server/usr/share/man/man3
158 rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
159 rm -f debian/disorder-server/usr/share/man/man5/disorder_preferences.5
160 rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
161 find debian/disorder-server -name '*.la' -print0 | xargs -r0 rm -f
162 find debian/disorder-server -name '*.so.0' -print0 | xargs -r0 rm -f
163 @for f in debian/disorder-server/usr/lib/disorder/*.so.0.0.0; do \
164 echo mv $$f $${f/.0.0.0};\
165 mv $$f $${f/.0.0.0};\
166 done
167 @for f in debian/disorder-server/usr/lib/ao/plugins*/*.so.0.0.0; do \
168 echo mv $$f $${f/.0.0.0};\
169 mv $$f $${f/.0.0.0};\
170 done
171 find debian/disorder-server -name '*.so' -print0 | xargs -r0 strip --strip-unneeded
172 find debian/disorder-server -name '*.so' -print0 | xargs -r0 chmod -x
173 $(MKDIR) debian/disorder-server/etc/disorder
174 $(MKDIR) debian/disorder-server/etc/init.d
175 $(MKDIR) debian/disorder-server${cgiexecdir}
176 $(MKDIR) debian/disorder-server/var/lib/disorder
177 $(INSTALL_SCRIPT) examples/disorder.init \
178 debian/disorder-server/etc/init.d/disorder
179 $(INSTALL_DATA) debian/etc.disorder.config \
180 debian/disorder-server/etc/disorder/config
181 $(INSTALL_DATA) templates/options \
182 debian/disorder-server/etc/disorder/options
183 $(INSTALL_DATA) debian/etc.disorder.options.user \
184 debian/disorder-server/etc/disorder/options.user
185 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
186 $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
187 gzip -9f debian/disorder-server/usr/share/man/man*/*
188 dpkg-shlibdeps -Tdebian/substvars.disorder-server \
189 debian/disorder-server${cgiexecdir}/disorder \
190 debian/disorder-server/usr/sbin/* \
191 debian/disorder-server/usr/lib/disorder/*.so
192 rm -rf debian/disorder-server/usr/share/doc/disorder-server
193 ln -s disorder debian/disorder-server/usr/share/doc/disorder-server
194 dpkg-gencontrol -isp -pdisorder-server -Pdebian/disorder-server -Tdebian/substvars.disorder-server
195 chown -R root:root debian/disorder-server
196 chmod -R g-ws debian/disorder-server
197 dpkg --build debian/disorder-server ..
198
199pkg-disorder-playrtp: build
200 rm -rf debian/disorder-playrtp
201 $(MKDIR) debian/disorder-playrtp
202 $(MKDIR) debian/disorder-playrtp/DEBIAN
203 $(MKDIR) debian/disorder-playrtp/usr/share/doc/disorder-playrtp
204 $(INSTALL_DATA) debian/copyright \
205 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/copyright
206 $(INSTALL_DATA) debian/changelog \
207 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog.Debian
208 gzip -9 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/changelog.Debian
209 @for f in preinst postinst prerm postrm conffiles templates config; do\
210 if test -e debian/$$f.disorder-playrtp; then\
211 echo $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \
212 $(INSTALL_SCRIPT) debian/$$f.disorder-playrtp debian/disorder-playrtp/DEBIAN/$$f; \
213 fi;\
214 done
215 $(MKDIR) debian/disorder-playrtp/usr/bin
216 $(MKDIR) debian/disorder-playrtp/usr/share/man/man1
217 $(INSTALL_PROGRAM) clients/disorder-playrtp \
218 debian/disorder-playrtp/usr/bin/disorder-playrtp
219 $(INSTALL_DATA) doc/disorder-playrtp.1 \
220 debian/disorder-playrtp/usr/share/man/man1/disorder-playrtp.1
221 dpkg-shlibdeps -Tdebian/substvars.disorder-playrtp \
222 debian/disorder-playrtp/usr/bin/*
223 $(INSTALL_DATA) debian/README.RTP \
224 debian/disorder-playrtp/usr/share/doc/disorder-playrtp/README
225 $(INSTALL_DATA) CHANGES.html debian/disorder-playrtp/usr/share/doc/disorder-playrtp/CHANGES.html
226 gzip -9f debian/disorder-playrtp/usr/share/man/man*/*
227 dpkg-gencontrol -isp -pdisorder-playrtp -Pdebian/disorder-playrtp -Tdebian/substvars.disorder-playrtp
228 chown -R root:root debian/disorder-playrtp
229 chmod -R g-ws debian/disorder-playrtp
230 dpkg --build debian/disorder-playrtp ..
231
232pkg-disobedience: build
233 rm -rf debian/disobedience
234 $(MKDIR) debian/disobedience
235 $(MKDIR) debian/disobedience/DEBIAN
236 $(MKDIR) debian/disobedience/usr/share/doc/disobedience
237 $(INSTALL_DATA) debian/copyright \
238 debian/disobedience/usr/share/doc/disobedience/copyright
239 $(INSTALL_DATA) debian/changelog \
240 debian/disobedience/usr/share/doc/disobedience/changelog.Debian
241 gzip -9 debian/disobedience/usr/share/doc/disobedience/changelog.Debian
242 @for f in preinst postinst prerm postrm conffiles templates config; do\
243 if test -e debian/$$f.disobedience; then\
244 echo $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \
245 $(INSTALL_SCRIPT) debian/$$f.disobedience debian/disobedience/DEBIAN/$$f; \
246 fi;\
247 done
248 $(MKDIR) debian/disobedience/usr/bin
249 $(MKDIR) debian/disobedience/usr/share/man/man1
250 $(MKDIR) debian/disobedience/usr/share/pixmaps
251 $(MKDIR) debian/disobedience/usr/share/menu
252 $(MAKE) -C disobedience install DESTDIR=`pwd`/debian/disobedience
253 $(INSTALL_DATA) doc/disobedience.1 \
254 debian/disobedience/usr/share/man/man1/disobedience.1
255 $(INSTALL_DATA) images/disobedience16x16.xpm \
256 images/disobedience32x32.xpm \
257 debian/disobedience/usr/share/pixmaps
258 $(INSTALL_DATA) debian/usr.share.menu.disobedience \
259 debian/disobedience/usr/share/menu/disobedience
260 gzip -9f debian/disobedience/usr/share/man/man*/*
261 dpkg-shlibdeps -Tdebian/substvars.disobedience \
262 debian/disobedience/usr/bin/*
263 rm -rf debian/disobedience/usr/share/doc/disobedience
264 ln -s disorder debian/disobedience/usr/share/doc/disobedience
265 dpkg-gencontrol -isp -pdisobedience -Pdebian/disobedience -Tdebian/substvars.disobedience
266 chown -R root:root debian/disobedience
267 chmod -R g-ws debian/disobedience
268 dpkg --build debian/disobedience ..
269
270DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}')
271DSC=disorder_$(DEBVERSION).dsc
272DEBSRC=disorder_$(DEBVERSION).tar.gz
273VERSION=$(shell $(MAKE) echo-version)
274
275source:
276 $(MAKE) dist
277 rm -rf disorder-$(VERSION)
278 tar xfz disorder-$(VERSION).tar.gz
279 dpkg-source -b disorder-$(VERSION)
280 rm -rf disorder-$(VERSION) disorder-$(VERSION).tar.gz
281
282source-check: source
283 rm -rf disorder-$(DEBVERSION)
284 dpkg-source -x $(DSC)
285 cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT)
286
287binary: binary-arch binary-indep
288binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
289 pkg-disobedience
290binary-indep:
291
292clean:
293 test -f Makefile && $(MAKE) distclean
294 rm -f config.cache
295 rm -f debian/files
296 rm -f debian/substvars.*
297 rm -rf debian/disorder
298 rm -rf debian/disorder-server
299 rm -rf debian/disorder-playrtp
300 rm -rf debian/disobedience
301
302.PHONY: clean build pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
303 pkg-disobedience source source-check binary binary-arch binary-indep