chiark / gitweb /
Fix man page conflict
[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
46export INSTALL_DATA
47export INSTALL_SCRIPT
48export INSTALL_PROGRAM
49
410801ac
RK
50# We override sendmail to the value defined in policy, in case configure picks
51# up some other sendmail.
52SENDMAIL=/usr/sbin/sendmail
53
48deaa73
RK
54LIBTOOL=./libtool
55FAKEROOT=fakeroot
56
48deaa73
RK
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:
eb5f83f4 60 @set -e;if test ! -f configure; then \
d558cce2
RK
61 echo ./prepare;\
62 ./prepare;\
63 fi
eb5f83f4 64 @set -e;if test ! -f config.status; then \
48deaa73
RK
65 echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
66 ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
67 else\
68 echo ./config.status;\
69 ./config.status;\
70 fi
410801ac 71 $(MAKE) SENDMAIL=${SENDMAIL}
48deaa73 72
48deaa73
RK
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
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 \
82 debian/disorder/usr/share/doc/disorder/changelog.Debian
83 gzip -9 debian/disorder/usr/share/doc/disorder/changelog.Debian
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
98 $(MAKE) DESTDIR=`pwd`/debian/disorder installdirs install -C lib
1b23cbbe
RK
99 $(INSTALL_DATA) scripts/completion.bash \
100 debian/disorder/etc/bash_completion.d/disorder
48deaa73
RK
101 rm -rf debian/disorder/usr/share/man/man8
102 rm -rf debian/disorder/usr/share/disorder/*.html
ae13d68e 103 rm -rf debian/disorder/usr/share/disorder/*.tmpl
1b23cbbe 104 rmdir debian/disorder/usr/share/disorder
48deaa73
RK
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
ae13d68e
RK
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
48deaa73
RK
112 $(MKDIR) debian/disorder/etc/disorder
113 dpkg-shlibdeps -Tdebian/substvars.disorder \
114 debian/disorder/usr/bin/*
b0a578cb 115 $(INSTALL_DATA) CHANGES.html README debian/README.Debian \
48deaa73
RK
116 BUGS README.* \
117 debian/disorder/usr/share/doc/disorder/.
b0a578cb 118 gzip -9f debian/disorder/usr/share/doc/disorder/README \
48deaa73
RK
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
48deaa73
RK
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
a349d8f9 137 @for f in preinst postinst prerm postrm config; do\
48deaa73
RK
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
a349d8f9
RK
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
64ac73bb
RK
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
48deaa73
RK
156 rm -rf debian/disorder-server/usr/share/man/man1
157 rm -rf debian/disorder-server/usr/share/man/man3
ae13d68e 158 rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
e600bdf3 159 rm -f debian/disorder-server/usr/share/man/man5/disorder_preferences.5
ae13d68e 160 rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
a349d8f9
RK
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
48deaa73
RK
173 $(MKDIR) debian/disorder-server/etc/disorder
174 $(MKDIR) debian/disorder-server/etc/init.d
f03d4184 175 $(MKDIR) debian/disorder-server${cgiexecdir}
48deaa73
RK
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
8f9616f1 181 $(INSTALL_DATA) templates/options \
48deaa73 182 debian/disorder-server/etc/disorder/options
8f9616f1
RK
183 $(INSTALL_DATA) debian/etc.disorder.options.user \
184 debian/disorder-server/etc/disorder/options.user
4cbafe13 185 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
f03d4184 186 $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
a987f4a7 187 gzip -9f debian/disorder-server/usr/share/man/man*/*
48deaa73 188 dpkg-shlibdeps -Tdebian/substvars.disorder-server \
f03d4184 189 debian/disorder-server${cgiexecdir}/disorder \
48deaa73 190 debian/disorder-server/usr/sbin/* \
a349d8f9 191 debian/disorder-server/usr/lib/disorder/*.so
48deaa73
RK
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
48deaa73
RK
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
bfa2f233
RK
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*/*
48deaa73
RK
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
48deaa73
RK
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
a987f4a7 260 gzip -9f debian/disobedience/usr/share/man/man*/*
48deaa73
RK
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
48deaa73
RK
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
48deaa73 287binary: binary-arch binary-indep
eb5f83f4
RK
288binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
289 pkg-disobedience
48deaa73
RK
290binary-indep:
291
eb5f83f4 292clean:
41013672 293 test -f Makefile && $(MAKE) distclean
48deaa73
RK
294 rm -f config.cache
295 rm -f debian/files
296 rm -f debian/substvars.*
eb5f83f4
RK
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