Git init
[external/curl.git] / debian / rules
1 #! /usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 ## Tizen customization
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)
10
11 # This has to be exported to make some magic below work.
12 export DH_OPTIONS
13
14 # These are locations of quilt stuff
15 export QUILT_PATCHES=$(shell pwd)/debian/patches
16
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)
23
24 # set the number of build jobs
25 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
26     JOBS:=-j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
27 endif
28
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
31 else
32 CROSS= --build $(DEB_BUILD_GNU_TYPE)
33 endif
34
35 ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
36     DO_TEST=no
37 else
38     DO_TEST=no
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)
44         DO_TEST=yes
45     endif
46     endif
47     endif
48     endif
49     endif
50 endif
51
52 SHLIBS_VERSION=7.16.2-1
53
54 # this will catch miss-linking. (e.g. undefined symbols)
55 # LDFLAGS = -Wl,-z,defs
56
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 
60
61 ifneq (${DEB_BUILD_ARCH_OS},hurd)
62 CONFIGURE_ARGS += --with-gssapi=/usr
63 endif
64
65 build: build-stamp
66
67 #configure-stamp: DH_OPTIONS=
68 configure-stamp:
69         dh_testdir
70         mkdir -p debian/build
71
72 #       -quilt push -a
73 #
74 #       # pop the last patch (nss)
75 #       quilt pop
76 #
77 #       # pop the second last patch (gnutls)
78 #       quilt pop
79         # get the source without nss and gnutls patches
80         tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build
81
82 #       # push the second last patch which must be gnutls
83 #       quilt push
84 #       # get the source with gnutls patch applied
85 #       tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-gnutls
86
87 #       # push the last patch which must be nss
88 #       quilt push
89 #       # get the source with nss patch applied
90 #       tar -cf - --exclude=debian --exclude=.pc . | tar -xf - -C debian/build-nss
91
92 #       for flavour in build build-gnutls build-nss; do \
93 #               (cd debian/$$flavour && ./buildconf) \
94 #       done
95         (cd debian/build && ./buildconf)
96
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
101
102 #build-stamp: DH_OPTIONS=
103 build-stamp: configure-stamp
104         dh_testdir
105         ${MAKE} $(JOBS) -C debian/build
106 #       ${MAKE} $(JOBS) -C debian/build-gnutls
107 #       ${MAKE} $(JOBS) -C debian/build-nss
108
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
113 endif
114
115         touch build-stamp
116
117 clean:
118         dh_testdir
119         dh_testroot
120 #       -quilt pop -a
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
123
124 #install: DH_OPTIONS=
125 install: build-stamp
126         dh_testdir
127         dh_testroot
128         dh_clean -k
129         dh_installdirs
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
141
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.
146
147 # Build architecture-dependent files here.
148 #binary-arch: DH_OPTIONS=-a
149 binary-arch: build-stamp install
150         dh_testdir
151         dh_testroot
152 #       dh_installdocs
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; \
158 #               done; \
159 #       done
160 #       dh_installman
161 #       dh_installexamples
162 #       dh_installchangelogs CHANGES
163         dh_link
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
167         dh_compress
168         dh_fixperms
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))"
173         dh_installdeb
174         dh_shlibdeps
175         dh_md5sums
176         dh_gencontrol
177         dh_builddeb
178
179 binary: binary-indep binary-arch
180
181 .PHONY: binary binary-arch binary-indep build clean install