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 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
39 # First, get the targets from commandline
40 flags
= ${MAKECMDGOALS}
42 #First we have to find out, if we are called from dpkg-buildpackage
44 ifeq ("binary", "$(findstring binary, $(flags))")
46 WXCAS
= --enable-wxcas
48 WEBSERVER
= --enable-webserver
49 REMOTEGUI
= --enable-amule-gui
50 DAEMON
= --enable-amule-daemon
53 AMULECMD
= --enable-amulecmd
54 DEBUGGING
= --enable-debug
--disable-optimise
--disable-profile
55 LANGFLAG
= --with-language
=all
57 else ifeq ("clean", "$(findstring clean, $(flags))")
59 WXCAS
= --enable-wxcas
61 WEBSERVER
= --enable-webserver
62 REMOTEGUI
= --enable-amule-gui
63 DAEMON
= --enable-amule-daemon
66 AMULECMD
= --enable-amulecmd
67 DEBUGGING
= --enable-debug
--disable-optimise
--disable-profile
68 LANGFLAG
= --with-language
=all
70 else ifeq ("build", "$(findstring build, $(flags))")
72 WXCAS
= --enable-wxcas
74 WEBSERVER
= --enable-webserver
75 REMOTEGUI
= --enable-amule-gui
76 DAEMON
= --enable-amule-daemon
79 AMULECMD
= --enable-amulecmd
80 DEBUGGING
= --enable-debug
--disable-optimise
--disable-profile
81 LANGFLAG
= --with-language
=all
84 #Now we have to check what packages are build to configure only them
86 #We have to filter the right targets (wo_ means without)
87 wo_wxcas
= $(subst wxcas
, , ${flags})
88 wo_alcc
= $(subst alcc
, , ${flags})
89 wo_amule_utils_gui
= $(subst amule-utils-gui
, ,${flags})
90 wo_all_other_amules
= $(subst amulecmd
, ,$(subst amule-utils-gui
, ,$(subst amule-utils
, ,${flags})))
93 ifeq ("wxcas", "$(findstring wxcas, $(flags))")
94 WXCAS
= --enable-wxcas
97 ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
101 ifeq ("webserver", "$(findstring webserver, $(flags))")
102 WEBSERVER
= --enable-webserver
105 ifeq ("remotegui", "$(findstring remotegui, $(flags))")
106 REMOTEGUI
= --enable-amule-gui
109 ifeq ("daemon", "$(findstring daemon, $(flags))")
110 DAEMON
= --enable-amule-daemon
113 ifeq ("alcc", "$(findstring alcc, $(flags))")
117 ifeq ("alc", "$(findstring alc, $(wo_alcc))")
121 ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
122 AMULECMD
= --enable-amulecmd
125 ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
126 AMULE
= --disable-monolithic
129 ifneq ("ed2k", "$(findstring ed2k, $(flags))")
130 ED2K
= --disable-ed2k
133 #Now find out if a Metapackage should be build
134 ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
136 REMOTEGUI
= --enable-amule-gui
137 WXCAS
= --enable-wxcas
140 ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
142 AMULECMD
= --enable-amulecmd
146 #Find this whole i18n stuff
147 ifneq ("i18n-en-only", "$(findstring i18n-en-only, $(flags))")
149 ifeq ("i18n-ar", "$(findstring i18n-ar, $(flags))")
150 LANGUAGE
:= $(LANGUAGE
),ar
153 ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
154 LANGUAGE
:= $(LANGUAGE
),bg
157 ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
158 LANGUAGE
:= $(LANGUAGE
),ca
161 ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
162 LANGUAGE
:= $(LANGUAGE
),da
165 ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
166 LANGUAGE
:= $(LANGUAGE
),de
169 ifeq ("i18n-es", "$(findstring i18n-es, $(flags))")
170 LANGUAGE
:= $(LANGUAGE
),es
173 ifeq ("i18n-et-ee", "$(findstring i18n-et-ee, $(flags))")
174 LANGUAGE
:= $(LANGUAGE
),et_EE
177 ifeq ("i18n-eu", "$(findstring i18n-eu, $(flags))")
178 LANGUAGE
:= $(LANGUAGE
),eu
181 ifeq ("i18n-fi", "$(findstring i18n-fi, $(flags))")
182 LANGUAGE
:= $(LANGUAGE
),fi
185 ifeq ("i18n-fr", "$(findstring i18n-fr, $(flags))")
186 LANGUAGE
:= $(LANGUAGE
),fr
189 ifeq ("i18n-gl", "$(findstring i18n-gl, $(flags))")
190 LANGUAGE
:= $(LANGUAGE
),gl
193 ifeq ("i18n-hr", "$(findstring i18n-hr, $(flags))")
194 LANGUAGE
:= $(LANGUAGE
),hr
197 ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
198 LANGUAGE
:= $(LANGUAGE
),hu
201 ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
202 LANGUAGE
:= $(LANGUAGE
),it
205 ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
206 LANGUAGE
:= $(LANGUAGE
),it_CH
209 ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
210 LANGUAGE
:= $(LANGUAGE
),ko_KR
213 ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
214 LANGUAGE
:= $(LANGUAGE
),lt
217 ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
218 LANGUAGE
:= $(LANGUAGE
),hl
221 ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
222 LANGUAGE
:= $(LANGUAGE
),nn
225 ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
226 LANGUAGE
:= $(LANGUAGE
),pl
229 ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
230 LANGUAGE
:= $(LANGUAGE
),pt_BR
233 ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
234 LANGUAGE
:= $(LANGUAGE
),pt_PT
237 ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
238 LANGUAGE
:= $(LANGUAGE
),ru
241 ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
242 LANGUAGE
:= $(LANGUAGE
),sl
245 ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
246 LANGUAGE
:= $(LANGUAGE
),sv
249 ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
250 LANGUAGE
:= $(LANGUAGE
),tr
253 ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
254 LANGUAGE
:= $(LANGUAGE
),zh_CN
257 ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
258 LANGUAGE
:= $(LANGUAGE
),zh_TW
261 ifeq ($(LANGUAGE
),en_GB
)
267 LANGFLAG
= --with-language
=$(LANGUAGE
)
269 #And at Last, find out if we compile a debug-package or not.
270 ifeq ("dbg", "$(findstring dbg, $(flags))")
271 DEBUGGING
= --enable-debug
--disable-optimise
--disable-profile
273 DEBUGGING
= --disable-debug
--enable-optimize
--enable-profile
277 #Before we start, I want to introduce two sequences for building the packages
278 #I define two, so I can put the commands for the *-dbg packages between them
282 dh_installdirs
-p
${pkg}
283 dh_installchangelogs docs
/Changelog
-p
${pkg}
284 dh_installdocs
-p
${pkg}
285 dh_install
-Xlicense.txt
-p
${pkg}
286 dh_installmenu
-p
${pkg}
287 dh_installdebconf
-p
${pkg}
288 dh_installman
-p
${pkg}
290 install -D
--mode
=644 debian
/${pkg}.
override debian
/${pkg}/usr
/share
/lintian
/overrides
/${pkg}
295 dh_compress
-X.pl
-p
${pkg}
297 dh_makeshlibs
-p
${pkg}
298 dh_installdeb
-p
${pkg}
299 dh_shlibdeps
-p
${pkg}
300 dh_gencontrol
-p
${pkg}
307 #Now we configure this whole thing
308 config.status
: configure
310 CFLAGS
="$(CFLAGS)" .
/configure\
311 --host
=$(DEB_HOST_GNU_TYPE
)\
312 --build
=$(DEB_BUILD_GNU_TYPE
)\
314 --mandir=\
$${prefix}/share
/man\
315 --infodir=\
$${prefix}/share
/info\
318 --enable-utf8-systray\
320 --disable-embedded-crypto\
335 #And here is the well known clean target
345 rm -f amule-alc-stage1
346 rm -f amule-alc-stage2
348 rm -f amule-alcc-stage1
349 rm -f amule-alcc-stage2
351 rm -f amule-cas-stage1
352 rm -f amule-cas-stage2
354 rm -f amule-cmd-stage1
355 rm -f amule-cmd-stage2
357 rm -f amule-daemon-dbg
358 rm -f amule-daemon-stage1
359 rm -f amule-daemon-stage2
362 rm -f amule-ed2k-stage1
363 rm -f amule-ed2k-stage2
364 rm -f amule-remote-gui-dbg
365 rm -f amule-remote-gui-stage1
366 rm -f amule-remote-gui-stage2
370 rm -f amule-utils-gui
371 rm -f amule-wxcas-dbg
372 rm -f amule-wxcas-stage1
373 rm -f amule-wxcas-stage2
376 rm -f amuleweb-stage1
377 rm -f amuleweb-stage2
423 [ ! -f Makefile
] ||
$(MAKE
) distclean
425 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
426 cp
-f
/usr
/share
/misc
/config.sub config.sub
428 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
429 cp
-f
/usr
/share
/misc
/config.guess config.guess
435 #Some generic targets to check the build process
438 build-stamp
: config.status
441 # Add here commands to compile the package.
446 #Now we install the packages all together to the tmp-dir inside of debian/
453 $(MAKE
) install DESTDIR
=$(CURDIR
)/debian
/tmp
455 #Now first build the packages that are compiled and installed on every build
456 amule-common
: install
458 for pkg in
$(general_pkgs
); do \
459 dh_testdir
-p
$$pkg; \
460 dh_testroot
-p
$$pkg; \
461 dh_installdirs
-p
$$pkg; \
462 dh_installchangelogs docs
/Changelog
-p
$$pkg; \
463 dh_installdocs
-p
$$pkg; \
464 dh_install
-Xlicense.txt
-p
$$pkg; \
465 dh_installmenu
-p
$$pkg; \
466 dh_installdebconf
-p
$$pkg; \
467 dh_installman
-p
$$pkg; \
469 install -D
--mode
=644 debian
/$$pkg.
override debian
/$$pkg/usr
/share
/lintian
/overrides
/$$pkg; \
470 dh_compress
-X.pl
-p
$$pkg; \
472 dh_makeshlibs
-p
$$pkg; \
473 dh_installdeb
-p
$$pkg; \
474 dh_shlibdeps
-p
$$pkg; \
475 dh_gencontrol
-p
$$pkg; \
476 dh_md5sums
-p
$$pkg; \
477 dh_fixperms
-p
$$pkg; \
478 dh_builddeb
-p
$$pkg; \
482 amule-stage1
: pkg
=amule
483 amule-stage1
: amule-common
486 amule-stage2
: pkg
=amule
487 amule-stage2
: amule-stage1
490 amule-ed2k-stage1
: pkg
=amule-ed2k
491 amule-ed2k-stage1
: amule-common
494 amule-ed2k-stage2
: pkg
=amule-ed2k
495 amule-ed2k-stage2
: amule-ed2k-stage1
498 amule-cas-stage1
: pkg
=amule-cas
499 amule-cas-stage1
: amule-common
502 amule-cas-stage2
: pkg
=amule-cas
503 amule-cas-stage2
: amule-cas-stage1
506 amule-wxcas-stage1
: pkg
=amule-wxcas
507 amule-wxcas-stage1
: amule-common
510 amule-wxcas-stage2
: pkg
=amule-wxcas
511 amule-wxcas-stage2
: amule-wxcas-stage1
514 amuleweb-stage1
: pkg
=amuleweb
515 amuleweb-stage1
: amule-common
518 amuleweb-stage2
: pkg
=amuleweb
519 amuleweb-stage2
: amuleweb-stage1
522 amule-remote-gui-stage1
: pkg
=amule-remote-gui
523 amule-remote-gui-stage1
: amule-common
526 amule-remote-gui-stage2
: pkg
=amule-remote-gui
527 amule-remote-gui-stage2
: amule-remote-gui-stage1
530 amule-daemon-stage1
: pkg
=amule-daemon
531 amule-daemon-stage1
: amule-common
534 amule-daemon-stage2
: pkg
=amule-daemon
535 amule-daemon-stage2
: amule-daemon-stage1
538 amule-alc-stage1
: pkg
=amule-alc
539 amule-alc-stage1
: amule-common
542 amule-alc-stage2
: pkg
=amule-alc
543 amule-alc-stage2
: amule-alc-stage1
546 amule-alcc-stage1
: pkg
=amule-alcc
547 amule-alcc-stage1
: amule-common
550 amule-alcc-stage2
: pkg
=amule-alcc
551 amule-alcc-stage2
: amule-alcc-stage1
554 amule-cmd-stage1
: pkg
=amule-cmd
555 amule-cmd-stage1
: amule-common
558 amule-cmd-stage2
: pkg
=amule-cmd
559 amule-cmd-stage2
: amule-alcc-stage1
563 amule-ed2k-dbg
: pkg
=amule-ed2k-dbg
564 amule-ed2k-dbg
: amule-ed2k-stage1
566 dh_strip
-pamule-ed2k
--dbg-package
=amule-ed2k-dbg
569 amule-cas-dbg
: pkg
=amule-cas-dbg
570 amule-cas-dbg
: amule-cas-stage1
572 dh_strip
-pamule-cas
--dbg-package
=amule-cas-dbg
575 amule-wxcas-dbg
: pkg
=amule-wxcas-dbg
576 amule-wxcas-dbg
: amule-wxcas-stage1
578 dh_strip
-pamule-wxcas
--dbg-package
=amule-wxcas-dbg
581 amuleweb-dbg
: pkg
=amuleweb-dbg
582 amuleweb-dbg
: amuleweb-stage1
584 dh_strip
-pamuleweb
--dbg-package
=amuleweb-dbg
587 amule-remote-gui-dbg
: pkg
=amule-remote-gui-dbg
588 amule-remote-gui-dbg
: amule-remote-gui-stage1
590 dh_strip
-pamule-remote-gui
--dbg-package
=amule-remote-gui-dbg
593 amule-daemon-dbg
: pkg
=amule-daemon-dbg
594 amule-daemon-dbg
: amule-daemon-stage1
596 dh_strip
-pamule-daemon
--dbg-package
=amule-daemon-dbg
599 amule-alc-dbg
: pkg
=amule-alc-dbg
600 amule-alc-dbg
: amule-alc-stage1
602 dh_strip
-pamule-alc
--dbg-package
=amule-alc-dbg
605 amule-alcc-dbg
: pkg
=amule-alcc-dbg
606 amule-alcc-dbg
: amule-alcc-stage1
608 dh_strip
-pamule-alcc
--dbg-package
=amule-alcc-dbg
611 amule-cmd-dbg
: pkg
=amule-cmd-dbg
612 amule-cmd-dbg
: amule-cmd-stage1
614 dh_strip
-pamule-cmd
--dbg-package
=amule-cmd-dbg
617 #Now just the targets to map the Commandline Name to the package names
621 ed2k
: amule-ed2k-stage2
624 cas
: amule-cas-stage2
627 wxcas
: amule-wxcas-stage2
630 webserver
: amuleweb-stage2
633 remotegui
: amule-remote-gui-stage2
636 daemon
: amule-daemon-stage2
639 alc
: amule-alc-stage2
642 alcc
: amule-alcc-stage2
645 amulecmd
: amule-cmd-stage2
648 ed2k-dbg
: amule-ed2k-dbg
651 cas-dbg
: amule-cas-dbg
654 wxcas-dbg
: amule-wxcas-dbg
657 webserver-dbg
: amuleweb-dbg
660 remotegui-dbg
: amule-remote-gui-dbg
663 daemon-dbg
: amule-daemon-dbg
666 alc-dbg
: amule-alc-dbg
669 alcc-dbg
: amule-alcc-dbg
672 amulecmd-dbg
: amule-cmd-dbg
675 amule-dbg
: pkg
=amule-dbg
676 amule-dbg
: amule-stage1
678 dh_strip
-pamule
--dbg-package
=amule-dbg
681 #Her come the Targets for the langauge packages
682 i18n-ar
: pkg
=amule-i18n-ar
683 i18n-ar
: amule-common
687 i18n-bg
: pkg
=amule-i18n-bg
688 i18n-bg
: amule-common
692 i18n-ca
: pkg
=amule-i18n-ca
693 i18n-ca
: amule-common
697 i18n-da
: pkg
=amule-i18n-da
698 i18n-da
: amule-common
702 i18n-de
: pkg
=amule-i18n-de
703 i18n-de
: amule-common
707 i18n-en-gb
: pkg
=amule-i18n-en-gb
708 i18n-en-gb
: amule-common
712 i18n-es
: pkg
=amule-i18n-es
713 i18n-es
: amule-common
717 i18n-et-ee
: pkg
=amule-i18n-et-ee
718 i18n-et-ee
: amule-common
722 i18n-eu
: pkg
=amule-i18n-eu
723 i18n-eu
: amule-common
727 i18n-fi
: pkg
=amule-i18n-fi
728 i18n-fi
: amule-common
732 i18n-fr
: pkg
=amule-i18n-fr
733 i18n-fr
: amule-common
737 i18n-gl
: pkg
=amule-i18n-gl
738 i18n-gl
: amule-common
742 i18n-hr
: pkg
=amule-i18n-hr
743 i18n-hr
: amule-common
747 i18n-hu
: pkg
=amule-i18n-hu
748 i18n-hu
: amule-common
752 i18n-it-ch
: pkg
=amule-i18n-it-ch
753 i18n-it-ch
: amule-common
757 i18n-it
: pkg
=amule-i18n-it
758 i18n-it
: amule-common
762 i18n-ko-kr
: pkg
=amule-i18n-ko-kr
763 i18n-ko-kr
: amule-common
767 i18n-lt
: pkg
=amule-i18n-lt
768 i18n-lt
: amule-common
772 i18n-nn
: pkg
=amule-i18n-nn
773 i18n-nn
: amule-common
777 i18n-nl
: pkg
=amule-i18n-nl
778 i18n-nl
: amule-common
782 i18n-pl
: pkg
=amule-i18n-pl
783 i18n-pl
: amule-common
787 i18n-pt-br
: pkg
=amule-i18n-pt-br
788 i18n-pt-br
: amule-common
792 i18n-pt-pt
: pkg
=amule-i18n-pt-pt
793 i18n-pt-pt
: amule-common
797 i18n-ru
: pkg
=amule-i18n-ru
798 i18n-ru
: amule-common
802 i18n-sl
: pkg
=amule-i18n-sl
803 i18n-sl
: amule-common
807 i18n-sv
: pkg
=amule-i18n-sv
808 i18n-sv
: amule-common
812 i18n-tr
: pkg
=amule-i18n-tr
813 i18n-tr
: amule-common
817 i18n-zh-cn
: pkg
=amule-i18n-zh-cn
818 i18n-zh-cn
: amule-common
822 i18n-zh-tw
: pkg
=amule-i18n-zh-tw
823 i18n-zh-tw
: amule-common
827 #They are just metapackages
828 amule-utils
: pkg
=amule-utils
829 amule-utils
: alcc amulecmd cas
833 amule-utils-gui
: pkg
=amule-utils-gui
834 amule-utils-gui
: alc remotegui wxcas
838 #These Two are empty (Space after Semicolon)
839 debug-packages
: amule-dbg ed2k-dbg cas-dbg wxcas-dbg webserver-dbg remotegui-dbg daemon-dbg alc-dbg alcc-dbg amulecmd-dbg
;
840 normal-packages
: amule-utils amule-utils-gui amule ed2k webserver daemon
;
842 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
;
846 #Now the targets for dpkg-buildpackage
847 binary-indep
: build
install
849 binary-arch
: debug-packages normal-packages language-packages
851 binary
: binary-indep binary-arch
854 cat README.Debian-Packages
857 .PHONY
: build
clean binary-indep binary-arch binary
install debug-packages normal-packages amule-utils-gui amule-utils i18n-only language-packages