chiark / gitweb /
DisOrder 4.2
[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
f03d4184 21cgiexecdir=/usr/lib/cgi-bin
64ac73bb
RK
22httpdir=/var/www
23browser=x-www-browser
24
48deaa73 25# Options to configure. This can be overridden by the caller if necessary.
32918782 26CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}"
48deaa73
RK
27
28# Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
29ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
30CFLAGS=-O0 -g
31else
32CFLAGS=-O2 -g
33endif
34export CFLAGS
35
36# Install commands. You wouldn't normally override these.
37INSTALL=install
38INSTALL_DATA=$(INSTALL) -p -o root -g root -m 644
39INSTALL_PROGRAM=$(INSTALL) -p -o root -g root -m 755
40INSTALL_SCRIPT=$(INSTALL) -p -o root -g root -m 755
41MKDIR=mkdir -p -m 755
42
43# Set DEB_BUILD_OPTIONS=nostrip to install debuggable executables.
44ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
45INSTALL_PROGRAM += -s
46endif
47
48export INSTALL_DATA
49export INSTALL_SCRIPT
50export INSTALL_PROGRAM
51
410801ac
RK
52# We override sendmail to the value defined in policy, in case configure picks
53# up some other sendmail.
54SENDMAIL=/usr/sbin/sendmail
55
48deaa73
RK
56LIBTOOL=./libtool
57FAKEROOT=fakeroot
58
48deaa73
RK
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.
61build:
eb5f83f4 62 @set -e;if test ! -f configure; then \
d558cce2
RK
63 echo ./prepare;\
64 ./prepare;\
65 fi
eb5f83f4 66 @set -e;if test ! -f config.status; then \
48deaa73
RK
67 echo ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
68 ./configure ${CONFIGURE} ${CONFIGURE_EXTRA};\
69 else\
70 echo ./config.status;\
71 ./config.status;\
72 fi
410801ac 73 $(MAKE) SENDMAIL=${SENDMAIL}
48deaa73 74
48deaa73
RK
75pkg-disorder: build
76 rm -rf debian/disorder
77 $(MKDIR) debian/disorder
78 $(MKDIR) debian/disorder/DEBIAN
79 $(MKDIR) debian/disorder/usr/share/doc/disorder
1b23cbbe 80 $(MKDIR) debian/disorder/etc/bash_completion.d
48deaa73
RK
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
1b23cbbe
RK
95 $(INSTALL_DATA) scripts/completion.bash \
96 debian/disorder/etc/bash_completion.d/disorder
48deaa73
RK
97 rm -rf debian/disorder/usr/share/man/man8
98 rm -rf debian/disorder/usr/share/disorder/*.html
ae13d68e 99 rm -rf debian/disorder/usr/share/disorder/*.tmpl
1b23cbbe 100 rmdir debian/disorder/usr/share/disorder
48deaa73
RK
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
ae13d68e
RK
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
48deaa73
RK
108 $(MKDIR) debian/disorder/etc/disorder
109 dpkg-shlibdeps -Tdebian/substvars.disorder \
110 debian/disorder/usr/bin/*
b0a578cb 111 $(INSTALL_DATA) CHANGES.html README debian/README.Debian \
48deaa73
RK
112 BUGS README.* \
113 debian/disorder/usr/share/doc/disorder/.
b0a578cb 114 gzip -9f debian/disorder/usr/share/doc/disorder/README \
48deaa73
RK
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
48deaa73
RK
123pkg-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
64ac73bb
RK
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
48deaa73
RK
146 rm -rf debian/disorder-server/usr/share/man/man1
147 rm -rf debian/disorder-server/usr/share/man/man3
ae13d68e
RK
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
48deaa73
RK
150 $(MKDIR) debian/disorder-server/etc/disorder
151 $(MKDIR) debian/disorder-server/etc/init.d
f03d4184 152 $(MKDIR) debian/disorder-server${cgiexecdir}
48deaa73
RK
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
8f9616f1 158 $(INSTALL_DATA) templates/options \
48deaa73 159 debian/disorder-server/etc/disorder/options
8f9616f1
RK
160 $(INSTALL_DATA) debian/etc.disorder.options.user \
161 debian/disorder-server/etc/disorder/options.user
4cbafe13 162 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
f03d4184 163 $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
48deaa73 164 dpkg-shlibdeps -Tdebian/substvars.disorder-server \
f03d4184 165 debian/disorder-server${cgiexecdir}/disorder \
48deaa73
RK
166 debian/disorder-server/usr/sbin/* \
167 debian/disorder-server/usr/lib/disorder/*.so*
48deaa73
RK
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
48deaa73
RK
175pkg-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
bfa2f233
RK
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*/*
48deaa73
RK
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
48deaa73
RK
208pkg-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
48deaa73
RK
245DEBVERSION:=$(shell dpkg-parsechangelog|awk '/Version:/ {print $$2}')
246DSC=disorder_$(DEBVERSION).dsc
247DEBSRC=disorder_$(DEBVERSION).tar.gz
248VERSION=$(shell $(MAKE) echo-version)
249
250source:
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
257source-check: source
258 rm -rf disorder-$(DEBVERSION)
259 dpkg-source -x $(DSC)
260 cd disorder-$(DEBVERSION) && dpkg-buildpackage -r$(FAKEROOT)
261
48deaa73 262binary: binary-arch binary-indep
eb5f83f4
RK
263binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
264 pkg-disobedience
48deaa73
RK
265binary-indep:
266
eb5f83f4 267clean:
48deaa73
RK
268 -$(MAKE) distclean
269 rm -f config.cache
270 rm -f debian/files
271 rm -f debian/substvars.*
eb5f83f4
RK
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