File: rules

package info (click to toggle)
amule 2.2.6%2Bdebian0-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 24,344 kB
  • ctags: 16,311
  • sloc: cpp: 105,427; ansic: 8,449; sh: 4,906; php: 3,852; cs: 3,325; makefile: 2,451; perl: 913; yacc: 822; ruby: 687; lex: 466; java: 339; python: 26; awk: 21; sed: 16
file content (851 lines) | stat: -rwxr-xr-x 18,441 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
#!/usr/bin/make -f
# -*- makefile -*-
# This file was originally written by Vollstrecker

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1


# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

#Here are the packages that can't be compiled separate now
general_pkgs = "amule-common"\
	"amule-skin-gnome"\
	"amule-skin-kde4"\
	"amule-skin-tango"\
	"amule-skin-xfce"\
	"amule-theme-default"\
	"amule-theme-php-default"\
	"amule-theme-chicane"\
	"amule-xas"

# First, get the targets from commandline
flags = ${MAKECMDGOALS}

#First we have to find out, if we are called from dpkg-buildpackage

ifeq ("binary", "$(findstring binary, $(flags))")

	WXCAS = --enable-wxcas
	CAS = --enable-cas
	WEBSERVER = --enable-webserver
	REMOTEGUI = --enable-amule-gui
	DAEMON = --enable-amule-daemon
	ALCC = --enable-alcc
	ALC = --enable-alc
	AMULECMD = --enable-amulecmd
	DEBUGGING = --enable-debug --disable-optimize --disable-profile
	LANGFLAG = --with-language=all

else ifeq ("clean", "$(findstring clean, $(flags))")

	WXCAS = --enable-wxcas
	CAS = --enable-cas
	WEBSERVER = --enable-webserver
	REMOTEGUI = --enable-amule-gui
	DAEMON = --enable-amule-daemon
	ALCC = --enable-alcc
	ALC = --enable-alc
	AMULECMD = --enable-amulecmd
	DEBUGGING = --enable-debug --disable-optimize --disable-profile
	LANGFLAG = --with-language=all

else ifeq ("build", "$(findstring build, $(flags))")

	WXCAS = --enable-wxcas
	CAS = --enable-cas
	WEBSERVER = --enable-webserver
	REMOTEGUI = --enable-amule-gui
	DAEMON = --enable-amule-daemon
	ALCC = --enable-alcc
	ALC = --enable-alc
	AMULECMD = --enable-amulecmd
	DEBUGGING = --enable-debug --disable-optimize --disable-profile
	LANGFLAG = --with-language=all

