File: rules

package info (click to toggle)
libimage-base-bundle-perl 1.0.7-3.3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 56 kB
  • sloc: makefile: 72
file content (110 lines) | stat: -rwxr-xr-x 1,985 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
#!/usr/bin/make -f

#DH_VERBOSE = 1

ifndef PERL
PERL="/usr/bin/perl"
endif

DEB_PACKAGES=Image-Base Image-Xbm Image-Xpm
DESTDIR=$(CURDIR)/debian/libimage-base-bundle-perl

# Since Image;:X{p,b}m requires Image::Base, add Image::Base to @INC
# so we can test.
export PERL5LIB=$(CURDIR)/build-tree/$(subst .tar.gz,,$(wildcard Image-Base-*.tar.gz))/blib/lib

unpack: $(foreach foo,$(DEB_PACKAGES),unpack-$(foo)-stamp)
unpack-%-stamp:
	dh_testdir
	mkdir -p build-tree
	tar -C build-tree -xzf $*-*.tar.gz

	touch $@


patch: unpack $(foreach foo,$(DEB_PACKAGES),patch-$(foo)-stamp)
patch-%-stamp:
	dh_testdir

	if [ -e debian/patches/$* ]; then \
		for a in `ls debian/patches/$*/*.diff`; do \
			patch -f -d build-tree/$*-* -p1 < $$a; \
		done; \
	fi;

	rm -f unpatch-$*-stamp;
	touch $@


unpatch: $(foreach foo,$(DEB_PACKAGES),unpatch-$(foo)-stamp)
unpatch-%-stamp:
	dh_testdir

	if [ -e debian/patches/$* ]; then \
		for a in `ls debian/patches/$*/*.diff`; do \
			patch -f -d build-tree/$*-* -p1 -R < $$a; \
		done; \
	fi;

	rm -f patch-$*-stamp
	touch $@


build: unpack patch $(foreach foo,$(DEB_PACKAGES),build-$(foo)-stamp)
build-%-stamp:
	dh_testdir

	cd build-tree/$*-*;\
	$(PERL) Makefile.PL INSTALLDIRS=vendor; \
	$(MAKE) ; \
	$(MAKE) test

	touch $@

clean:
	dh_testdir
	dh_testroot

	rm -f unpack-*-stamp
	rm -f build-*-stamp
	rm -f unpatch-*-stamp
	rm -f patch-*-stamp

	rm -rf build-tree
	dh_clean

install: build $(foreach foo,$(DEB_PACKAGES),install-$(foo)-stamp)
install-%-stamp:
	dh_testdir
	dh_testroot
#	dh_clean -k
	dh_installdirs

	$(MAKE) -C build-tree/$*-* install DESTDIR=$(DESTDIR)

#	MURDER DUMB /usr/lib DIRECTORY
	rm -rf $(DESTDIR)/usr/lib

# do nothing
binary-arch:


binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installman
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_perl
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep
.PHONY: unpack build clean binary-indep binary-arch binary install