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