3 # Uncomment this to turn on verbose mode.
7 DEB_BUILD_OPTIONS += nocheck
8 # Workaround for broken dpkg-architecture in Tizen's SB1
9 DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11 # This has to be exported to make some magic below work.
14 # These are locations of quilt stuff
15 export QUILT_PATCHES=$(shell pwd)/debian/patches
17 # These are used for cross-compiling and for saving the configure script
18 # from having to guess our platform (since we know it already)
19 DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
20 DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
21 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
22 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
24 # set the number of build jobs
25 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
26 JOBS:=-j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
29 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
30 CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --with-random=/dev/urandom
32 CROSS= --build $(DEB_BUILD_GNU_TYPE)
35 ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
39 ifeq (${DEB_BUILD_GNU_TYPE},${DEB_HOST_GNU_TYPE})
40 ifneq (${DEB_BUILD_ARCH},m68k)
41 ifneq (${DEB_BUILD_ARCH_OS},kfreebsd)
42 ifneq (${DEB_BUILD_ARCH_OS},knetbsd)
43 ifneq (${DEB_BUILD_ARCH_OS},hurd)
52 SHLIBS_VERSION=7.16.2-1
54 # this will catch miss-linking. (e.g. undefined symbols)
55 # LDFLAGS = -Wl,-z,defs
57 CONFIGURE_ARGS = $(CROSS) --prefix=/usr --mandir=/usr/share/man --disable-dependency-tracking --disable-ipv6 --with-lber-lib=lber --enable-manual --enable-versioned-symbols --enable-ares
58 # this fixes the ldap warning of dpkg-shlibdebs, but we dont want that.
59 # --with-ldap-lib=/usr/lib/libldap_r.so
61 ifneq (${DEB_BUILD_ARCH_OS},hurd)
62 CONFIGURE_ARGS += --with-gssapi=/usr
67 #configure-stamp: DH_OPTIONS=
74 # # pop the last patch (nss)
77 # # pop the second last patch (gnutls)
79 # get the source without nss and gnutls patches
80 tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build
82 # # push the second last patch which must be gnutls
84 # # get the source with gnutls patch applied
85 # tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-gnutls
87 # # push the last patch which must be nss
89 # # get the source with nss patch applied
90 # tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-nss
92 # for flavour in build build-gnutls build-nss; do \
93 # (cd debian/$$flavour && ./buildconf) \
95 (cd debian/build && ./buildconf)
97 cd debian/build && ./configure ${CONFIGURE_ARGS} --with-ca-path=/etc/ssl/certs --without-gnutls --without-nss --with-openssl
98 # cd debian/build-gnutls && ./configure ${CONFIGURE_ARGS} --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt --without-ssl --with-gnutls --without-libssh2
99 # cd debian/build-nss && ./configure ${CONFIGURE_ARGS} --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt --without-ssl --with-nss --without-libssh2
100 touch configure-stamp
102 #build-stamp: DH_OPTIONS=
103 build-stamp: configure-stamp
105 ${MAKE} $(JOBS) -C debian/build
106 # ${MAKE} $(JOBS) -C debian/build-gnutls
107 # ${MAKE} $(JOBS) -C debian/build-nss
109 ifeq (${DO_TEST},yes)
110 -${MAKE} -C debian/build test
111 # -${MAKE} -C debian/build-gnutls test
112 # -${MAKE} -C debian/build-nss test
121 rm -rf build-stamp configure-stamp debian/build #debian/build-gnutls debian/build-nss debian/tmp-gnutls debian/tmp-nss
122 dh_clean debian/shlibs.local
124 #install: DH_OPTIONS=
130 ${MAKE} -C debian/build DESTDIR=$(shell pwd)/debian/tmp install
131 # ${MAKE} -C debian/build-gnutls DESTDIR=$(shell pwd)/debian/tmp-gnutls install
132 # ${MAKE} -C debian/build-nss DESTDIR=$(shell pwd)/debian/tmp-nss install
133 # dh_install -plibcurl3-gnutls -plibcurl4-gnutls-dev --sourcedir=debian/tmp-gnutls
134 # dh_install -plibcurl3-nss -plibcurl4-nss-dev --sourcedir=debian/tmp-nss
135 #dh_install -Nlibcurl3-gnutls -Nlibcurl4-gnutls-dev -Nlibcurl3-nss -Nlibcurl4-nss-dev --sourcedir=debian/tmp
136 dh_install --sourcedir=debian/tmp
137 # install -m 644 debian/libcurl3-gnutls.lintian-overrides debian/libcurl3-gnutls/usr/share/lintian/overrides/libcurl3-gnutls
138 # install -m 644 debian/libcurl3-nss.lintian-overrides debian/libcurl3-nss/usr/share/lintian/overrides/libcurl3-nss
139 install -m 644 debian/libcurl3.lintian-overrides debian/libcurl3/usr/share/lintian/overrides/libcurl3
140 for i in `find debian/lib* -name "lib*.la"`; do echo "removing dependency_libs from $$i"; sed -i -e "/dependency_libs/ s/'.*'/''/" $$i; done
142 # Build architecture-independent files here.
143 #binary-indep: DH_OPTIONS=-i
144 binary-indep: build-stamp install
145 # We have nothing to do here.
147 # Build architecture-dependent files here.
148 #binary-arch: DH_OPTIONS=-a
149 binary-arch: build-stamp install
153 # for package in libcurl4-openssl-dev libcurl4-gnutls-dev libcurl4-nss-dev; do \
154 # install -m 644 docs/libcurl/libcurl.m4 debian/$${package}/usr/share/aclocal; \
155 # for doc_ext in html pdf; do \
156 # install -m 644 docs/*.$${doc_ext} debian/$${package}/usr/share/doc/$${package}/$${doc_ext}; \
157 # install -m 644 docs/libcurl/*.$${doc_ext} debian/$${package}/usr/share/doc/$${package}/$${doc_ext}/libcurl; \
162 # dh_installchangelogs CHANGES
164 # dh_strip -Nlibcurl3 -Nlibcurl3-gnutls -Nlibcurl3-nss
165 # dh_strip -plibcurl3 -plibcurl3-gnutls -plibcurl3-nss --dbg-package=libcurl3-dbg
166 dh_strip -plibcurl3 --dbg-package=libcurl3-dbg
169 echo "libcurl 4 libcurl3 (>= $(SHLIBS_VERSION))" > debian/shlibs.local
170 dh_makeshlibs -plibcurl3 -V "libcurl3 (>= $(SHLIBS_VERSION))"
171 # dh_makeshlibs -plibcurl3-gnutls -V "libcurl3-gnutls (>= $(SHLIBS_VERSION))"
172 # dh_makeshlibs -plibcurl3-nss -V "libcurl3-nss (>= $(SHLIBS_VERSION))"
179 binary: binary-indep binary-arch
181 .PHONY: binary binary-arch binary-indep build clean install