File: rules

package info (click to toggle)
libpaper 1.1.24%2Bnmu5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 468 kB
  • ctags: 60
  • sloc: ansic: 504; sh: 346; makefile: 129
file content (110 lines) | stat: -rwxr-xr-x 2,282 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
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
# -*- makefile -*-
# debian/rules for libpaper

export DH_OPTIONS=

include /usr/share/dpkg/architecture.mk

package	:= $(firstword $(shell dh_listpackages))
prefix	:= $(CURDIR)/debian/tmp
share	:= /usr/share

config_flags	:= --prefix=/usr \
	--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
	--sysconfdir=/etc \
	--mandir=$(share)/man \
	--infodir=$(share)/info \
	--build=$(DEB_BUILD_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
config_flags	+= --host=$(DEB_HOST_GNU_TYPE)
endif

cflags	:= -g -Wall
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
cflags	+= -O2
else
cflags	+= -O0
endif

export CFLAGS=$(cflags)
export CXXFLAGS=$(cflags)

version	:= $(shell dpkg-parsechangelog | \
			sed -ne 's/^Version: *\([0-9]\+:\)*//p')


tag:
	cvs tag -c -F $(subst .,_,debian_version_$(version))
ifeq ($(findstring -,$(version)),)
	cvs tag -c -F $(subst .,_,upstream_version_$(version))
endif

config:	config-stamp
config-stamp:
	dh_testdir
	dh_autoreconf
	$(SHELL) ./configure $(config_flags)
	touch $@

build:	config build-stamp debian/libpaper1.config
build-stamp:
	$(MAKE)
	touch $@

debian/libpaper1.config: build-stamp
	exec > $@.new \
		&& sed -n '1,/^__BEGIN_PAPERSPECS__/p' $@ \
		&& src/paperconf -amns \
		&& sed -n '/^__END_PAPERSPECS__/,$$p' $@
	mv $@.new $@

clean:	checkroot
	rm -f *-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_autoreconf_clean
	dh_clean
	exec > debian/libpaper1.config.new \
		&& sed -n '1,/^__BEGIN_PAPERSPECS__/p' debian/libpaper1.config \
		&& sed -n '/^__END_PAPERSPECS__/,$$p' debian/libpaper1.config
	mv debian/libpaper1.config.new debian/libpaper1.config

binary-indep:	DH_OPTIONS=-i
binary-indep:	checkroot build
	dh_prep
	dh_installdirs

	dh_link

	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:	DH_OPTIONS=-a
binary-arch:	checkroot build
	dh_prep
	dh_installdirs

	$(MAKE) install DESTDIR=$(prefix)

	dh_install

	dh_installchangelogs
	dh_installdocs

	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdebconf
	dh_installdeb
	dh_shlibdeps -L$(package) -ldebian/$(package)/usr/lib/$(DEB_HOST_MULTIARCH)
	dh_gencontrol
	dh_md5sums
	dh_builddeb

#binary: binary-indep binary-arch
binary: binary-arch

.PHONY:	binary binary-indep binary-arch clean checkroot build config tag