else
	#Now we have to check what packages are build to configure only them

	#We have to filter the right targets (wo_ means without)
	wo_wxcas = $(subst wxcas, , ${flags})
	wo_alcc = $(subst alcc, , ${flags})
	wo_amule_utils_gui = $(subst amule-utils-gui, ,${flags})
	wo_all_other_amules = $(subst amulecmd, ,$(subst amule-utils-gui, ,$(subst amule-utils, ,${flags})))
	LANGUAGE := en_GB

	ifeq ("wxcas", "$(findstring wxcas, $(flags))")
		WXCAS = --enable-wxcas
	endif

	ifeq ("cas", "$(findstring cas, $(wo_wxcas))")
		CAS = --enable-cas
	endif

	ifeq ("webserver", "$(findstring webserver, $(flags))")
		WEBSERVER = --enable-webserver
	endif

	ifeq ("remotegui", "$(findstring remotegui, $(flags))")
		REMOTEGUI = --enable-amule-gui
	endif

	ifeq ("daemon", "$(findstring daemon, $(flags))")
		DAEMON = --enable-amule-daemon
	endif

	ifeq ("alcc", "$(findstring alcc, $(flags))")
		ALCC = --enable-alcc
	endif

	ifeq ("alc", "$(findstring alc, $(wo_alcc))")
		ALC = --enable-alc
	endif

	ifeq ("amulecmd", "$(findstring amulecmd, $(flags))")
		AMULECMD = --enable-amulecmd
	endif

	ifneq ("amule", "$(findstring amule, $(wo_all_other_amules))")
		AMULE = --disable-monolithic
	endif

	ifneq ("ed2k", "$(findstring ed2k, $(flags))")
		ED2K = --disable-ed2k
	endif

	#Now find out if a Metapackage should be build
	ifeq ("amule-utils-gui", "$(findstring amule-utils-gui, $(flags))")
		ALC = --enable-alc
		REMOTEGUI = --enable-amule-gui
		WXCAS = --enable-wxcas
	endif

	ifeq ("amule-utils", "$(findstring amule-utils, $(wo_amule_utils_gui))")
		ALCC = --enable-alcc
		AMULECMD = --enable-amulecmd
		CAS = --enable-cas
	endif

	#Find this whole i18n stuff
	ifneq ("i18n-en-only", "$(findstring i18n-en-only, $(flags))")

		ifeq ("i18n-ar", "$(findstring i18n-ar, $(flags))")
			LANGUAGE := $(LANGUAGE),ar
		endif

		ifeq ("i18n-bg", "$(findstring i18n-bg, $(flags))")
			LANGUAGE := $(LANGUAGE),bg
		endif

		ifeq ("i18n-ca", "$(findstring i18n-ca, $(flags))")
			LANGUAGE := $(LANGUAGE),ca
		endif

		ifeq ("i18n-da", "$(findstring i18n-da, $(flags))")
			LANGUAGE := $(LANGUAGE),da
		endif

		ifeq ("i18n-de", "$(findstring i18n-de, $(flags))")
			LANGUAGE := $(LANGUAGE),de
		endif

		ifeq ("i18n-es", "$(findstring i18n-es, $(flags))")
			LANGUAGE := $(LANGUAGE),es
		endif

		ifeq ("i18n-et-ee", "$(findstring i18n-et-ee, $(flags))")
			LANGUAGE := $(LANGUAGE),et_EE
		endif

		ifeq ("i18n-eu", "$(findstring i18n-eu, $(flags))")
			LANGUAGE := $(LANGUAGE),eu
		endif

		ifeq ("i18n-fi", "$(findstring i18n-fi, $(flags))")
			LANGUAGE := $(LANGUAGE),fi
		endif

		ifeq ("i18n-fr", "$(findstring i18n-fr, $(flags))")
			LANGUAGE := $(LANGUAGE),fr
		endif

		ifeq ("i18n-gl", "$(findstring i18n-gl, $(flags))")
			LANGUAGE := $(LANGUAGE),gl
		endif

		ifeq ("i18n-hr", "$(findstring i18n-hr, $(flags))")
			LANGUAGE := $(LANGUAGE),hr
		endif

		ifeq ("i18n-hu", "$(findstring i18n-hu, $(flags))")
			LANGUAGE := $(LANGUAGE),hu
		endif

		ifeq ("i18n-it", "$(findstring i18n-it, $(flags))")
			LANGUAGE := $(LANGUAGE),it
		endif

		ifeq ("i18n-it-ch", "$(findstring i18n-it-ch, $(flags))")
			LANGUAGE := $(LANGUAGE),it_CH
		endif

		ifeq ("i18n-ko-kr", "$(findstring i18n-ko-kr, $(flags))")
			LANGUAGE := $(LANGUAGE),ko_KR
		endif

		ifeq ("i18n-lt", "$(findstring i18n-lt, $(flags))")
			LANGUAGE := $(LANGUAGE),lt
		endif

		ifeq ("i18n-nl", "$(findstring i18n-nl, $(flags))")
			LANGUAGE := $(LANGUAGE),hl
		endif

		ifeq ("i18n-nn", "$(findstring i18n-nn, $(flags))")
			LANGUAGE := $(LANGUAGE),nn
		endif

		ifeq ("i18n-pl", "$(findstring i18n-pl, $(flags))")
			LANGUAGE := $(LANGUAGE),pl
		endif

		ifeq ("i18n-pt-br", "$(findstring i18n-pt-br, $(flags))")
			LANGUAGE := $(LANGUAGE),pt_BR
		endif

		ifeq ("i18n-pt-pt", "$(findstring i18n-pt-pt, $(flags))")
			LANGUAGE := $(LANGUAGE),pt_PT
		endif

		ifeq ("i18n-ru", "$(findstring i18n-ru, $(flags))")
			LANGUAGE := $(LANGUAGE),ru
		endif

		ifeq ("i18n-sl", "$(findstring i18n-sl, $(flags))")
			LANGUAGE := $(LANGUAGE),sl
		endif

		ifeq ("i18n-sv", "$(findstring i18n-sv, $(flags))")
			LANGUAGE := $(LANGUAGE),sv
		endif

		ifeq ("i18n-tr", "$(findstring i18n-tr, $(flags))")
			LANGUAGE := $(LANGUAGE),tr
		endif

		ifeq ("i18n-zh-cn", "$(findstring i18n-zh-cn, $(flags))")
			LANGUAGE := $(LANGUAGE),zh_CN
		endif

		ifeq ("i18n-zh-tw", "$(findstring i18n-zh-tw, $(flags))")
			LANGUAGE := $(LANGUAGE),zh_TW
		endif

		ifeq ($(LANGUAGE),en_GB)
			LANGUAGE = all
		endif

	endif

	LANGFLAG = --with-language=$(LANGUAGE)

	#And at Last, find out if we compile a debug-package or not.
	ifeq ("dbg", "$(findstring dbg, $(flags))")
		DEBUGGING = --enable-debug --disable-optimize --disable-profile
	else
		DEBUGGING = --disable-debug --enable-optimize --disable-profile 
	endif
