debian: fix build-deps for focal
[amule.git] / debian / rules
blob5eb49bbbbb3c66cee9fb7fe37afdf6a805cd00c3
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # This file was originally written by Vollstrecker
5 # Uncomment this to turn on verbose mode.
6 export DH_VERBOSE=1
7 export DEB_BUILD_OPTIONS_PARALLEL=3
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 #Here are the packages that can't be compiled separate now
14 general_pkgs = "amule-common"\
15 "amule-skin-gnome"\
16 "amule-skin-kde4"\
17 "amule-skin-mac-gray"\
18 "amule-skin-papirus"\
19 "amule-skin-priscilla"\
20 "amule-skin-tango"\
21 "amule-skin-xfce"
23 # First, get the targets from commandline
24 flags = ${MAKECMDGOALS}
26 #First we have to find out, if we are called from dpkg-buildpackage
28 ifeq ("binary", "$(findstring binary, $(flags))")
30 # PLASMAMULE = --enable-plasmamule
31 WXCAS = --enable-wxcas
32 XAS = --enable-xas
33 CAS = --enable-cas
34 WEBSERVER = --enable-webserver
35 REMOTEGUI = --enable-amule-gui
36 DAEMON = --enable-amule-daemon
37 ALCC = --enable-alcc
38 ALC = --enable-alc
39 AMULECMD = --enable-amulecmd
40 DEBUGGING = --enable-debug --disable-optimize --disable-profile
41 DEBUGBUILD = yes
42 LANGFLAG = --with-language=all
44 else ifeq ("build", "$(findstring build, $(flags))")
46 # PLASMAMULE = --enable-plasmamule
47 WXCAS = --enable-wxcas
48 XAS = --enable-xas
49 CAS = --enable-cas
50 WEBSERVER = --enable-webserver
51 REMOTEGUI = --enable-amule-gui
52 DAEMON = --enable-amule-daemon
53 ALCC = --enable-alcc
54 ALC = --enable-alc
55 AMULECMD = --enable-amulecmd
56 DEBUGGING = --enable-debug --disable-optimize --disable-profile
57 DEBUGBUILD = yes
58 LANGFLAG = --with-language=all
60 else
61 #Now we have to check what packages are build to configure only them
63 #We have to filter the right targets (wo_ means without)
64 wo_wxcas = $(subst wxcas,, ${flags})
65 wo_alcc = $(subst alcc,, ${flags})
66 wo_amule_utils_gui = $(subst amule-utils-gui,,${flags})
67 wo_all_other_amules = $(subst amulecmd,,$(subst amule-utils-gui,,$(subst amule-utils,,${flags})))
68 LANGUAGE := en_GB
70 # ifeq ("plasmamule", "$(findstring plasmamule, $(flags))")
71 # PLASMAMULE = --enable-plasmamule
72 # endif
74 ifeq ("wxcas", "$(findstring wxcas, $(flags))")
75 WXCAS = --enable-wxcas
76 endif
78 ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
79 CAS = --enable-cas
80 endif
82 ifeq ("webserver", "$(findstring webserver, $(flags))")
83 WEBSERVER = --enable-webserver
84 endif
86 ifeq ("remotegui", "$(findstring remotegui, $(flags))")
87 REMOTEGUI = --enable-amule-gui
88 endif
90 ifeq ("daemon", "$(findstring daemon, $(flags))")
91 DAEMON = --enable-amule-daemon
92 endif
94 ifeq ("alcc", "$(findstring alcc, $(flags))")
95 ALCC = --enable-alcc
96 endif
98 ifeq ("alc", "$(findstring alc, $(wo_alcc))")
99 ALC = --enable-alc
100 endif
102 ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
103 AMULECMD = --enable-amulecmd
104 endif
106 ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
107 AMULE = --disable-monolithic
108 endif
110 ifneq ("ed2k", "$(findstring ed2k, $(flags))")
111 ED2K = --disable-ed2k
112 endif
114 ifeq ("xas", "$(findstring xas, $(flags))")
115 XAS = --enable-xas
116 endif
118 #Now find out if a Metapackage should be build
119 ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
120 ALC = --enable-alc
121 REMOTEGUI = --enable-amule-gui
122 WXCAS = --enable-wxcas
123 endif
125 ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
126 ALCC = --enable-alcc
127 AMULECMD = --enable-amulecmd
128 CAS = --enable-cas
129 endif
131 #Find this whole i18n stuff
132 ifneq ("i18n-en-only", "$(findstring i18n-en-only, $(flags))")
134 ifeq ("i18n-ar", "$(findstring i18n-ar, $(flags))")
135 LANGUAGE := $(LANGUAGE),ar
136 endif
138 ifeq ("i18n-ast", "$(findstring i18n-ast, $(flags))")
139 LANGUAGE := $(LANGUAGE),ast
140 endif
142 ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
143 LANGUAGE := $(LANGUAGE),bg
144 endif
146 ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
147 LANGUAGE := $(LANGUAGE),ca
148 endif
150 ifeq ("i18n-cs", "$(findstring i18n-cs, $(flags))")
151 LANGUAGE := $(LANGUAGE),cs
152 endif
154 ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
155 LANGUAGE := $(LANGUAGE),da
156 endif
158 ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
159 LANGUAGE := $(LANGUAGE),de
160 endif
162 ifeq ("i18n-el", "$(findstring i18n-el, $(flags))")
163 LANGUAGE := $(LANGUAGE),el
164 endif
166 ifeq ("i18n-es", "$(findstring i18n-es, $(flags))")
167 LANGUAGE := $(LANGUAGE),es
168 endif
170 ifeq ("i18n-et-ee", "$(findstring i18n-et-ee, $(flags))")
171 LANGUAGE := $(LANGUAGE),et_EE
172 endif
174 ifeq ("i18n-eu", "$(findstring i18n-eu, $(flags))")
175 LANGUAGE := $(LANGUAGE),eu
176 endif
178 ifeq ("i18n-fi", "$(findstring i18n-fi, $(flags))")
179 LANGUAGE := $(LANGUAGE),fi
180 endif
182 ifeq ("i18n-fr", "$(findstring i18n-fr, $(flags))")
183 LANGUAGE := $(LANGUAGE),fr
184 endif
186 ifeq ("i18n-gl", "$(findstring i18n-gl, $(flags))")
187 LANGUAGE := $(LANGUAGE),gl
188 endif
190 ifeq ("i18n-he", "$(findstring i18n-he, $(flags))")
191 LANGUAGE := $(LANGUAGE),he
192 endif
194 ifeq ("i18n-hr", "$(findstring i18n-hr, $(flags))")
195 LANGUAGE := $(LANGUAGE),hr
196 endif
198 ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
199 LANGUAGE := $(LANGUAGE),hu
200 endif
202 ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
203 LANGUAGE := $(LANGUAGE),it
204 endif
206 ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
207 LANGUAGE := $(LANGUAGE),it_CH
208 endif
210 ifeq ("i18n-ja", "$(findstring i18n-ja, $(flags))")
211 LANGUAGE := $(LANGUAGE),ja
212 endif
214 ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
215 LANGUAGE := $(LANGUAGE),ko_KR
216 endif
218 ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
219 LANGUAGE := $(LANGUAGE),lt
220 endif
222 ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
223 LANGUAGE := $(LANGUAGE),hl
224 endif
226 ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
227 LANGUAGE := $(LANGUAGE),nn
228 endif
230 ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
231 LANGUAGE := $(LANGUAGE),pl
232 endif
234 ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
235 LANGUAGE := $(LANGUAGE),pt_BR
236 endif
238 ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
239 LANGUAGE := $(LANGUAGE),pt_PT
240 endif
242 ifeq ("i18n-ro", "$(findstring i18n-ro, $(flags))")
243 LANGUAGE := $(LANGUAGE),ro
244 endif
246 ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
247 LANGUAGE := $(LANGUAGE),ru
248 endif
250 ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
251 LANGUAGE := $(LANGUAGE),sl
252 endif
254 ifeq ("i18n-sq", "$(findstring i18n-sq, $(flags))")
255 LANGUAGE := $(LANGUAGE),sq
256 endif
258 ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
259 LANGUAGE := $(LANGUAGE),sv
260 endif
262 ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
263 LANGUAGE := $(LANGUAGE),tr
264 endif
266 ifeq ("i18n-uk", "$(findstring i18n-uk, $(flags))")
267 LANGUAGE := $(LANGUAGE),uk
268 endif
270 ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
271 LANGUAGE := $(LANGUAGE),zh_CN
272 endif
274 ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
275 LANGUAGE := $(LANGUAGE),zh_TW
276 endif
278 ifeq ($(LANGUAGE),en_GB)
279 LANGUAGE = all
280 endif
282 endif
284 LANGFLAG = --with-language=$(LANGUAGE)
286 #And at Last, find out if we compile a debug-package or not.
287 ifeq ("dbgsym", "$(findstring dbgsym, $(flags))")
288 DEBUGGING = --enable-debug --disable-optimize --disable-profile
289 else
290 DEBUGGING = --disable-debug --enable-optimize --disable-profile
291 endif
292 endif
294 #Before we start, I want to introduce two sequences for building the packages
295 define package
296 dh_testdir -p$(subst -package,,$@)
297 dh_testroot -p$(subst -package,,$@)
298 dh_installdirs -p$(subst -package,,$@)
299 dh_installchangelogs docs/Changelog -p$(subst -package,,$@)
300 dh_installdocs -p$(subst -package,,$@)
301 dh_install -Xlicense.txt -p$(subst -package,,$@)
302 dh_installdebconf -p$(subst -package,,$@)
303 dh_installman -p$(subst -package,,$@)
304 dh_installmime -p$(subst -package,,$@)
305 dh_link -p$(subst -package,,$@)
306 dh_lintian -p$(subst -package,,$@)
307 dh_compress -X.pl -p$(subst -package,,$@)
308 dh_perl -p$(subst -package,,$@)
309 dh_makeshlibs -p$(subst -package,,$@)
310 dh_installdeb -p$(subst -package,,$@)
311 dh_shlibdeps -p$(subst -package,,$@)
312 dh_strip --dbgsym-migration='$(subst -package,,$@) (<< 2.3.1+svn-10712~)'
313 dh_gencontrol -p$(subst -package,,$@)
314 dh_md5sums -p$(subst -package,,$@)
315 dh_fixperms -p$(subst -package,,$@)
316 dh_builddeb -p$(subst -package,,$@)
317 touch $@
318 endef
320 #Now we configure this whole thing
321 config.status: configure
322 dh_testdir
323 CFLAGS="$(CFLAGS)" dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE)\
324 LDFLAGS="-Wl,--as-needed ${LDFLAGS}"\
325 --enable-ccache\
326 --enable-geoip\
327 --with-boost\
328 ${PLASMAMULE}\
329 ${AMULECMD}\
330 ${DEBUGGING}\
331 ${WEBSERVER}\
332 ${CAS}\
333 ${WXCAS}\
334 ${ALC}\
335 ${ALCC}\
336 ${REMOTEGUI}\
337 ${DAEMON}\
338 ${AMULE}\
339 ${ED2K}\
340 $(LANGFLAG)\
341 $(XAS)
343 #And here is the well known clean target
344 clean:
345 dh_testdir
346 dh_testroot
347 dh_clean
348 dh_auto_clean
349 dh_prep
351 #Some generic targets to check the build process
352 build: build-stamp
354 build-stamp: config.status
355 dh_testdir
357 dh_auto_build
359 touch build-stamp
361 #Now we install the packages all together to the tmp-dir inside of debian/
362 install: build
363 dh_testdir
364 dh_testroot
366 dh_auto_install
368 #Now first build the packages that are compiled and installed on every build
369 amule-common: install
371 for pkg in $(general_pkgs); do \
372 dh_testdir -p$$pkg; \
373 dh_testroot -p$$pkg; \
374 dh_installdirs -p$$pkg; \
375 dh_installchangelogs -p$$pkg; \
376 dh_installdocs -p$$pkg; \
377 dh_install -Xlicense.txt -XChangelog -p$$pkg; \
378 dh_installmenu -p$$pkg; \
379 dh_installdebconf -p$$pkg; \
380 dh_installman -p$$pkg; \
381 dh_link -p$$pkg; \
382 dh_lintian -p$$pkg; \
383 dh_compress -X.pl -p$$pkg; \
384 dh_perl -p$$pkg; \
385 dh_makeshlibs -p$$pkg; \
386 dh_installdeb -p$$pkg; \
387 dh_shlibdeps -p$$pkg; \
388 dh_gencontrol -p$$pkg; \
389 dh_md5sums -p$$pkg; \
390 dh_fixperms -p$$pkg; \
391 dh_builddeb -p$$pkg; \
392 done
393 touch amule-common
395 %-package: amule-common
396 ${package}
398 amule-%-dbgsym: amule-%-package
399 ${dbgsympackage}
401 amule-dbgsym: amule-package
402 ${dbgsympackage}
404 amuleweb-dbgsym: amuleweb-package
405 ${dbgsympackage}
407 #Now just the targets to map the Commandline Name to the package names
408 amule: amule-package
409 touch @
411 ed2k: amule-ed2k-package
412 touch @
414 cas: amule-cas-package
415 touch @
417 wxcas: amule-wxcas-package
418 touch @
420 webserver: amuleweb-package amule-theme-default-package
421 touch @
423 remotegui: amule-remote-gui-package
424 touch @
426 daemon: amule-daemon-package
427 touch @
429 alc: amule-alc-package
430 touch @
432 alcc: amule-alcc-package
433 touch @
435 amulecmd: amule-cmd-package
436 touch @
438 xas: amule-xas-package
439 touch @
441 ed2k-dbgsym: amule-ed2k-dbgsym
442 touch @
444 cas-dbgsym: amule-cas-dbgsym
445 touch @
447 wxcas-dbgsym: amule-wxcas-dbgsym
448 touch @
450 webserver-dbgsym: amuleweb-dbgsym
451 touch @
453 remotegui-dbgsym: amule-remote-gui-dbgsym
454 touch @
456 daemon-dbgsym: amule-daemon-dbgsym
457 touch @
459 alc-dbgsym: amule-alc-dbgsym
460 touch @
462 alcc-dbgsym: amule-alcc-dbgsym
463 touch @
465 amulecmd-dbgsym: amule-cmd-dbgsym
466 touch @
468 plasmamule: amule-plasmamule-package
469 touch @
471 plasmamule-dbgsym: amule-plasmamule-dbgsym
472 touch @
474 #Here come the Targets for the langauge packages
475 i18n-%: amule-i18n-% ;
477 amule-i18n-%: amule-common
478 ${package}
480 #They are just metapackages
481 amule-utils: alcc amulecmd cas
482 ${package}
484 amule-utils-gui: alc remotegui wxcas
485 ${package}
487 #These are empty (Space after Semicolon)
488 debug-packages: amule-dbgsym ed2k-dbgsym cas-dbgsym wxcas-dbgsym webserver-dbgsym remotegui-dbgsym daemon-dbgsym alc-dbgsym alcc-dbgsym amulecmd-dbgsym;
489 #plasmamule-dbgsym;
490 normal-packages: amule-utils amule-utils-gui amule ed2k webserver daemon xas;
491 #plasmamule ;
492 language-packages: i18n-ar i18n-ast i18n-bg i18n-ca i18n-cs i18n-da i18n-de i18n-el i18n-en-gb i18n-es i18n-et-ee i18n-eu i18n-fi i18n-fr i18n-gl i18n-he i18n-hr i18n-hu i18n-it-ch i18n-it i18n-ja i18n-ko-kr i18n-lt i18n-nn i18n-nl i18n-pl i18n-pt-br i18n-pt-pt i18n-ru i18n-sl i18n-sq i18n-sv i18n-tr i18n-uk i18n-zh-cn i18n-zh-tw ;
493 i18n-en-only: ;
495 #If we build from a svn checkout, we need to generate configure
496 configure:
497 ./autogen.sh
499 #Now the targets for dpkg-buildpackage
500 binary-indep: build install
502 binary-arch: debug-packages normal-packages language-packages
504 binary: binary-indep binary-arch
506 help:
507 cat README.Debian-Packages
509 .DEFAULT_GOAL = help
510 .PHONY: build clean binary-indep binary-arch binary install debug-packages normal-packages i18n-only language-packages