File: rules

package info (click to toggle)
libgdiplus 6.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,312 kB
  • sloc: ansic: 78,330; sh: 4,236; makefile: 477
file content (83 lines) | stat: -rwxr-xr-x 2,416 bytes parent folder | download
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
#!/usr/bin/make -f

#export DH_VERBOSE=1
MAKEFILE = $(firstword $(MAKEFILE_LIST))
DEBIAN_DIR = $(dir $(MAKEFILE))
SOURCE_DIR = $(DEBIAN_DIR)/..

DEB_VERSION = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Version | cut -d" " -f2)
DEB_SOURCE_NAME = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Source | cut -d" " -f2)
VERSION = $(shell echo $(DEB_VERSION) | cut -d"-" -f1 | sed 's/+dfsg.*//')
UPVERSION = $(shell echo $(VERSION) | sed 's,-.*,,' | sed 's,+dfsg.*,,')

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
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

get-orig-source: TARBALL_DIR = $(DEB_SOURCE_NAME)-$(UPVERSION)
get-orig-source:
	uscan \
		--package $(DEB_SOURCE_NAME) \
		--watchfile $(DEBIAN_DIR)/watch \
		--upstream-version $(VERSION) \
		--download-version $(VERSION) \
		--destdir . \
		--force-download \
		--rename \
		--repack
	if [ -d $(TARBALL_DIR) ]; then \
		echo "$(TARBALL_DIR) is in the way, bailing out!"; \
		exit 1; \
	fi
	if [ -d $(TARBALL_DIR)+dfsg ]; then \
		echo "$(TARBALL_DIR)+dfsg is in the way, bailing out!"; \
		exit 1; \
	fi
	tar -xzf $(DEB_SOURCE_NAME)_$(UPVERSION).orig.tar.gz
	rm $(DEB_SOURCE_NAME)_$(UPVERSION).orig.tar.gz
	rm -f $(TARBALL_DIR)/tests/AdobeRGB1998.icc
	mv $(TARBALL_DIR) $(TARBALL_DIR)+dfsg
	tar -czf $(DEB_SOURCE_NAME)_$(UPVERSION)+dfsg.orig.tar.gz $(TARBALL_DIR)+dfsg
	rm -r $(TARBALL_DIR)+dfsg

override_dh_auto_configure:
	CFLAGS="$(CFLAGS)" ./configure \
	  --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
	  --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
	perl -pe 's/-Werror//' -i src/Makefile
	
override_dh_auto_build:
	$(MAKE)
	perl -pe 's,^Requires:.*,,; s,^Libs:.*,,; s,^Cflags:.*,,;' -i libgdiplus.pc

override_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_auto_test:
	true

override_dh_auto_install:
	dh_auto_install
	rm debian/libgdiplus/usr/lib/lib*.*a

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) clean
	rm -f config.status config.log
	rm -f cairo/config.status cairo/config.log
	rm -f Makefile.in aclocal.m4 configure
	rm -f depcomp missing src/Makefile.in
	rm -f tests/Makefile.in


%:
	dh $@ --with autoreconf