endif

#Before we start, I want to introduce two sequences for building the packages
#I define two, so I can put the commands for the *-dbg packages between them
define stage1
	dh_testdir -p${pkg}
	dh_testroot -p${pkg}
	dh_installdirs -p${pkg}
	dh_installchangelogs docs/Changelog -p${pkg}
	dh_installdocs -p${pkg}
	dh_install -Xlicense.txt -p${pkg}
	dh_installmenu -p${pkg}
	dh_installdebconf -p${pkg}
	dh_installman -p${pkg}
	dh_link -p${pkg}
	install -D --mode=644 debian/${pkg}.override debian/${pkg}/usr/share/lintian/overrides/${pkg}
	touch $@
endef

define stage2
	dh_compress -X.pl -p${pkg}
	dh_perl -p${pkg}
	dh_makeshlibs -p${pkg}
	dh_installdeb -p${pkg}
	dh_shlibdeps -p${pkg}
	dh_gencontrol -p${pkg}
	dh_md5sums -p${pkg}
	dh_fixperms -p${pkg}
	dh_builddeb -p${pkg}
	touch $@
endef

#Now we configure this whole thing
config.status: configure
	dh_testdir
	CFLAGS="$(CFLAGS)" ./configure\
		--host=$(DEB_HOST_GNU_TYPE)\
		--build=$(DEB_BUILD_GNU_TYPE)\
		--prefix=/usr\
		--mandir=\$${prefix}/share/man\
		--infodir=\$${prefix}/share/info\
		--enable-systray\
		--with-ccache\
		--enable-utf8-systray\
		--enable-geoip\
		--disable-embedded-crypto\
		${AMULECMD}\
		${DEBUGGING}\
		${WEBSERVER}\
		${CAS}\
		${WXCAS}\
		${ALC}\
		${ALCC}\
		${REMOTEGUI}\
		${DAEMON}\
		${AMULE}\
		${ED2K}\
		$(LANGFLAG)


#And here is the well known clean target
clean:
	dh_testdir
	dh_testroot
	rm -f alc
	rm -f alc-dbg
	rm -f alcc
	rm -f alcc-dbg
	rm -f amule
	rm -f amule-alc-dbg
	rm -f amule-alc-stage1
	rm -f amule-alc-stage2
	rm -f amule-alcc-dbg
	rm -f amule-alcc-stage1
	rm -f amule-alcc-stage2
	rm -f amule-cas-dbg
	rm -f amule-cas-stage1
	rm -f amule-cas-stage2
	rm -f amule-cmd-dbg
	rm -f amule-cmd-stage1
	rm -f amule-cmd-stage2
	rm -f amule-common
	rm -f amule-daemon-dbg
	rm -f amule-daemon-stage1
	rm -f amule-daemon-stage2
	rm -f amule-dbg
	rm -f amule-ed2k-dbg
	rm -f amule-ed2k-stage1
	rm -f amule-ed2k-stage2
	rm -f amule-remote-gui-dbg
	rm -f amule-remote-gui-stage1
	rm -f amule-remote-gui-stage2
	rm -f amule-stage1
	rm -f amule-stage2
	rm -f amule-utils
	rm -f amule-utils-gui
	rm -f amule-wxcas-dbg
	rm -f amule-wxcas-stage1
	rm -f amule-wxcas-stage2
	rm -f amulecmd
	rm -f amulecmd-dbg
	rm -f amuleweb-stage1
	rm -f amuleweb-stage2
	rm -f amuleweb-dbg
	rm -f build-stamp 
	rm -f cas
	rm -f cas-dbg
	rm -f compile
	rm -f daemon
	rm -f daemon-dbg
	rm -f ed2k
	rm -f ed2k-dbg
	rm -f i18n-ar
	rm -f i18n-bg
	rm -f i18n-ca
	rm -f i18n-da
	rm -f i18n-de
	rm -f i18n-en-gb
	rm -f i18n-es
	rm -f i18n-et-ee
	rm -f i18n-eu
	rm -f i18n-fi
	rm -f i18n-fr
	rm -f i18n-gl
	rm -f i18n-hr
	rm -f i18n-hu
	rm -f i18n-it
	rm -f i18n-it-ch
	rm -f i18n-ko-kr
	rm -f i18n-lt
	rm -f i18n-nl
	rm -f i18n-nn
	rm -f i18n-pl
	rm -f i18n-pt-br
	rm -f i18n-pt-pt
	rm -f i18n-ru
	rm -f i18n-sl
	rm -f i18n-sv
	rm -f i18n-tr
	rm -f i18n-zh-cn
	rm -f i18n-zh-tw
	rm -f remotegui
	rm -f remotegui-dbg
	rm -f webserver
	rm -f webserver-dbg
	rm -f wxcas
	rm -f wxcas-dbg

	[ ! -f Makefile ] || $(MAKE) distclean

ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	
	rm -f debian/files
	dh_clean -k

