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