e866a45cbec87cc565d343a9113ce0cbfba5467e
[strongswan.git] / packages / strongswan / debian / rules
1 #!/usr/bin/make -f
2
3 #export DH_VERBOSE=1
4
5 CC = gcc
6 CFLAGS = -Wall -Wno-format -Wno-pointer-sign -Wno-strict-aliasing -g
7 CONFIGURE_ARGS = \
8         --disable-fips-prf --enable-openssl --enable-md4 --enable-nm \
9         --enable-agent --enable-eap-gtc --enable-eap-md5 --enable-eap-mschapv2 \
10         --enable-eap-identity --enable-ldap --enable-curl --sysconfdir=/etc \
11         --prefix=/usr --libexecdir=/usr/lib --with-ipsecdir=/usr/lib/strongswan
12
13 ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
14         CFLAGS += -O2
15 endif
16 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18         MAKEFLAGS += -j$(NUMJOBS)
19 endif
20 ifeq ($(DEB_BUILD_ARCH_CPU),i386)
21   CONFIGURE_ARGS += --enable-padlock
22 endif
23
24 build:
25         dh_testdir
26         ./configure $(CONFIGURE_ARGS)
27         $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
28         touch build
29
30 clean:
31         dh_testdir
32         dh_testroot
33         rm -f build
34         [ ! -f Makefile ] || $(MAKE) clean
35         dh_clean
36
37 install: build
38         dh_testdir
39         dh_testroot
40         dh_clean
41         dh_installdirs
42         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
43
44 binary-indep: build install
45 binary-arch: build install
46         dh_testdir
47         dh_testroot
48         dh_installchangelogs NEWS
49         dh_installdocs README
50         dh_installinit --name=ipsec
51         dh_install -s
52         dh_link
53         dh_strip
54         dh_compress
55         dh_fixperms -Xetc/ipsec.secrets -Xetc/ipsec.d
56         dh_makeshlibs
57         dh_installdeb
58         dh_shlibdeps
59         dh_gencontrol -s
60         dh_md5sums
61         dh_builddeb -s
62
63 binary: binary-indep binary-arch
64 .PHONY: build clean binary-indep binary-arch binary install
65