#Some generic targets to check the build process
build: build-stamp

build-stamp:  config.status
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	touch build-stamp

#Now we install the packages all together to the tmp-dir inside of debian/
install: build
	dh_testdir
	dh_testroot
	dh_clean -a -k 
	dh_installdirs

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

#Now first build the packages that are compiled and installed on every build
amule-common: install

	for pkg in $(general_pkgs); do \
		dh_testdir -p$$pkg; \
		dh_testroot -p$$pkg; \
		dh_installdirs -p$$pkg; \
		dh_installchangelogs docs/Changelog -p$$pkg; \
		dh_installdocs -p$$pkg; \
		dh_install -Xlicense.txt -p$$pkg; \
		dh_installmenu -p$$pkg; \
		dh_installdebconf -p$$pkg; \
		dh_installman -p$$pkg; \
		dh_link -p$$pkg; \
		install -D --mode=644 debian/$$pkg.override debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
		dh_compress -X.pl -p$$pkg; \
		dh_perl -p$$pkg; \
		dh_makeshlibs -p$$pkg; \
		dh_installdeb -p$$pkg; \
		dh_shlibdeps -p$$pkg; \
		dh_gencontrol -p$$pkg; \
		dh_md5sums -p$$pkg; \
		dh_fixperms -p$$pkg; \
		dh_builddeb -p$$pkg; \
	done
	touch amule-common

amule-stage1: pkg=amule
amule-stage1: amule-common
	${stage1}

amule-stage2: pkg=amule
amule-stage2: amule-stage1
	${stage2}

amule-ed2k-stage1: pkg=amule-ed2k
amule-ed2k-stage1: amule-common
	${stage1}

amule-ed2k-stage2: pkg=amule-ed2k
amule-ed2k-stage2: amule-ed2k-stage1
	${stage2}

amule-cas-stage1: pkg=amule-cas
amule-cas-stage1: amule-common
	${stage1}

amule-cas-stage2: pkg=amule-cas
amule-cas-stage2: amule-cas-stage1
	${stage2}

amule-wxcas-stage1: pkg=amule-wxcas
amule-wxcas-stage1: amule-common
	${stage1}

amule-wxcas-stage2: pkg=amule-wxcas
amule-wxcas-stage2: amule-wxcas-stage1
	${stage2}

amuleweb-stage1: pkg=amuleweb
amuleweb-stage1: amule-common
	${stage1}

amuleweb-stage2: pkg=amuleweb
amuleweb-stage2: amuleweb-stage1
	${stage2}

amule-remote-gui-stage1: pkg=amule-remote-gui
amule-remote-gui-stage1: amule-common
	${stage1}

amule-remote-gui-stage2: pkg=amule-remote-gui
amule-remote-gui-stage2: amule-remote-gui-stage1
	${stage2}

amule-daemon-stage1: pkg=amule-daemon
amule-daemon-stage1: amule-common
	${stage1}

amule-daemon-stage2: pkg=amule-daemon
amule-daemon-stage2: amule-daemon-stage1
	${stage2}

amule-alc-stage1: pkg=amule-alc
amule-alc-stage1: amule-common
	${stage1}

