3 # This file was originally written by Vollstrecker
5 # Uncomment this to turn on verbose mode.
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"\
17 "amule-skin-mac-gray"\
19 "amule-skin-priscilla"\
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
34 WEBSERVER
= --enable-webserver
35 REMOTEGUI
= --enable-amule-gui
36 DAEMON
= --enable-amule-daemon
39 AMULECMD
= --enable-amulecmd
40 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
42 LANGFLAG
= --with-language
=all
44 else ifeq ("build", "$(findstring build, $(flags))")
46 # PLASMAMULE = --enable-plasmamule
47 WXCAS
= --enable-wxcas
50 WEBSERVER
= --enable-webserver
51 REMOTEGUI
= --enable-amule-gui
52 DAEMON
= --enable-amule-daemon
55 AMULECMD
= --enable-amulecmd
56 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
58 LANGFLAG
= --with-language
=all
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})))
70 # ifeq ("plasmamule", "$(findstring plasmamule, $(flags))")
71 # PLASMAMULE = --enable-plasmamule
74 ifeq ("wxcas", "$(findstring wxcas, $(flags))")
75 WXCAS
= --enable-wxcas
78 ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
82 ifeq ("webserver", "$(findstring webserver, $(flags))")
83 WEBSERVER
= --enable-webserver
86 ifeq ("remotegui", "$(findstring remotegui, $(flags))")
87 REMOTEGUI
= --enable-amule-gui
90 ifeq ("daemon", "$(findstring daemon, $(flags))")
91 DAEMON
= --enable-amule-daemon
94 ifeq ("alcc", "$(findstring alcc, $(flags))")
98 ifeq ("alc", "$(findstring alc, $(wo_alcc))")
102 ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
103 AMULECMD
= --enable-amulecmd
106 ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
107 AMULE
= --disable-monolithic
110 ifneq ("ed2k", "$(findstring ed2k, $(flags))")
111 ED2K
= --disable-ed2k
114 ifeq ("xas", "$(findstring xas, $(flags))")
118 #Now find out if a Metapackage should be build
119 ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
121 REMOTEGUI
= --enable-amule-gui
122 WXCAS
= --enable-wxcas
125 ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
127 AMULECMD
= --enable-amulecmd
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
138 ifeq ("i18n-ast", "$(findstring i18n-ast, $(flags))")
139 LANGUAGE
:= $(LANGUAGE
),ast
142 ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
143 LANGUAGE
:= $(LANGUAGE
),bg
146 ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
147 LANGUAGE
:= $(LANGUAGE
),ca
150 ifeq ("i18n-cs", "$(findstring i18n-cs, $(flags))")
151 LANGUAGE
:= $(LANGUAGE
),cs
154 ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
155 LANGUAGE
:= $(LANGUAGE
),da
158 ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
159 LANGUAGE
:= $(LANGUAGE
),de
162 ifeq ("i18n-el", "$(findstring i18n-el, $(flags))")
163 LANGUAGE
:= $(LANGUAGE
),el
166 ifeq ("i18n-es", "$(findstring i18n-es, $(flags))")
167 LANGUAGE
:= $(LANGUAGE
),es
170 ifeq ("i18n-et-ee", "$(findstring i18n-et-ee, $(flags))")
171 LANGUAGE
:= $(LANGUAGE
),et_EE
174 ifeq ("i18n-eu", "$(findstring i18n-eu, $(flags))")
175 LANGUAGE
:= $(LANGUAGE
),eu
178 ifeq ("i18n-fi", "$(findstring i18n-fi, $(flags))")
179 LANGUAGE
:= $(LANGUAGE
),fi
182 ifeq ("i18n-fr", "$(findstring i18n-fr, $(flags))")
183 LANGUAGE
:= $(LANGUAGE
),fr
186 ifeq ("i18n-gl", "$(findstring i18n-gl, $(flags))")
187 LANGUAGE
:= $(LANGUAGE
),gl
190 ifeq ("i18n-he", "$(findstring i18n-he, $(flags))")
191 LANGUAGE
:= $(LANGUAGE
),he
194 ifeq ("i18n-hr", "$(findstring i18n-hr, $(flags))")
195 LANGUAGE
:= $(LANGUAGE
),hr
198 ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
199 LANGUAGE
:= $(LANGUAGE
),hu
202 ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
203 LANGUAGE
:= $(LANGUAGE
),it
206 ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
207 LANGUAGE
:= $(LANGUAGE
),it_CH
210 ifeq ("i18n-ja", "$(findstring i18n-ja, $(flags))")
211 LANGUAGE
:= $(LANGUAGE
),ja
214 ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
215 LANGUAGE
:= $(LANGUAGE
),ko_KR
218 ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
219 LANGUAGE
:= $(LANGUAGE
),lt
222 ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
223 LANGUAGE
:= $(LANGUAGE
),hl
226 ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
227 LANGUAGE
:= $(LANGUAGE
),nn
230 ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
231 LANGUAGE
:= $(LANGUAGE
),pl
234 ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
235 LANGUAGE
:= $(LANGUAGE
),pt_BR
238 ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
239 LANGUAGE
:= $(LANGUAGE
),pt_PT
242 ifeq ("i18n-ro", "$(findstring i18n-ro, $(flags))")
243 LANGUAGE
:= $(LANGUAGE
),ro
246 ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
247 LANGUAGE
:= $(LANGUAGE
),ru
250 ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
251 LANGUAGE
:= $(LANGUAGE
),sl
254 ifeq ("i18n-sq", "$(findstring i18n-sq, $(flags))")
255 LANGUAGE
:= $(LANGUAGE
),sq
258 ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
259 LANGUAGE
:= $(LANGUAGE
),sv
262 ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
263 LANGUAGE
:= $(LANGUAGE
),tr
266 ifeq ("i18n-uk", "$(findstring i18n-uk, $(flags))")
267 LANGUAGE
:= $(LANGUAGE
),uk
270 ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
271 LANGUAGE
:= $(LANGUAGE
),zh_CN
274 ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
275 LANGUAGE
:= $(LANGUAGE
),zh_TW
278 ifeq ($(LANGUAGE
),en_GB
)
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
290 DEBUGGING
= --disable-debug
--enable-optimize
--disable-profile
294 #Before we start, I want to introduce two sequences for building the packages
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
,,$@
)
320 #Now we configure this whole thing
321 config.status
: configure
323 CFLAGS
="$(CFLAGS)" dh_auto_configure
-- --host
=$(DEB_HOST_GNU_TYPE
)\
324 LDFLAGS
="-Wl,--as-needed ${LDFLAGS}"\
343 #And here is the well known clean target
351 #Some generic targets to check the build process
354 build-stamp
: config.status
361 #Now we install the packages all together to the tmp-dir inside of debian/
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; \
382 dh_lintian
-p
$$pkg; \
383 dh_compress
-X.pl
-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; \
395 %-package
: amule-common
398 amule-
%-dbgsym
: amule-
%-package
401 amule-dbgsym
: amule-package
404 amuleweb-dbgsym
: amuleweb-package
407 #Now just the targets to map the Commandline Name to the package names
411 ed2k
: amule-ed2k-package
414 cas
: amule-cas-package
417 wxcas
: amule-wxcas-package
420 webserver
: amuleweb-package amule-theme-default-package
423 remotegui
: amule-remote-gui-package
426 daemon
: amule-daemon-package
429 alc
: amule-alc-package
432 alcc
: amule-alcc-package
435 amulecmd
: amule-cmd-package
438 xas
: amule-xas-package
441 ed2k-dbgsym
: amule-ed2k-dbgsym
444 cas-dbgsym
: amule-cas-dbgsym
447 wxcas-dbgsym
: amule-wxcas-dbgsym
450 webserver-dbgsym
: amuleweb-dbgsym
453 remotegui-dbgsym
: amule-remote-gui-dbgsym
456 daemon-dbgsym
: amule-daemon-dbgsym
459 alc-dbgsym
: amule-alc-dbgsym
462 alcc-dbgsym
: amule-alcc-dbgsym
465 amulecmd-dbgsym
: amule-cmd-dbgsym
468 plasmamule
: amule-plasmamule-package
471 plasmamule-dbgsym
: amule-plasmamule-dbgsym
474 #Here come the Targets for the langauge packages
475 i18n-
%: amule-i18n-
% ;
477 amule-i18n-
%: amule-common
480 #They are just metapackages
481 amule-utils
: alcc amulecmd cas
484 amule-utils-gui
: alc remotegui wxcas
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
;
490 normal-packages
: amule-utils amule-utils-gui amule ed2k webserver daemon xas
;
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
;
495 #If we build from a svn checkout, we need to generate configure
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
507 cat README.Debian-Packages
510 .PHONY
: build
clean binary-indep binary-arch binary
install debug-packages normal-packages i18n-only language-packages