3
# These are used for cross-compiling and for saving the configure script
4
# from having to guess our platform (since we know it already)
5
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
6
DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
7
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
8
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
11
# set the number of build jobs
12
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
13
JOBS:=-j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
16
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
17
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --with-random=/dev/urandom
19
CROSS= --build $(DEB_BUILD_GNU_TYPE)
22
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
26
ifeq (${DEB_BUILD_GNU_TYPE},${DEB_HOST_GNU_TYPE})
27
ifneq (${DEB_BUILD_ARCH},m68k)
28
ifneq (${DEB_BUILD_ARCH_OS},kfreebsd)
29
ifneq (${DEB_BUILD_ARCH_OS},knetbsd)
30
ifneq (${DEB_BUILD_ARCH_OS},hurd)
39
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
40
CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
41
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
43
3
# this will avoid unneded dependencies
44
LDFLAGS += -Wl,--as-needed
4
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
46
6
# this will catch miss-linking. (e.g. undefined symbols)
47
#LDFLAGS+= -Wl,-z,defs
49
CONFIGURE_ARGS = $(CROSS) --prefix=/usr --mandir=/usr/share/man \
50
--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
51
--disable-dependency-tracking --enable-ipv6 \
52
--with-lber-lib=lber --disable-symbol-hiding \
53
--enable-versioned-symbols --enable-manual \
54
CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
55
# this is still not ready
57
# this fixes the ldap warning of dpkg-shlibdebs, but we dont want that.
58
# --with-ldap-lib=/usr/lib/libldap_r.so
60
ifneq (${DEB_BUILD_ARCH_OS},hurd)
61
CONFIGURE_ARGS += --with-gssapi=/usr
64
CONFIGURE_ARGS_UDEB = $(filter-out --with-lber-lib=lber --with-gssapi=/usr,$(CONFIGURE_ARGS))
66
build-arch: build-stamp
67
build-indep: build-stamp
69
build: build-arch build-indep
73
mkdir -p debian/build debian/build-gnutls debian/build-nss debian/build-udeb
7
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs
9
CONFIGURE_ARGS = -- --disable-dependency-tracking \
10
--disable-symbol-hiding --enable-versioned-symbols \
11
--with-lber-lib=lber --with-gssapi=/usr
16
override_dh_auto_configure:
17
mkdir -p debian/build debian/build-gnutls debian/build-nss
74
18
# pop the last patch (nss)
76
20
# pop the second last patch (gnutls)
78
22
# get the source without nss and gnutls patches
79
tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build
80
tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-udeb
23
tar -cf - --exclude=debian/build* --exclude=.pc . \
24
| tar -xf - -C debian/build
81
25
# push the second last patch which must be gnutls
83
27
# get the source with gnutls patch applied
84
tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-gnutls
28
tar -cf - --exclude=debian/build* --exclude=.pc . \
29
| tar -xf - -C debian/build-gnutls
85
30
# push the last patch which must be nss
87
32
# get the source with nss patch applied
88
tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-nss
33
tar -cf - --exclude=debian/build* --exclude=.pc . \
34
| tar -xf - -C debian/build-nss
89
35
# run buildconf and make sure to copy the patched ltmain.sh
90
for flavour in build build-udeb build-gnutls build-nss; do \
36
for flavour in build build-gnutls build-nss; do \
91
37
(cd debian/$$flavour && ./buildconf && cp ../../ltmain.sh .) \
93
cd debian/build && ./configure ${CONFIGURE_ARGS} \
94
--with-librtmp --with-ca-path=/etc/ssl/certs
95
cd debian/build-udeb && ./configure ${CONFIGURE_ARGS_UDEB} \
96
--with-ca-path=/etc/ssl/certs --without-gnutls \
97
--without-nss --disable-ldap --disable-ldaps \
98
--disable-file --disable-ftp --disable-pop4 \
99
--disable-rtsp --disable-imap --disable-smtp \
100
--without-librtmp --without-libidn
101
cd debian/build-gnutls && ./configure ${CONFIGURE_ARGS} \
39
cd debian/build && dh_auto_configure ${CONFIGURE_ARGS} \
40
--with-ca-path=/etc/ssl/certs
41
cd debian/build-gnutls && dh_auto_configure ${CONFIGURE_ARGS} \
102
42
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
103
43
--without-ssl --with-gnutls
104
cd debian/build-nss && ./configure ${CONFIGURE_ARGS} \
44
cd debian/build-nss && dh_auto_configure ${CONFIGURE_ARGS} \
105
45
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
106
46
--without-ssl --with-nss
107
touch configure-stamp
109
build-stamp: configure-stamp
111
${MAKE} $(JOBS) -C debian/build
112
${MAKE} $(JOBS) -C debian/build-udeb
113
${MAKE} $(JOBS) -C debian/build-gnutls
114
${MAKE} $(JOBS) -C debian/build-nss
115
ifeq (${DO_TEST},yes)
116
-${MAKE} -C debian/build test
117
-${MAKE} -C debian/build-udeb test
118
-${MAKE} -C debian/build-gnutls test
119
-${MAKE} -C debian/build-nss test
126
$(RM) -r build-stamp configure-stamp debian/build* debian/tmp*
128
#install: DH_OPTIONS=
133
${MAKE} -C debian/build \
48
override_dh_auto_build:
49
cd debian/build && dh_auto_build
50
cd debian/build-gnutls && dh_auto_build
51
cd debian/build-nss && dh_auto_build
53
override_dh_auto_test:
54
-cd debian/build && dh_auto_test
55
-cd debian/build-gnutls && dh_auto_test
56
-cd debian/build-nss && dh_auto_test
59
${MAKE} -C debian/build \
134
60
DESTDIR=$(shell pwd)/debian/tmp install
135
${MAKE} -C debian/build-udeb \
136
DESTDIR=$(shell pwd)/debian/tmp-udeb install
137
${MAKE} -C debian/build-gnutls \
61
${MAKE} -C debian/build-gnutls \
138
62
DESTDIR=$(shell pwd)/debian/tmp-gnutls install
139
${MAKE} -C debian/build-nss \
63
${MAKE} -C debian/build-nss \
140
64
DESTDIR=$(shell pwd)/debian/tmp-nss install
141
65
dh_install -plibcurl3-gnutls -plibcurl4-gnutls-dev \
142
66
--sourcedir=debian/tmp-gnutls
143
67
dh_install -plibcurl3-nss -plibcurl4-nss-dev \
144
68
--sourcedir=debian/tmp-nss
145
dh_install -pcurl-udeb -plibcurl3-udeb \
146
--sourcedir=debian/tmp-udeb
147
dh_install -pcurl -plibcurl3 -plibcurl4-openssl-dev \
69
dh_install -pcurl -plibcurl3 -plibcurl4-openssl-dev -plibcurl4-doc \
148
70
--sourcedir=debian/tmp
150
71
sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
152
# Build architecture-independent files here.
153
binary-indep: build-stamp install
154
# We have nothing to do here.
156
# Build architecture-dependent files here.
157
binary-arch: build-stamp install
73
override_dh_installchangelogs:
163
74
dh_installchangelogs CHANGES
165
80
dh_strip -plibcurl3 -plibcurl3-gnutls -plibcurl3-nss \
166
81
--dbg-package=libcurl3-dbg
167
82
dh_strip --remaining-packages
170
dh_makeshlibs -plibcurl3 --add-udeb=libcurl3-udeb
171
dh_makeshlibs -Nlibcurl3
178
binary: binary-indep binary-arch
180
.PHONY: binary binary-arch binary-indep build clean install
84
override_dh_auto_clean:
85
$(RM) -r debian/build* debian/tmp*