amule-alc-stage2: pkg=amule-alc
amule-alc-stage2: amule-alc-stage1
	${stage2}

amule-alcc-stage1: pkg=amule-alcc
amule-alcc-stage1: amule-common
	${stage1}

amule-alcc-stage2: pkg=amule-alcc
amule-alcc-stage2: amule-alcc-stage1
	${stage2}

amule-cmd-stage1: pkg=amule-cmd
amule-cmd-stage1: amule-common
	${stage1}

amule-cmd-stage2: pkg=amule-cmd
amule-cmd-stage2: amule-alcc-stage1
	${stage2}


amule-ed2k-dbg: pkg=amule-ed2k-dbg
amule-ed2k-dbg: amule-ed2k-stage1
	${stage1}
	dh_strip -pamule-ed2k --dbg-package=amule-ed2k-dbg
	${stage2}

amule-cas-dbg: pkg=amule-cas-dbg
amule-cas-dbg: amule-cas-stage1
	${stage1}
	dh_strip -pamule-cas --dbg-package=amule-cas-dbg
	${stage2}

amule-wxcas-dbg: pkg=amule-wxcas-dbg
amule-wxcas-dbg: amule-wxcas-stage1
	${stage1}
	dh_strip -pamule-wxcas --dbg-package=amule-wxcas-dbg
	${stage2}

amuleweb-dbg: pkg=amuleweb-dbg
amuleweb-dbg: amuleweb-stage1
	${stage1}
	dh_strip -pamuleweb --dbg-package=amuleweb-dbg
	${stage2}

amule-remote-gui-dbg: pkg=amule-remote-gui-dbg
amule-remote-gui-dbg: amule-remote-gui-stage1
	${stage1}
	dh_strip -pamule-remote-gui --dbg-package=amule-remote-gui-dbg
	${stage2}

amule-daemon-dbg: pkg=amule-daemon-dbg
amule-daemon-dbg: amule-daemon-stage1
	${stage1}
	dh_strip -pamule-daemon --dbg-package=amule-daemon-dbg
	${stage2}

amule-alc-dbg: pkg=amule-alc-dbg
amule-alc-dbg: amule-alc-stage1
	${stage1}
	dh_strip -pamule-alc --dbg-package=amule-alc-dbg
	${stage2}

amule-alcc-dbg: pkg=amule-alcc-dbg
amule-alcc-dbg: amule-alcc-stage1
	${stage1}
	dh_strip -pamule-alcc --dbg-package=amule-alcc-dbg
	${stage2}

amule-cmd-dbg: pkg=amule-cmd-dbg
amule-cmd-dbg: amule-cmd-stage1
	${stage1}
	dh_strip -pamule-cmd --dbg-package=amule-cmd-dbg
	${stage2}

#Now just the targets to map the Commandline Name to the package names
amule: amule-stage2
	touch amule

ed2k: amule-ed2k-stage2
	touch ed2k

cas: amule-cas-stage2
	touch cas

wxcas: amule-wxcas-stage2
	touch wxcas

webserver: amuleweb-stage2
	touch webserver

remotegui: amule-remote-gui-stage2
	touch remotegui

daemon: amule-daemon-stage2
	touch daemon

alc: amule-alc-stage2
	touch alc

alcc: amule-alcc-stage2
	touch alcc

amulecmd: amule-cmd-stage2
	touch amulecmd

ed2k-dbg: amule-ed2k-dbg
	touch ed2k-dbg

cas-dbg: amule-cas-dbg
	touch cas-dbg

wxcas-dbg: amule-wxcas-dbg
	touch wxcas-dbg

webserver-dbg: amuleweb-dbg
	touch webserver-dbg

remotegui-dbg: amule-remote-gui-dbg
	touch remotegui-dbg

daemon-dbg: amule-daemon-dbg
	touch daemon-dbg

alc-dbg: amule-alc-dbg
	touch alc-dbg

alcc-dbg: amule-alcc-dbg
	touch alcc-dbg

amulecmd-dbg: amule-cmd-dbg
	touch amulecmd-dbg

amule-dbg: pkg=amule-dbg
amule-dbg: amule-stage1
	${stage1}
	dh_strip -pamule --dbg-package=amule-dbg
	${stage2}

#Her come the Targets for the langauge packages
i18n-ar: pkg=amule-i18n-ar
i18n-ar: amule-common
	${stage1}
	${stage2}

