File: rules

package info (click to toggle)
pam-python 1.0.6-1.1%2Bdeb10u1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 416 kB
  • sloc: ansic: 2,461; python: 681; makefile: 162
file content (88 lines) | stat: -rwxr-xr-x 2,707 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

#export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
BIN_PACKAGE	= libpam-python
DOC_PACKAGE	= libpam-python-doc
DOC_DIR		= usr/share/doc/$(DOC_PACKAGE)
DEB_BUILD_MAINT_OPTIONS ?= hardening=+bindnow

ME=$(shell sed 's,\([^ ]*\) .*,\1,;q' debian/changelog)

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif

.PHONY:	get-orig-source
get-orig-source:
	version=$(shell \
	    wget -O - "http://sourceforge.net/projects/$(ME)/files/" | \
	    sed -n 's;.*<a href="/projects/$(ME)/files/$(ME)-\([^/]*\)/".*;\1;p' | \
	    sort --version-sort -r | sed 1q); \
	wget "http://downloads.sourceforge.net/$(ME)/$(ME)-$${version}/$(ME)-$${version%-*}.tar.gz"; \
	mv "$(ME)-$${version%-*}.tar.gz" "$(ME)_$${version%-*}.orig.tar.gz"

.PHONY: clean
clean:
	dh_testdir
	$(MAKE) clean
	dh_clean

.PHONY: build build-arch build-indep
build: build-arch build-indep
build-arch:
	$(shell DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS)" dpkg-buildflags --export=configure) $(MAKE) lib
build-indep:
	$(shell DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS)" dpkg-buildflags --export=configure) $(MAKE) doc

.PHONY: install install-arch install-indep
install: install-arch install-indep
install-arch: build-arch
	dh_testdir --arch
	dh_testroot --arch
	dh_prep --arch
	dh_installdocs --arch
	dh_installchangelogs --arch
	$(MAKE) DESTDIR=$(CURDIR)/debian/$(BIN_PACKAGE) LIBDIR=/lib/$(DEB_HOST_MULTIARCH)/security install-lib

install-indep: build-indep
	dh_testdir --indep
	dh_testroot --indep
	dh_prep --indep
	dh_installdocs --indep
	dh_installdocs -p$(DOC_PACKAGE) README.txt
	dh_installchangelogs --indep
	$(MAKE) DESTDIR=$(CURDIR)/debian/$(DOC_PACKAGE) DOCDIR=/$(DOC_DIR) install-doc
	rm $(CURDIR)/debian/$(DOC_PACKAGE)/$(DOC_DIR)/html/_static/jquery.js
	dh_link -p$(DOC_PACKAGE) /usr/share/javascript/jquery/jquery.js $(DOC_DIR)/html/_static/jquery.js
	rm $(CURDIR)/debian/$(DOC_PACKAGE)/$(DOC_DIR)/html/_static/underscore.js
	dh_link -p$(DOC_PACKAGE) /usr/share/javascript/underscore/underscore.js $(DOC_DIR)/html/_static/underscore.js
	dh_compress --indep -X$(DOC_DIR)/html

.PHONY: binary binary-arch binary-indep
binary: binary-arch binary-indep
binary-arch: install-arch
	dh_testdir --arch
	dh_testroot --arch
	dh_link --arch
	dh_strip --arch
	dh_compress --arch
	dh_fixperms --arch
	dh_installdeb --arch
	dh_shlibdeps --arch
	dh_gencontrol --arch
	dh_md5sums --arch
	dh_builddeb --arch

binary-indep: install-indep
	dh_testdir --indep
	dh_testroot --indep
	dh_fixperms --indep
	dh_installdeb --indep
	dh_gencontrol --indep
	dh_md5sums --indep
	dh_builddeb --indep