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
)
12 DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
16 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
22 #Here are the packages that can't be compiled separate now
23 general_pkgs
= "amule-common"\
28 "amule-theme-default"\
29 "amule-theme-php-default"\
30 "amule-theme-chicane"\
33 # First, get the targets from commandline
34 flags
= ${MAKECMDGOALS}
36 #First we have to find out, if we are called from dpkg-buildpackage
38 ifeq ("binary", "$(findstring binary, $(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
51 else ifeq ("clean", "$(findstring clean, $(flags))")
53 WXCAS
= --enable-wxcas
55 WEBSERVER
= --enable-webserver
56 REMOTEGUI
= --enable-amule-gui
57 DAEMON
= --enable-amule-daemon
60 AMULECMD
= --enable-amulecmd
61 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
62 LANGFLAG
= --with-language
=all
64 else ifeq ("build", "$(findstring build, $(flags))")
66 WXCAS
= --enable-wxcas
68 WEBSERVER
= --enable-webserver
69 REMOTEGUI
= --enable-amule-gui
70 DAEMON
= --enable-amule-daemon
73 AMULECMD
= --enable-amulecmd
74 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
75 LANGFLAG
= --with-language
=all
78 #Now we have to check what packages are build to configure only them
80 #We have to filter the right targets (wo_ means without)
81 wo_wxcas
= $(subst wxcas
, , ${flags})
82 wo_alcc
= $(subst alcc
, , ${flags})
83 wo_amule_utils_gui
= $(subst amule-utils-gui
, ,${flags})
84 wo_all_other_amules
= $(subst amulecmd
, ,$(subst amule-utils-gui
, ,$(subst amule-utils
, ,${flags})))
87 ifeq ("wxcas", "$(findstring wxcas, $(flags))")
88 WXCAS
= --enable-wxcas
91 ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
95 ifeq ("webserver", "$(findstring webserver, $(flags))")
96 WEBSERVER
= --enable-webserver
99 ifeq ("remotegui", "$(findstring remotegui, $(flags))")
100 REMOTEGUI
= --enable-amule-gui
103 ifeq ("daemon", "$(findstring daemon, $(flags))")
104 DAEMON
= --enable-amule-daemon
107 ifeq ("alcc", "$(findstring alcc, $(flags))")
111 ifeq ("alc", "$(findstring alc, $(wo_alcc))")
115 ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
116 AMULECMD
= --enable-amulecmd
119 ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
120 AMULE
= --disable-monolithic
123 ifneq ("ed2k", "$(findstring ed2k, $(flags))")
124 ED2K
= --disable-ed2k
127 #Now find out if a Metapackage should be build
128 ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
130 REMOTEGUI
= --enable-amule-gui
131 WXCAS
= --enable-wxcas
134 ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
136 AMULECMD
= --enable-amulecmd
140 #Find this whole i18n stuff
141 ifneq ("i18n-en-only", "$(findstring i18n-en-only, $(flags))")
143 ifeq ("i18n-ar", "$(findstring i18n-ar, $(flags))")
144 LANGUAGE
:= $(LANGUAGE
),ar
147 ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
148 LANGUAGE
:= $(LANGUAGE
),bg
151 ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
152 LANGUAGE
:= $(LANGUAGE
),ca
155 ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
156 LANGUAGE
:= $(LANGUAGE
),da
159 ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
160 LANGUAGE
:= $(LANGUAGE
),de
163 ifeq ("i18n-es", "$(findstring i18n-es, $(flags))")
164 LANGUAGE
:= $(LANGUAGE
),es
167 ifeq ("i18n-et-ee", "$(findstring i18n-et-ee, $(flags))")
168 LANGUAGE
:= $(LANGUAGE
),et_EE
171 ifeq ("i18n-eu", "$(findstring i18n-eu, $(flags))")
172 LANGUAGE
:= $(LANGUAGE
),eu
175 ifeq ("i18n-fi", "$(findstring i18n-fi, $(flags))")
176 LANGUAGE
:= $(LANGUAGE
),fi
179 ifeq ("i18n-fr", "$(findstring i18n-fr, $(flags))")
180 LANGUAGE
:= $(LANGUAGE
),fr
183 ifeq ("i18n-gl", "$(findstring i18n-gl, $(flags))")
184 LANGUAGE
:= $(LANGUAGE
),gl
187 ifeq ("i18n-hr", "$(findstring i18n-hr, $(flags))")
188 LANGUAGE
:= $(LANGUAGE
),hr
191 ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
192 LANGUAGE
:= $(LANGUAGE
),hu
195 ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
196 LANGUAGE
:= $(LANGUAGE
),it
199 ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
200 LANGUAGE
:= $(LANGUAGE
),it_CH
203 ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
204 LANGUAGE
:= $(LANGUAGE
),ko_KR
207 ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
208 LANGUAGE
:= $(LANGUAGE
),lt
211 ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
212 LANGUAGE
:= $(LANGUAGE
),hl
215 ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
216 LANGUAGE
:= $(LANGUAGE
),nn
219 ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
220 LANGUAGE
:= $(LANGUAGE
),pl
223 ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
224 LANGUAGE
:= $(LANGUAGE
),pt_BR
227 ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
228 LANGUAGE
:= $(LANGUAGE
),pt_PT
231 ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
232 LANGUAGE
:= $(LANGUAGE
),ru
235 ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
236 LANGUAGE
:= $(LANGUAGE
),sl
239 ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
240 LANGUAGE
:= $(LANGUAGE
),sv
243 ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
244 LANGUAGE
:= $(LANGUAGE
),tr
247 ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
248 LANGUAGE
:= $(LANGUAGE
),zh_CN
251 ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
252 LANGUAGE
:= $(LANGUAGE
),zh_TW
255 ifeq ($(LANGUAGE
),en_GB
)
261 LANGFLAG
= --with-language
=$(LANGUAGE
)
263 #And at Last, find out if we compile a debug-package or not.
264 ifeq ("dbg", "$(findstring dbg, $(flags))")
265 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
267 DEBUGGING
= --disable-debug
--enable-optimize
--disable-profile
271 #Before we start, I want to introduce two sequences for building the packages
272 #I define two, so I can put the commands for the *-dbg packages between them
276 dh_installdirs
-p
${pkg}
277 dh_installchangelogs docs
/Changelog
-p
${pkg}
278 dh_installdocs
-p
${pkg}
279 dh_install
-Xlicense.txt
-p
${pkg}
280 dh_installmenu
-p
${pkg}
281 dh_installdebconf
-p
${pkg}
282 dh_installman
-p
${pkg}
284 install -D
--mode
=644 debian
/${pkg}.
override debian
/${pkg}/usr
/share
/lintian
/overrides
/${pkg}
289 dh_compress
-X.pl
-p
${pkg}
291 dh_makeshlibs
-p
${pkg}
292 dh_installdeb
-p
${pkg}
293 dh_shlibdeps
-p
${pkg}
294 dh_gencontrol
-p
${pkg}
301 #Now we configure this whole thing
302 config.status
: configure
304 CFLAGS
="$(CFLAGS)" .
/configure\
305 --host
=$(DEB_HOST_GNU_TYPE
)\
306 --build
=$(DEB_BUILD_GNU_TYPE
)\
308 --mandir=\
$${prefix}/share
/man\
309 --infodir=\
$${prefix}/share
/info\
312 --enable-utf8-systray\
314 --disable-embedded-crypto\
329 #And here is the well known clean target
339 rm -f amule-alc-stage1
340 rm -f amule-alc-stage2
342 rm -f amule-alcc-stage1
343 rm -f amule-alcc-stage2
345 rm -f amule-cas-stage1
346 rm -f amule-cas-stage2
348 rm -f amule-cmd-stage1
349 rm -f amule-cmd-stage2
351 rm -f amule-daemon-dbg
352 rm -f amule-daemon-stage1
353 rm -f amule-daemon-stage2
356 rm -f amule-ed2k-stage1
357 rm -f amule-ed2k-stage2
358 rm -f amule-remote-gui-dbg
359 rm -f amule-remote-gui-stage1
360 rm -f amule-remote-gui-stage2
364 rm -f amule-utils-gui
365 rm -f amule-wxcas-dbg
366 rm -f amule-wxcas-stage1
367 rm -f amule-wxcas-stage2
370 rm -f amuleweb-stage1
371 rm -f amuleweb-stage2
417 [ ! -f Makefile
] ||
$(MAKE
) distclean
419 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
420 cp
-f
/usr
/share
/misc
/config.sub config.sub
422 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
423 cp
-f
/usr
/share
/misc
/config.guess config.guess
429 #Some generic targets to check the build process
432 build-stamp
: config.status
435 # Add here commands to compile the package.
440 #Now we install the packages all together to the tmp-dir inside of debian/
447 $(MAKE
) install DESTDIR
=$(CURDIR
)/debian
/tmp
449 #Now first build the packages that are compiled and installed on every build
450 amule-common
: install
452 for pkg in
$(general_pkgs
); do \
453 dh_testdir
-p
$$pkg; \
454 dh_testroot
-p
$$pkg; \
455 dh_installdirs
-p
$$pkg; \
456 dh_installchangelogs docs
/Changelog
-p
$$pkg; \
457 dh_installdocs
-p
$$pkg; \
458 dh_install
-Xlicense.txt
-p
$$pkg; \
459 dh_installmenu
-p
$$pkg; \
460 dh_installdebconf
-p
$$pkg; \
461 dh_installman
-p
$$pkg; \
463 install -D
--mode
=644 debian
/$$pkg.
override debian
/$$pkg/usr
/share
/lintian
/overrides
/$$pkg; \
464 dh_compress
-X.pl
-p
$$pkg; \
466 dh_makeshlibs
-p
$$pkg; \
467 dh_installdeb
-p
$$pkg; \
468 dh_shlibdeps
-p
$$pkg; \
469 dh_gencontrol
-p
$$pkg; \
470 dh_md5sums
-p
$$pkg; \
471 dh_fixperms
-p
$$pkg; \
472 dh_builddeb
-p
$$pkg; \
476 amule-stage1
: pkg
=amule
477 amule-stage1
: amule-common
480 amule-stage2
: pkg
=amule
481 amule-stage2
: amule-stage1
484 amule-ed2k-stage1
: pkg
=amule-ed2k
485 amule-ed2k-stage1
: amule-common
488 amule-ed2k-stage2
: pkg
=amule-ed2k
489 amule-ed2k-stage2
: amule-ed2k-stage1
492 amule-cas-stage1
: pkg
=amule-cas
493 amule-cas-stage1
: amule-common
496 amule-cas-stage2
: pkg
=amule-cas
497 amule-cas-stage2
: amule-cas-stage1
500 amule-wxcas-stage1
: pkg
=amule-wxcas
501 amule-wxcas-stage1
: amule-common
504 amule-wxcas-stage2
: pkg
=amule-wxcas
505 amule-wxcas-stage2
: amule-wxcas-stage1
508 amuleweb-stage1
: pkg
=amuleweb
509 amuleweb-stage1
: amule-common
512 amuleweb-stage2
: pkg
=amuleweb
513 amuleweb-stage2
: amuleweb-stage1
516 amule-remote-gui-stage1
: pkg
=amule-remote-gui
517 amule-remote-gui-stage1
: amule-common
520 amule-remote-gui-stage2
: pkg
=amule-remote-gui
521 amule-remote-gui-stage2
: amule-remote-gui-stage1
524 amule-daemon-stage1
: pkg
=amule-daemon
525 amule-daemon-stage1
: amule-common
528 amule-daemon-stage2
: pkg
=amule-daemon
529 amule-daemon-stage2
: amule-daemon-stage1
532 amule-alc-stage1
: pkg
=amule-alc
533 amule-alc-stage1
: amule-common
536 amule-alc-stage2
: pkg
=amule-alc
537 amule-alc-stage2
: amule-alc-stage1
540 amule-alcc-stage1
: pkg
=amule-alcc
541 amule-alcc-stage1
: amule-common
544 amule-alcc-stage2
: pkg
=amule-alcc
545 amule-alcc-stage2
: amule-alcc-stage1
548 amule-cmd-stage1
: pkg
=amule-cmd
549 amule-cmd-stage1
: amule-common
552 amule-cmd-stage2
: pkg
=amule-cmd
553 amule-cmd-stage2
: amule-alcc-stage1
557 amule-ed2k-dbg
: pkg
=amule-ed2k-dbg
558 amule-ed2k-dbg
: amule-ed2k-stage1
560 dh_strip
-pamule-ed2k
--dbg-package
=amule-ed2k-dbg
563 amule-cas-dbg
: pkg
=amule-cas-dbg
564 amule-cas-dbg
: amule-cas-stage1
566 dh_strip
-pamule-cas
--dbg-package
=amule-cas-dbg
569 amule-wxcas-dbg
: pkg
=amule-wxcas-dbg
570 amule-wxcas-dbg
: amule-wxcas-stage1
572 dh_strip
-pamule-wxcas
--dbg-package
=amule-wxcas-dbg
575 amuleweb-dbg
: pkg
=amuleweb-dbg
576 amuleweb-dbg
: amuleweb-stage1
578 dh_strip
-pamuleweb
--dbg-package
=amuleweb-dbg
581 amule-remote-gui-dbg
: pkg
=amule-remote-gui-dbg
582 amule-remote-gui-dbg
: amule-remote-gui-stage1
584 dh_strip
-pamule-remote-gui
--dbg-package
=amule-remote-gui-dbg
587 amule-daemon-dbg
: pkg
=amule-daemon-dbg
588 amule-daemon-dbg
: amule-daemon-stage1
590 dh_strip
-pamule-daemon
--dbg-package
=amule-daemon-dbg
593 amule-alc-dbg
: pkg
=amule-alc-dbg
594 amule-alc-dbg
: amule-alc-stage1
596 dh_strip
-pamule-alc
--dbg-package
=amule-alc-dbg
599 amule-alcc-dbg
: pkg
=amule-alcc-dbg
600 amule-alcc-dbg
: amule-alcc-stage1
602 dh_strip
-pamule-alcc
--dbg-package
=amule-alcc-dbg
605 amule-cmd-dbg
: pkg
=amule-cmd-dbg
606 amule-cmd-dbg
: amule-cmd-stage1
608 dh_strip
-pamule-cmd
--dbg-package
=amule-cmd-dbg
611 #Now just the targets to map the Commandline Name to the package names
615 ed2k
: amule-ed2k-stage2
618 cas
: amule-cas-stage2
621 wxcas
: amule-wxcas-stage2
624 webserver
: amuleweb-stage2
627 remotegui
: amule-remote-gui-stage2
630 daemon
: amule-daemon-stage2
633 alc
: amule-alc-stage2
636 alcc
: amule-alcc-stage2
639 amulecmd
: amule-cmd-stage2
642 ed2k-dbg
: amule-ed2k-dbg
645 cas-dbg
: amule-cas-dbg
648 wxcas-dbg
: amule-wxcas-dbg
651 webserver-dbg
: amuleweb-dbg
654 remotegui-dbg
: amule-remote-gui-dbg
657 daemon-dbg
: amule-daemon-dbg
660 alc-dbg
: amule-alc-dbg
663 alcc-dbg
: amule-alcc-dbg
666 amulecmd-dbg
: amule-cmd-dbg
669 amule-dbg
: pkg
=amule-dbg
670 amule-dbg
: amule-stage1
672 dh_strip
-pamule
--dbg-package
=amule-dbg
675 #Her come the Targets for the langauge packages
676 i18n-ar
: pkg
=amule-i18n-ar
677 i18n-ar
: amule-common
681 i18n-bg
: pkg
=amule-i18n-bg
682 i18n-bg
: amule-common
686 i18n-ca
: pkg
=amule-i18n-ca
687 i18n-ca
: amule-common
691 i18n-da
: pkg
=amule-i18n-da
692 i18n-da
: amule-common
696 i18n-de
: pkg
=amule-i18n-de
697 i18n-de
: amule-common
701 i18n-en-gb
: pkg
=amule-i18n-en-gb
702 i18n-en-gb
: amule-common
706 i18n-es
: pkg
=amule-i18n-es
707 i18n-es
: amule-common
711 i18n-et-ee
: pkg
=amule-i18n-et-ee
712 i18n-et-ee
: amule-common
716 i18n-eu
: pkg
=amule-i18n-eu
717 i18n-eu
: amule-common
721 i18n-fi
: pkg
=amule-i18n-fi
722 i18n-fi
: amule-common
726 i18n-fr
: pkg
=amule-i18n-fr
727 i18n-fr
: amule-common
731 i18n-gl
: pkg
=amule-i18n-gl
732 i18n-gl
: amule-common
736 i18n-hr
: pkg
=amule-i18n-hr
737 i18n-hr
: amule-common
741 i18n-hu
: pkg
=amule-i18n-hu
742 i18n-hu
: amule-common
746 i18n-it-ch
: pkg
=amule-i18n-it-ch
747 i18n-it-ch
: amule-common
751 i18n-it
: pkg
=amule-i18n-it
752 i18n-it
: amule-common
756 i18n-ko-kr
: pkg
=amule-i18n-ko-kr
757 i18n-ko-kr
: amule-common
761 i18n-lt
: pkg
=amule-i18n-lt
762 i18n-lt
: amule-common
766 i18n-nn
: pkg
=amule-i18n-nn
767 i18n-nn
: amule-common
771 i18n-nl
: pkg
=amule-i18n-nl
772 i18n-nl
: amule-common
776 i18n-pl
: pkg
=amule-i18n-pl
777 i18n-pl
: amule-common
781 i18n-pt-br
: pkg
=amule-i18n-pt-br
782 i18n-pt-br
: amule-common
786 i18n-pt-pt
: pkg
=amule-i18n-pt-pt
787 i18n-pt-pt
: amule-common
791 i18n-ru
: pkg
=amule-i18n-ru
792 i18n-ru
: amule-common
796 i18n-sl
: pkg
=amule-i18n-sl
797 i18n-sl
: amule-common
801 i18n-sv
: pkg
=amule-i18n-sv
802 i18n-sv
: amule-common
806 i18n-tr
: pkg
=amule-i18n-tr
807 i18n-tr
: amule-common
811 i18n-zh-cn
: pkg
=amule-i18n-zh-cn
812 i18n-zh-cn
: amule-common
816 i18n-zh-tw
: pkg
=amule-i18n-zh-tw
817 i18n-zh-tw
: amule-common
821 #They are just metapackages
822 amule-utils
: pkg
=amule-utils
823 amule-utils
: alcc amulecmd cas
827 amule-utils-gui
: pkg
=amule-utils-gui
828 amule-utils-gui
: alc remotegui wxcas
832 #These Two are empty (Space after Semicolon)
833 debug-packages
: amule-dbg ed2k-dbg cas-dbg wxcas-dbg webserver-dbg remotegui-dbg daemon-dbg alc-dbg alcc-dbg amulecmd-dbg
;
834 normal-packages
: amule-utils amule-utils-gui amule ed2k webserver daemon
;
836 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
;
840 #Now the targets for dpkg-buildpackage
841 binary-indep
: build
install
843 binary-arch
: debug-packages normal-packages language-packages
845 binary
: binary-indep binary-arch
848 cat README.Debian-Packages
851 .PHONY
: build
clean binary-indep binary-arch binary
install debug-packages normal-packages amule-utils-gui amule-utils i18n-only language-packages