i18n-bg: pkg=amule-i18n-bg
i18n-bg: amule-common
	${stage1}
	${stage2}

i18n-ca: pkg=amule-i18n-ca
i18n-ca: amule-common
	${stage1}
	${stage2}

i18n-da: pkg=amule-i18n-da
i18n-da: amule-common
	${stage1}
	${stage2}

i18n-de: pkg=amule-i18n-de
i18n-de: amule-common
	${stage1}
	${stage2}

i18n-en-gb: pkg=amule-i18n-en-gb
i18n-en-gb: amule-common
	${stage1}
	${stage2}

i18n-es: pkg=amule-i18n-es
i18n-es: amule-common
	${stage1}
	${stage2}

i18n-et-ee: pkg=amule-i18n-et-ee
i18n-et-ee: amule-common
	${stage1}
	${stage2}

i18n-eu: pkg=amule-i18n-eu
i18n-eu: amule-common
	${stage1}
	${stage2}

i18n-fi: pkg=amule-i18n-fi
i18n-fi: amule-common
	${stage1}
	${stage2}

i18n-fr: pkg=amule-i18n-fr
i18n-fr: amule-common
	${stage1}
	${stage2}

i18n-gl: pkg=amule-i18n-gl
i18n-gl: amule-common
	${stage1}
	${stage2}

i18n-hr: pkg=amule-i18n-hr
i18n-hr: amule-common
	${stage1}
	${stage2}

i18n-hu: pkg=amule-i18n-hu
i18n-hu: amule-common
	${stage1}
	${stage2}

i18n-it-ch: pkg=amule-i18n-it-ch
i18n-it-ch: amule-common
	${stage1}
	${stage2}

i18n-it: pkg=amule-i18n-it
i18n-it: amule-common
	${stage1}
	${stage2}

i18n-ko-kr: pkg=amule-i18n-ko-kr
i18n-ko-kr: amule-common
	${stage1}
	${stage2}

i18n-lt: pkg=amule-i18n-lt
i18n-lt: amule-common
	${stage1}
	${stage2}

i18n-nn: pkg=amule-i18n-nn
i18n-nn: amule-common
	${stage1}
	${stage2}

i18n-nl: pkg=amule-i18n-nl
i18n-nl: amule-common
	${stage1}
	${stage2}

i18n-pl: pkg=amule-i18n-pl
i18n-pl: amule-common
	${stage1}
	${stage2}

i18n-pt-br: pkg=amule-i18n-pt-br
i18n-pt-br: amule-common
	${stage1}
	${stage2}

i18n-pt-pt: pkg=amule-i18n-pt-pt
i18n-pt-pt: amule-common
	${stage1}
	${stage2}

i18n-ru: pkg=amule-i18n-ru
i18n-ru: amule-common
	${stage1}
	${stage2}

i18n-sl: pkg=amule-i18n-sl
i18n-sl: amule-common
	${stage1}
	${stage2}

i18n-sv: pkg=amule-i18n-sv
i18n-sv: amule-common
	${stage1}
	${stage2}

i18n-tr: pkg=amule-i18n-tr
i18n-tr: amule-common
	${stage1}
	${stage2}

i18n-zh-cn: pkg=amule-i18n-zh-cn
i18n-zh-cn: amule-common
	${stage1}
	${stage2}

i18n-zh-tw: pkg=amule-i18n-zh-tw
i18n-zh-tw: amule-common
	${stage1}
	${stage2}

#They are just metapackages
amule-utils: pkg=amule-utils
amule-utils: alcc amulecmd cas
	${stage1}
	${stage2}

amule-utils-gui: pkg=amule-utils-gui
amule-utils-gui: alc remotegui wxcas
	${stage1}
	${stage2}

#These Two are empty (Space after Semicolon)
debug-packages: amule-dbg ed2k-dbg cas-dbg wxcas-dbg webserver-dbg remotegui-dbg daemon-dbg alc-dbg alcc-dbg amulecmd-dbg ; 
normal-packages: amule-utils amule-utils-gui amule ed2k webserver daemon ; 

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 ; 

i18n-en-only: ; 

#Now the targets for dpkg-buildpackage
binary-indep: build install

binary-arch: debug-packages normal-packages language-packages

binary: binary-indep binary-arch

help:
	cat README.Debian-Packages

.DEFAULT_GOAL = help
.PHONY: build clean binary-indep binary-arch binary install debug-packages normal-packages amule-utils-gui amule-utils i18n-only language-packages