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"\
32 # First, get the targets from commandline
33 flags
= ${MAKECMDGOALS}
35 #First we have to find out, if we are called from dpkg-buildpackage
37 ifeq ("binary", "$(findstring binary, $(flags))")
39 WXCAS
= --enable-wxcas
41 WEBSERVER
= --enable-webserver
42 REMOTEGUI
= --enable-amule-gui
43 DAEMON
= --enable-amule-daemon
46 AMULECMD
= --enable-amulecmd
47 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
48 LANGFLAG
= --with-language
=all
50 else ifeq ("clean", "$(findstring clean, $(flags))")
52 WXCAS
= --enable-wxcas
54 WEBSERVER
= --enable-webserver
55 REMOTEGUI
= --enable-amule-gui
56 DAEMON
= --enable-amule-daemon
59 AMULECMD
= --enable-amulecmd
60 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
61 LANGFLAG
= --with-language
=all
63 else ifeq ("build", "$(findstring build, $(flags))")
65 WXCAS
= --enable-wxcas
67 WEBSERVER
= --enable-webserver
68 REMOTEGUI
= --enable-amule-gui
69 DAEMON
= --enable-amule-daemon
72 AMULECMD
= --enable-amulecmd
73 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
74 LANGFLAG
= --with-language
=all
77 #Now we have to check what packages are build to configure only them
79 #We have to filter the right targets (wo_ means without)
80 wo_wxcas
= $(subst wxcas
, , ${flags})
81 wo_alcc
= $(subst alcc
, , ${flags})
82 wo_amule_utils_gui
= $(subst amule-utils-gui
, ,${flags})
83 wo_all_other_amules
= $(subst amulecmd
, ,$(subst amule-utils-gui
, ,$(subst amule-utils
, ,${flags})))
86 ifeq ("wxcas", "$(findstring wxcas, $(flags))")
87 WXCAS
= --enable-wxcas
90 ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
94 ifeq ("webserver", "$(findstring webserver, $(flags))")
95 WEBSERVER
= --enable-webserver
98 ifeq ("remotegui", "$(findstring remotegui, $(flags))")
99 REMOTEGUI
= --enable-amule-gui
102 ifeq ("daemon", "$(findstring daemon, $(flags))")
103 DAEMON
= --enable-amule-daemon
106 ifeq ("alcc", "$(findstring alcc, $(flags))")
110 ifeq ("alc", "$(findstring alc, $(wo_alcc))")
114 ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
115 AMULECMD
= --enable-amulecmd
118 ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
119 AMULE
= --disable-monolithic
122 ifneq ("ed2k", "$(findstring ed2k, $(flags))")
123 ED2K
= --disable-ed2k
126 ifneq ("xas", "$(findstring xas, $(flags))")
130 #Now find out if a Metapackage should be build
131 ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
133 REMOTEGUI
= --enable-amule-gui
134 WXCAS
= --enable-wxcas
137 ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
139 AMULECMD
= --enable-amulecmd
143 #Find this whole i18n stuff
144 ifneq ("i18n-en-only", "$(findstring i18n-en-only, $(flags))")
146 ifeq ("i18n-ar", "$(findstring i18n-ar, $(flags))")
147 LANGUAGE
:= $(LANGUAGE
),ar
150 ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
151 LANGUAGE
:= $(LANGUAGE
),bg
154 ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
155 LANGUAGE
:= $(LANGUAGE
),ca
158 ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
159 LANGUAGE
:= $(LANGUAGE
),da
162 ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
163 LANGUAGE
:= $(LANGUAGE
),de
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-hr", "$(findstring i18n-hr, $(flags))")
191 LANGUAGE
:= $(LANGUAGE
),hr
194 ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
195 LANGUAGE
:= $(LANGUAGE
),hu
198 ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
199 LANGUAGE
:= $(LANGUAGE
),it
202 ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
203 LANGUAGE
:= $(LANGUAGE
),it_CH
206 ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
207 LANGUAGE
:= $(LANGUAGE
),ko_KR
210 ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
211 LANGUAGE
:= $(LANGUAGE
),lt
214 ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
215 LANGUAGE
:= $(LANGUAGE
),hl
218 ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
219 LANGUAGE
:= $(LANGUAGE
),nn
222 ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
223 LANGUAGE
:= $(LANGUAGE
),pl
226 ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
227 LANGUAGE
:= $(LANGUAGE
),pt_BR
230 ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
231 LANGUAGE
:= $(LANGUAGE
),pt_PT
234 ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
235 LANGUAGE
:= $(LANGUAGE
),ru
238 ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
239 LANGUAGE
:= $(LANGUAGE
),sl
242 ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
243 LANGUAGE
:= $(LANGUAGE
),sv
246 ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
247 LANGUAGE
:= $(LANGUAGE
),tr
250 ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
251 LANGUAGE
:= $(LANGUAGE
),zh_CN
254 ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
255 LANGUAGE
:= $(LANGUAGE
),zh_TW
258 ifeq ($(LANGUAGE
),en_GB
)
264 LANGFLAG
= --with-language
=$(LANGUAGE
)
266 #And at Last, find out if we compile a debug-package or not.
267 ifeq ("dbg", "$(findstring dbg, $(flags))")
268 DEBUGGING
= --enable-debug
--disable-optimize
--disable-profile
270 DEBUGGING
= --disable-debug
--enable-optimize
--disable-profile
274 #Before we start, I want to introduce two sequences for building the packages
275 #I define two, so I can put the commands for the *-dbg packages between them
279 dh_installdirs
-p
${pkg}
280 dh_installchangelogs docs
/Changelog
-p
${pkg}
281 dh_installdocs
-p
${pkg}
282 dh_install
-Xlicense.txt
-p
${pkg}
283 dh_installmenu
-p
${pkg}
284 dh_installdebconf
-p
${pkg}
285 dh_installman
-p
${pkg}
287 install -D
--mode
=644 debian
/${pkg}.
override debian
/${pkg}/usr
/share
/lintian
/overrides
/${pkg}
292 dh_compress
-X.pl
-p
${pkg}
294 dh_makeshlibs
-p
${pkg}
295 dh_installdeb
-p
${pkg}
296 dh_shlibdeps
-p
${pkg}
297 dh_gencontrol
-p
${pkg}
304 #Now we configure this whole thing
305 config.status
: configure
307 CFLAGS
="$(CFLAGS)" .
/configure\
308 --host
=$(DEB_HOST_GNU_TYPE
)\
309 --build
=$(DEB_BUILD_GNU_TYPE
)\
311 --mandir=\
$${prefix}/share
/man\
312 --infodir=\
$${prefix}/share
/info\
330 #And here is the well known clean target
341 rm -f amule-alc-stage1
342 rm -f amule-alc-stage2
344 rm -f amule-alcc-stage1
345 rm -f amule-alcc-stage2
347 rm -f amule-cas-stage1
348 rm -f amule-cas-stage2
350 rm -f amule-cmd-stage1
351 rm -f amule-cmd-stage2
353 rm -f amule-daemon-dbg
354 rm -f amule-daemon-stage1
355 rm -f amule-daemon-stage2
358 rm -f amule-ed2k-stage1
359 rm -f amule-ed2k-stage2
360 rm -f amule-remote-gui-dbg
361 rm -f amule-remote-gui-stage1
362 rm -f amule-remote-gui-stage2
366 rm -f amule-utils-gui
367 rm -f amule-wxcas-dbg
368 rm -f amule-wxcas-stage1
369 rm -f amule-wxcas-stage2
372 rm -f amuleweb-stage1
373 rm -f amuleweb-stage2
420 [ ! -f Makefile
] ||
$(MAKE
) distclean
422 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
423 cp
-f
/usr
/share
/misc
/config.sub config.sub
425 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
426 cp
-f
/usr
/share
/misc
/config.guess config.guess
432 #Some generic targets to check the build process
435 build-stamp
: config.status
438 # Add here commands to compile the package.
443 #Now we install the packages all together to the tmp-dir inside of debian/
450 $(MAKE
) install DESTDIR
=$(CURDIR
)/debian
/tmp
452 #Now first build the packages that are compiled and installed on every build
453 amule-common
: install
455 for pkg in
$(general_pkgs
); do \
456 dh_testdir
-p
$$pkg; \
457 dh_testroot
-p
$$pkg; \
458 dh_installdirs
-p
$$pkg; \
459 dh_installchangelogs docs
/Changelog
-p
$$pkg; \
460 dh_installdocs
-p
$$pkg; \
461 dh_install
-Xlicense.txt
-p
$$pkg; \
462 dh_installmenu
-p
$$pkg; \
463 dh_installdebconf
-p
$$pkg; \
464 dh_installman
-p
$$pkg; \
466 install -D
--mode
=644 debian
/$$pkg.
override debian
/$$pkg/usr
/share
/lintian
/overrides
/$$pkg; \
467 dh_compress
-X.pl
-p
$$pkg; \
469 dh_makeshlibs
-p
$$pkg; \
470 dh_installdeb
-p
$$pkg; \
471 dh_shlibdeps
-p
$$pkg; \
472 dh_gencontrol
-p
$$pkg; \
473 dh_md5sums
-p
$$pkg; \
474 dh_fixperms
-p
$$pkg; \
475 dh_builddeb
-p
$$pkg; \
479 amule-stage1
: pkg
=amule
480 amule-stage1
: amule-common
483 amule-stage2
: pkg
=amule
484 amule-stage2
: amule-stage1
487 amule-ed2k-stage1
: pkg
=amule-ed2k
488 amule-ed2k-stage1
: amule-common
491 amule-ed2k-stage2
: pkg
=amule-ed2k
492 amule-ed2k-stage2
: amule-ed2k-stage1
495 amule-xas-stage1
: pkg
=amule-xas
496 amule-xas-stage1
: amule-common
499 amule-xas-stage2
: pkg
=amule-xas
500 amule-xas-stage2
: amule-xas-stage1
503 amule-cas-stage1
: pkg
=amule-cas
504 amule-cas-stage1
: amule-common
507 amule-cas-stage2
: pkg
=amule-cas
508 amule-cas-stage2
: amule-cas-stage1
511 amule-wxcas-stage1
: pkg
=amule-wxcas
512 amule-wxcas-stage1
: amule-common
515 amule-wxcas-stage2
: pkg
=amule-wxcas
516 amule-wxcas-stage2
: amule-wxcas-stage1
519 amuleweb-stage1
: pkg
=amuleweb
520 amuleweb-stage1
: amule-common
523 amuleweb-stage2
: pkg
=amuleweb
524 amuleweb-stage2
: amuleweb-stage1
527 amule-remote-gui-stage1
: pkg
=amule-remote-gui
528 amule-remote-gui-stage1
: amule-common
531 amule-remote-gui-stage2
: pkg
=amule-remote-gui
532 amule-remote-gui-stage2
: amule-remote-gui-stage1
535 amule-daemon-stage1
: pkg
=amule-daemon
536 amule-daemon-stage1
: amule-common
539 amule-daemon-stage2
: pkg
=amule-daemon
540 amule-daemon-stage2
: amule-daemon-stage1
543 amule-alc-stage1
: pkg
=amule-alc
544 amule-alc-stage1
: amule-common
547 amule-alc-stage2
: pkg
=amule-alc
548 amule-alc-stage2
: amule-alc-stage1
551 amule-alcc-stage1
: pkg
=amule-alcc
552 amule-alcc-stage1
: amule-common
555 amule-alcc-stage2
: pkg
=amule-alcc
556 amule-alcc-stage2
: amule-alcc-stage1
559 amule-cmd-stage1
: pkg
=amule-cmd
560 amule-cmd-stage1
: amule-common
563 amule-cmd-stage2
: pkg
=amule-cmd
564 amule-cmd-stage2
: amule-alcc-stage1
568 amule-ed2k-dbg
: pkg
=amule-ed2k-dbg
569 amule-ed2k-dbg
: amule-ed2k-stage1
571 dh_strip
-pamule-ed2k
--dbg-package
=amule-ed2k-dbg
574 amule-cas-dbg
: pkg
=amule-cas-dbg
575 amule-cas-dbg
: amule-cas-stage1
577 dh_strip
-pamule-cas
--dbg-package
=amule-cas-dbg
580 amule-wxcas-dbg
: pkg
=amule-wxcas-dbg
581 amule-wxcas-dbg
: amule-wxcas-stage1
583 dh_strip
-pamule-wxcas
--dbg-package
=amule-wxcas-dbg
586 amuleweb-dbg
: pkg
=amuleweb-dbg
587 amuleweb-dbg
: amuleweb-stage1
589 dh_strip
-pamuleweb
--dbg-package
=amuleweb-dbg
592 amule-remote-gui-dbg
: pkg
=amule-remote-gui-dbg
593 amule-remote-gui-dbg
: amule-remote-gui-stage1
595 dh_strip
-pamule-remote-gui
--dbg-package
=amule-remote-gui-dbg
598 amule-daemon-dbg
: pkg
=amule-daemon-dbg
599 amule-daemon-dbg
: amule-daemon-stage1
601 dh_strip
-pamule-daemon
--dbg-package
=amule-daemon-dbg
604 amule-alc-dbg
: pkg
=amule-alc-dbg
605 amule-alc-dbg
: amule-alc-stage1
607 dh_strip
-pamule-alc
--dbg-package
=amule-alc-dbg
610 amule-alcc-dbg
: pkg
=amule-alcc-dbg
611 amule-alcc-dbg
: amule-alcc-stage1
613 dh_strip
-pamule-alcc
--dbg-package
=amule-alcc-dbg
616 amule-cmd-dbg
: pkg
=amule-cmd-dbg
617 amule-cmd-dbg
: amule-cmd-stage1
619 dh_strip
-pamule-cmd
--dbg-package
=amule-cmd-dbg
622 #Now just the targets to map the Commandline Name to the package names
626 ed2k
: amule-ed2k-stage2
629 cas
: amule-cas-stage2
632 wxcas
: amule-wxcas-stage2
635 webserver
: amuleweb-stage2
638 remotegui
: amule-remote-gui-stage2
641 daemon
: amule-daemon-stage2
644 alc
: amule-alc-stage2
647 alcc
: amule-alcc-stage2
650 amulecmd
: amule-cmd-stage2
653 xas
: amule-xas-stage2
656 ed2k-dbg
: amule-ed2k-dbg
659 cas-dbg
: amule-cas-dbg
662 wxcas-dbg
: amule-wxcas-dbg
665 webserver-dbg
: amuleweb-dbg
668 remotegui-dbg
: amule-remote-gui-dbg
671 daemon-dbg
: amule-daemon-dbg
674 alc-dbg
: amule-alc-dbg
677 alcc-dbg
: amule-alcc-dbg
680 amulecmd-dbg
: amule-cmd-dbg
683 amule-dbg
: pkg
=amule-dbg
684 amule-dbg
: amule-stage1
686 dh_strip
-pamule
--dbg-package
=amule-dbg
689 #Her come the Targets for the langauge packages
690 i18n-ar
: pkg
=amule-i18n-ar
691 i18n-ar
: amule-common
695 i18n-bg
: pkg
=amule-i18n-bg
696 i18n-bg
: amule-common
700 i18n-ca
: pkg
=amule-i18n-ca
701 i18n-ca
: amule-common
705 i18n-da
: pkg
=amule-i18n-da
706 i18n-da
: amule-common
710 i18n-de
: pkg
=amule-i18n-de
711 i18n-de
: amule-common
715 i18n-en-gb
: pkg
=amule-i18n-en-gb
716 i18n-en-gb
: amule-common
720 i18n-es
: pkg
=amule-i18n-es
721 i18n-es
: amule-common
725 i18n-et-ee
: pkg
=amule-i18n-et-ee
726 i18n-et-ee
: amule-common
730 i18n-eu
: pkg
=amule-i18n-eu
731 i18n-eu
: amule-common
735 i18n-fi
: pkg
=amule-i18n-fi
736 i18n-fi
: amule-common
740 i18n-fr
: pkg
=amule-i18n-fr
741 i18n-fr
: amule-common
745 i18n-gl
: pkg
=amule-i18n-gl
746 i18n-gl
: amule-common
750 i18n-hr
: pkg
=amule-i18n-hr
751 i18n-hr
: amule-common
755 i18n-hu
: pkg
=amule-i18n-hu
756 i18n-hu
: amule-common
760 i18n-it-ch
: pkg
=amule-i18n-it-ch
761 i18n-it-ch
: amule-common
765 i18n-it
: pkg
=amule-i18n-it
766 i18n-it
: amule-common
770 i18n-ko-kr
: pkg
=amule-i18n-ko-kr
771 i18n-ko-kr
: amule-common
775 i18n-lt
: pkg
=amule-i18n-lt
776 i18n-lt
: amule-common
780 i18n-nn
: pkg
=amule-i18n-nn
781 i18n-nn
: amule-common
785 i18n-nl
: pkg
=amule-i18n-nl
786 i18n-nl
: amule-common
790 i18n-pl
: pkg
=amule-i18n-pl
791 i18n-pl
: amule-common
795 i18n-pt-br
: pkg
=amule-i18n-pt-br
796 i18n-pt-br
: amule-common
800 i18n-pt-pt
: pkg
=amule-i18n-pt-pt
801 i18n-pt-pt
: amule-common
805 i18n-ru
: pkg
=amule-i18n-ru
806 i18n-ru
: amule-common
810 i18n-sl
: pkg
=amule-i18n-sl
811 i18n-sl
: amule-common
815 i18n-sv
: pkg
=amule-i18n-sv
816 i18n-sv
: amule-common
820 i18n-tr
: pkg
=amule-i18n-tr
821 i18n-tr
: amule-common
825 i18n-zh-cn
: pkg
=amule-i18n-zh-cn
826 i18n-zh-cn
: amule-common
830 i18n-zh-tw
: pkg
=amule-i18n-zh-tw
831 i18n-zh-tw
: amule-common
835 #They are just metapackages
836 amule-utils
: pkg
=amule-utils
837 amule-utils
: alcc amulecmd cas
841 amule-utils-gui
: pkg
=amule-utils-gui
842 amule-utils-gui
: alc remotegui wxcas
846 #These Two are empty (Space after Semicolon)
847 debug-packages
: amule-dbg ed2k-dbg cas-dbg wxcas-dbg webserver-dbg remotegui-dbg daemon-dbg alc-dbg alcc-dbg amulecmd-dbg
;
848 normal-packages
: amule-utils amule-utils-gui amule ed2k webserver daemon
;
850 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
;
854 #If we build from a svn checkout, we need to generate configure
858 #Now the targets for dpkg-buildpackage
859 binary-indep
: build
install
861 binary-arch
: debug-packages normal-packages language-packages
863 binary
: binary-indep binary-arch
866 cat README.Debian-Packages
869 .PHONY
: build
clean binary-indep binary-arch binary
install debug-packages normal-packages amule-utils-gui amule-utils i18n-only language-packages