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