e6367a294bd4043b457fd5fe4cfa02be805f58d2
[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 INSTALL_PROGRAM = install
8 CONFIGURE_ARGS = \
9         --disable-fips-prf --enable-openssl --enable-nm --enable-ldap \
10         --enable-eap-gtc --enable-eap-md5 --enable-agent --enable-curl \
11         --enable-padlock --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib \
12         --with-ipsecdir=/usr/lib/strongswan
13
14 ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O2
16 endif
17 ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
18         INSTALL_PROGRAM += -s
19 endif
20 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22         MAKEFLAGS += -j$(NUMJOBS)
23 endif
24 ifeq ($(DEB_BUILD_ARCH_CPU),i386)
25   CONFIGURE_ARGS += --enable-padlock
26 endif
27
28 build:
29         dh_testdir
30         ./configure $(CONFIGURE_ARGS)
31         $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
32         touch build
33
34 clean:
35         dh_testdir
36         dh_testroot
37         rm -f build
38         [ ! -f Makefile ] || $(MAKE) clean
39         dh_clean
40
41 install: build
42         dh_testdir
43         dh_testroot
44         dh_clean
45         dh_installdirs
46         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
47
48 binary-indep: build install
49 binary-arch: build install
50         dh_testdir
51         dh_testroot
52         dh_installchangelogs NEWS
53         dh_installdocs README
54         dh_installinit --name=ipsec
55         dh_install
56         dh_link
57         dh_strip
58         dh_compress
59         dh_fixperms -X etc/ipsec.secrets -X etc/ipsec.d
60         dh_makeshlibs
61         dh_installdeb
62         dh_shlibdeps
63         dh_gencontrol
64         dh_md5sums
65         dh_builddeb
66
67 binary: binary-indep binary-arch
68 .PHONY: build clean binary-indep binary-arch binary install
69