File: rules

package info (click to toggle)
neon27 0.30.2-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 4,940 kB
  • ctags: 3,303
  • sloc: ansic: 24,449; xml: 3,673; sh: 3,557; makefile: 595
file content (159 lines) | stat: -rwxr-xr-x 5,040 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/usr/bin/make -f
# -*- makefile -*-

package=libneon27
upstream-version=$(shell head -n 1 debian/changelog | sed -e 's/.*(\(\([0-9]\+:\)\?\([^-]\+\).*\).*).*/\3/' )

export KRB5_CONFIG=/usr/bin/krb5-config.mit

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/architecture.mk

export PKG_CONFIG=$(shell which $(DEB_HOST_GNU_TYPE)-pkg-config)

BUILDDIR=$(CURDIR)/debian/build-tree/
DESTDIR=$(CURDIR)/debian/
CONFIG_COMMON=  --enable-shared			\
		--enable-static			\
		--enable-threadsafe-ssl=posix   \
		--with-gssapi			\
		--with-libxml2			\
		$(NULL)

CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)

build-autoreconf:
	LIBTOOLIZE='libtoolize --install' dh_autoreconf \
		autoreconf -- -f -i -I macros
	touch build-autoreconf

${BUILDDIR}/neon-openssl/config.status: build-autoreconf
	CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
		dh_auto_configure --builddirectory=$(BUILDDIR)/neon-openssl -- ${CONFIG_COMMON} \
			--with-ssl=openssl

${BUILDDIR}/neon-gnutls/config.status: build-autoreconf
	CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
		 dh_auto_configure --builddirectory=$(BUILDDIR)/neon-gnutls -- ${CONFIG_COMMON} \
			--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
			--with-ssl=gnutls

build-arch: build
build-indep: build

build: build-openssl build-gnutls
build-openssl: ${BUILDDIR}/neon-openssl/config.status
	dh_testdir
	cd $(BUILDDIR)/neon-openssl/ && $(MAKE)
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	cd $(BUILDDIR)/neon-openssl/ && $(MAKE) check
endif
	touch build-openssl

build-gnutls: ${BUILDDIR}/neon-gnutls/config.status
	dh_testdir
	cd $(BUILDDIR)/neon-gnutls/ && \
		sed -i "s/-lneon/-lneon-gnutls/g" \
		neon-config neon.pc Makefile src/Makefile test/Makefile
	cd $(BUILDDIR)/neon-gnutls/ && \
		sed -i "s/libneon\./libneon-gnutls\./g" \
		neon-config neon.pc Makefile src/Makefile test/Makefile
	cd $(BUILDDIR)/neon-gnutls/ && $(MAKE)
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	cd $(BUILDDIR)/neon-gnutls/ && $(MAKE) check || true
endif

	touch build-gnutls

clean:
	dh_testdir
	dh_testroot
	rm -f build-autoreconf build-openssl build-gnutls \
	    install-openssl install-gnutls \
	    macros/changelog.m4
	rm -rf $(BUILDDIR)
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -rf Makefile src/Makefile test/Makefile config.h config.cache config.log config.status
	rm -rf libtool neon-config src/.libs src/*.o
	dh_autoreconf_clean
	dh_clean


install: install-openssl install-gnutls

install-openssl: build-openssl
	dh_testdir
	dh_testroot
	dh_installdirs
	cd $(BUILDDIR)/neon-openssl/ && $(MAKE) install-lib install-headers install-config install-man DESTDIR=$(DESTDIR)/$(package)
	chrpath -d $(CURDIR)/debian/$(package)/usr/lib/*/libneon.so.27
	rm -f $(CURDIR)/debian/$(package)/usr/lib/*/libneon.la
	dh_movefiles -p$(package)-dev --sourcedir=debian/$(package)
	install -d debian/$(package)-dev/usr/share/aclocal
	cp macros/neon*.m4 \
		debian/$(package)-dev/usr/share/aclocal/

	rm -rf debian/$(package)/usr/include \
		debian/$(package)/usr/bin \
		debian/$(package)/usr/share/man \
		debian/$(package)/usr/lib/*/pkgconfig

	touch install-openssl

install-gnutls: build-gnutls
	dh_testdir
	dh_testroot
	dh_installdirs
	cd $(BUILDDIR)/neon-gnutls/ && $(MAKE) install-lib install-headers install-config install-man DESTDIR=$(DESTDIR)/$(package)-gnutls
	chrpath -d $(CURDIR)/debian/$(package)-gnutls/usr/lib/*/libneon-gnutls.so.27
	rm -f $(CURDIR)/debian/$(package)-gnutls/usr/lib/*/libneon-gnutls.la
	dh_movefiles -p$(package)-gnutls-dev \
	  --sourcedir=debian/$(package)-gnutls
	ln -sf libneon-gnutls.so debian/$(package)-gnutls-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libneon.so
	ln -sf libneon-gnutls.a  debian/$(package)-gnutls-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libneon.a
	install -d debian/$(package)-gnutls-dev/usr/share/aclocal
	cp macros/neon*.m4 \
		debian/$(package)-gnutls-dev/usr/share/aclocal/

	rm -rf debian/$(package)-gnutls/usr/include \
		debian/$(package)-gnutls/usr/bin \
		debian/$(package)-gnutls/usr/share/man \
		debian/$(package)-gnutls/usr/lib/*/pkgconfig

	touch install-gnutls


binary-indep: build install
	# No arch indep packages generated

binary-arch: build install
	dh_testdir -a
	dh_testroot -a

	cp macros/ChangeLog macros/changelog.m4
	dh_installdocs -p$(package)-dev macros/changelog.m4
	dh_installdocs -p$(package)-gnutls-dev macros/changelog.m4

	dh_installchangelogs -a ChangeLog
	dh_installdocs -a AUTHORS BUGS NEWS README THANKS TODO
	dh_makeshlibs -p$(package) -V'$(package)'
	dh_makeshlibs -p$(package)-gnutls -V'$(package)-gnutls'
	dh_link
	dh_strip -p$(package) --dbg-package=$(package)-dbg
	dh_strip -p$(package)-gnutls --dbg-package=$(package)-gnutls-dbg
	dh_lintian -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


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