File: rules

package info (click to toggle)
gnupg2 2.0.14-2%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 22,400 kB
  • ctags: 10,195
  • sloc: ansic: 141,533; sh: 6,878; makefile: 828; perl: 196; awk: 126; sed: 16
file content (128 lines) | stat: -rwxr-xr-x 3,548 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
#!/usr/bin/make -f
# debian/rules file - for GNUPG (1.9)
# Copyright 1994,1995 by Ian Jackson.
# Copyright 1998-2003 by James Troup.
# Copyright 2003-2004 by Matthias Urlichs.
# 
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

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

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	confflags += --build $(DEB_HOST_GNU_TYPE)
else
	confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

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

install_dir=install -d -m 755
install_file=install -m 644
install_script=install -m 755
install_binary=install -m 755 -s

config: config-stamp
config-stamp: configure
	dh_testdir
	chmod +x configure tests/runtest
	dh_autoreconf
	env CFLAGS="$(CFLAGS)" \
	./configure $(confflags) --enable-maintainer-mode \
		--prefix=/usr --with-included-gettext \
		--with-zlib=/usr --infodir=/usr/share/info/  \
		--mandir='$${prefix}/share/man' --libexecdir=/usr/lib/gnupg2 \
		--sysconfdir=/etc --enable-gpg --enable-symcryptrun

	touch config-stamp

build: build-stamp
build-stamp: config
	$(MAKE)
	$(MAKE) -C doc

	cd doc && makeinfo gnupg.texi

	touch build-stamp

test: test-stamp
test-stamp: build-stamp
	dh_testdir
#	$(MAKE) check
	touch test-stamp

clean:
	dh_testdir
	-rm -f config-stamp build-stamp test-stamp doc/gnupg2.info*
	[ ! -f Makefile ] || $(MAKE) distclean

	dh_autoreconf_clean
	dh_clean

binary-common:
	dh_testdir
	dh_testroot
	dh_clean -k

	dh_installdirs

	for i in */ChangeLog; do \
		$(install_file) $$i debian/gnupg2/usr/share/doc/gnupg2/changelog.$$(dirname $$i); done
	mv debian/gnupg2/usr/share/doc/gnupg2/changelog.agent debian/gnupg-agent/usr/share/doc/gnupg-agent/changelog
	mv debian/gnupg2/usr/share/doc/gnupg2/changelog.sm debian/gpgsm/usr/share/doc/gpgsm/changelog
	ln -s changelog.g10.gz debian/gnupg2/usr/share/doc/gnupg2/changelog.gz
	$(install_file) agent/ChangeLog debian/gnupg-agent/usr/share/doc/gnupg-agent/changelog
	$(install_file) sm/ChangeLog debian/gpgsm/usr/share/doc/gpgsm/changelog

binary-indep:	build binary-common
# Nothing to do

binary-arch:	build test binary-common
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
	# shouldn't be here; it's a symlink to /etc/locale.alias in Debian
	-rm -f debian/tmp/usr/share/locale/locale.alias

	dh_install -a
	find debian/tmp -type d -o -ls

	dh_installdocs -a
	dh_installexamples -a
	dh_installinfo -a
	dh_installchangelogs -a
	dh_lintian -a

	$(install_file) debian/gnupg-agent.xsession debian/gnupg-agent/etc/X11/Xsession.d/90gpg-agent

	dh_strip -a
	dh_compress -a
	dh_fixperms -a

	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a -Xgnupg2/gpg2keys_ldap -- \
		-dRecommends debian/tmp/usr/lib/gnupg2/gpg2keys_ldap -dDepends
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

# Below here is fairly generic really

binary: 	binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean test build binary-common