3 # This file was originally written by Vollstrecker
5 # Uncomment this to turn on verbose mode.
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"\
20 # First, get the targets from commandline
21 flags
= ${MAKECMDGOALS}
23 #First we have to find out, if we are called from dpkg-buildpackage
25 ifeq ("binary", "$(findstring binary, $(flags))")
27 WXCAS
= --enable-wxcas
29 WEBSERVER
= --enable-webserver
30 REMOTEGUI
= --enable-amule-gui
31 DAEMON
= --enable-amule-daemon
34 AMULECMD
= --enable-amulecmd
35 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
36 LANGFLAG
= --with-language
=all
38 else ifeq ("build", "$(findstring build, $(flags))")
40 WXCAS
= --enable-wxcas
42 WEBSERVER
= --enable-webserver
43 REMOTEGUI
= --enable-amule-gui
44 DAEMON
= --enable-amule-daemon
47 AMULECMD
= --enable-amulecmd
48 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
49 LANGFLAG
= --with-language
=all
52 #Now we have to check what packages are build to configure only them
54 #We have to filter the right targets (wo_ means without)
55 wo_wxcas
= $(subst wxcas
,, ${flags})
56 wo_alcc
= $(subst alcc
,, ${flags})
57 wo_amule_utils_gui
= $(subst amule-utils-gui
,,${flags})
58 wo_all_other_amules
= $(subst amulecmd
,,$(subst amule-utils-gui
,,$(subst amule-utils
,,${flags})))
61 ifeq ("wxcas", "$(findstring wxcas, $(flags))")
62 WXCAS
= --enable-wxcas
65 ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
69 ifeq ("webserver", "$(findstring webserver, $(flags))")
70 WEBSERVER
= --enable-webserver
73 ifeq ("remotegui", "$(findstring remotegui, $(flags))")
74 REMOTEGUI
= --enable-amule-gui
77 ifeq ("daemon", "$(findstring daemon, $(flags))")
78 DAEMON
= --enable-amule-daemon
81 ifeq ("alcc", "$(findstring alcc, $(flags))")
85 ifeq ("alc", "$(findstring alc, $(wo_alcc))")
89 ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
90 AMULECMD
= --enable-amulecmd
93 ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
94 AMULE
= --disable-monolithic
97 ifneq ("ed2k", "$(findstring ed2k, $(flags))")
101 ifneq ("xas", "$(findstring xas, $(flags))")
105 #Now find out if a Metapackage should be build
106 ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
108 REMOTEGUI
= --enable-amule-gui
109 WXCAS
= --enable-wxcas
112 ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
114 AMULECMD
= --enable-amulecmd
118 #Find this whole i18n stuff
119 ifneq ("i18n-en-only", "$(findstring i18n-en-only, $(flags))")
121 ifeq ("i18n-ar", "$(findstring i18n-ar, $(flags))")
122 LANGUAGE
:= $(LANGUAGE
),ar
125 ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
126 LANGUAGE
:= $(LANGUAGE
),bg
129 ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
130 LANGUAGE
:= $(LANGUAGE
),ca
133 ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
134 LANGUAGE
:= $(LANGUAGE
),da
137 ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
138 LANGUAGE
:= $(LANGUAGE
),de
141 ifeq ("i18n-es", "$(findstring i18n-es, $(flags))")
142 LANGUAGE
:= $(LANGUAGE
),es
145 ifeq ("i18n-et-ee", "$(findstring i18n-et-ee, $(flags))")
146 LANGUAGE
:= $(LANGUAGE
),et_EE
149 ifeq ("i18n-eu", "$(findstring i18n-eu, $(flags))")
150 LANGUAGE
:= $(LANGUAGE
),eu
153 ifeq ("i18n-fi", "$(findstring i18n-fi, $(flags))")
154 LANGUAGE
:= $(LANGUAGE
),fi
157 ifeq ("i18n-fr", "$(findstring i18n-fr, $(flags))")
158 LANGUAGE
:= $(LANGUAGE
),fr
161 ifeq ("i18n-gl", "$(findstring i18n-gl, $(flags))")
162 LANGUAGE
:= $(LANGUAGE
),gl
165 ifeq ("i18n-hr", "$(findstring i18n-hr, $(flags))")
166 LANGUAGE
:= $(LANGUAGE
),hr
169 ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
170 LANGUAGE
:= $(LANGUAGE
),hu
173 ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
174 LANGUAGE
:= $(LANGUAGE
),it
177 ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
178 LANGUAGE
:= $(LANGUAGE
),it_CH
181 ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
182 LANGUAGE
:= $(LANGUAGE
),ko_KR
185 ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
186 LANGUAGE
:= $(LANGUAGE
),lt
189 ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
190 LANGUAGE
:= $(LANGUAGE
),hl
193 ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
194 LANGUAGE
:= $(LANGUAGE
),nn
197 ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
198 LANGUAGE
:= $(LANGUAGE
),pl
201 ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
202 LANGUAGE
:= $(LANGUAGE
),pt_BR
205 ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
206 LANGUAGE
:= $(LANGUAGE
),pt_PT
209 ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
210 LANGUAGE
:= $(LANGUAGE
),ru
213 ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
214 LANGUAGE
:= $(LANGUAGE
),sl
217 ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
218 LANGUAGE
:= $(LANGUAGE
),sv
221 ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
222 LANGUAGE
:= $(LANGUAGE
),tr
225 ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
226 LANGUAGE
:= $(LANGUAGE
),zh_CN
229 ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
230 LANGUAGE
:= $(LANGUAGE
),zh_TW
233 ifeq ($(LANGUAGE
),en_GB
)
239 LANGFLAG
= --with-language
=$(LANGUAGE
)
241 #And at Last, find out if we compile a debug-package or not.
242 ifeq ("dbg", "$(findstring dbg, $(flags))")
243 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
245 DEBUGGING
= --disable-debug
--enable-optimize
--disable-profile
249 #Before we start, I want to introduce two sequences for building the packages
250 #I define two, so I can put the commands for the *-dbg packages between them
252 dh_testdir
-p
$(subst -stage1
,,$@
)
253 dh_testroot
-p
$(subst -stage1
,,$@
)
254 dh_installdirs
-p
$(subst -stage1
,,$@
)
255 dh_installchangelogs docs
/Changelog
-p
$(subst -stage1
,,$@
)
256 dh_installdocs
-p
$(subst -stage1
,,$@
)
257 dh_install
-Xlicense.txt
-p
$(subst -stage1
,,$@
)
258 dh_installmenu
-p
$(subst -stage1
,,$@
)
259 dh_installdebconf
-p
$(subst -stage1
,,$@
)
260 dh_installman
-p
$(subst -stage1
,,$@
)
261 dh_link
-p
$(subst -stage1
,,$@
)
262 if
test -e debian
/$(subst -stage1
,,$@
).
override; then \
263 install --mode
=644 debian
/$(subst -stage1
,,$@
).
override debian
/$(subst -stage1
,,$@
)/usr
/share
/lintian
/overrides
/$(subst -stage1
,,$@
); \
269 dh_strip
-p
$(subst -dbg
,,$@
) --dbg-package
=$@
273 dh_compress
-X.pl
-p
$(subst -stage2
,,$@
)
274 dh_perl
-p
$(subst -stage2
,,$@
)
275 dh_makeshlibs
-p
$(subst -stage2
,,$@
)
276 dh_installdeb
-p
$(subst -stage2
,,$@
)
277 dh_shlibdeps
-p
$(subst -stage2
,,$@
)
278 dh_gencontrol
-p
$(subst -stage2
,,$@
)
279 dh_md5sums
-p
$(subst -stage2
,,$@
)
280 dh_fixperms
-p
$(subst -stage2
,,$@
)
281 dh_builddeb
-p
$(subst -stage2
,,$@
)
285 #Now we configure this whole thing
286 config.status
: configure
288 CFLAGS
="$(CFLAGS)" dh_auto_configure
-- --host
=$(DEB_HOST_GNU_TYPE
)\
305 #And here is the well known clean target
313 #Some generic targets to check the build process
316 build-stamp
: config.status
323 #Now we install the packages all together to the tmp-dir inside of debian/
330 #Now first build the packages that are compiled and installed on every build
331 amule-common
: install
333 for pkg in
$(general_pkgs
); do \
334 dh_testdir
-p
$$pkg; \
335 dh_testroot
-p
$$pkg; \
336 dh_installdirs
-p
$$pkg; \
337 dh_installchangelogs docs
/Changelog
-p
$$pkg; \
338 dh_installdocs
-p
$$pkg; \
339 dh_install
-Xlicense.txt
-p
$$pkg; \
340 dh_installmenu
-p
$$pkg; \
341 dh_installdebconf
-p
$$pkg; \
342 dh_installman
-p
$$pkg; \
344 if
test -e debian
/$$pkg.overrride
; then \
345 install --mode
=644 debian
/$$pkg.
override debian
/$$pkg/usr
/share
/lintian
/overrides
/$$pkg; \
347 dh_compress
-X.pl
-p
$$pkg; \
349 dh_makeshlibs
-p
$$pkg; \
350 dh_installdeb
-p
$$pkg; \
351 dh_shlibdeps
-p
$$pkg; \
352 dh_gencontrol
-p
$$pkg; \
353 dh_md5sums
-p
$$pkg; \
354 dh_fixperms
-p
$$pkg; \
355 dh_builddeb
-p
$$pkg; \
359 %-stage1
: amule-common
365 amule-
%-dbg
: amule-
%-stage1
370 amule-dbg
: amule-stage1
375 amuleweb-dbg
: amuleweb-stage1
380 #Now just the targets to map the Commandline Name to the package names
384 ed2k
: amule-ed2k-stage2
387 cas
: amule-cas-stage2
390 wxcas
: amule-wxcas-stage2
393 webserver
: amuleweb-stage2 amule-theme-default-stage2
396 remotegui
: amule-remote-gui-stage2
399 daemon
: amule-daemon-stage2
402 alc
: amule-alc-stage2
405 alcc
: amule-alcc-stage2
408 amulecmd
: amule-cmd-stage2
411 xas
: amule-xas-stage2
414 ed2k-dbg
: amule-ed2k-dbg
417 cas-dbg
: amule-cas-dbg
420 wxcas-dbg
: amule-wxcas-dbg
423 webserver-dbg
: amuleweb-dbg
426 remotegui-dbg
: amule-remote-gui-dbg
429 daemon-dbg
: amule-daemon-dbg
432 alc-dbg
: amule-alc-dbg
435 alcc-dbg
: amule-alcc-dbg
438 amulecmd-dbg
: amule-cmd-dbg
441 #Here come the Targets for the langauge packages
442 i18n-
%: amule-i18n-
% ;
444 amule-i18n-
%: amule-common
448 #They are just metapackages
449 amule-utils
: alcc amulecmd cas
453 amule-utils-gui
: alc remotegui wxcas
457 #These are empty (Space after Semicolon)
458 debug-packages
: amule-dbg ed2k-dbg cas-dbg wxcas-dbg webserver-dbg remotegui-dbg daemon-dbg alc-dbg alcc-dbg amulecmd-dbg
;
459 normal-packages
: amule-utils amule-utils-gui amule ed2k webserver daemon xas
;
460 language-packages
: i18n-ar i18n-bg i18n-ca i18n-da i18n-de i18n-en-gb i18n-es i18n-et-ee i18n-eu i18n-fi i18n-fr i18n-gl i18n-hr i18n-hu i18n-it-ch i18n-it i18n-ko-kr i18n-lt i18n-nn i18n-nl i18n-pl i18n-pt-br i18n-pt-pt i18n-ru i18n-sl i18n-sv i18n-tr i18n-zh-cn i18n-zh-tw
;
463 #If we build from a svn checkout, we need to generate configure
467 #Now the targets for dpkg-buildpackage
468 binary-indep
: build
install
470 binary-arch
: debug-packages normal-packages language-packages
472 binary
: binary-indep binary-arch
475 cat README.Debian-Packages
478 .PHONY
: build
clean binary-indep binary-arch binary
install debug-packages normal-packages i18n-only language-packages