aboutsummaryrefslogtreecommitdiffstats
path: root/build/strongswan-nm/debian/rules
blob: 216aa26f73d4f4771d878f846440ecc75bfd6e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/make -f

package = strongswan-nm
docdir = debian/tmp/usr/share/doc/$(package)

CC = gcc
CFLAGS = -Wall -Wno-format -Wno-pointer-sign -Wno-strict-aliasing -g
INSTALL_PROGRAM = install

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  INSTALL_PROGRAM += -s
endif

build:
	$(checkdir)
	./configure --disable-aes --disable-des --disable-md5 --disable-sha1 \
	--disable-sha2 --disable-fips-prf --disable-gmp --disable-stroke \
	--disable-pluto --disable-tools --disable-updown --enable-openssl \
	--enable-nm --enable-eap-gtc --enable-agent \
	--sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
	$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
	touch build

clean:
	$(checkdir)
	rm -f build
	[ ! -f Makefile ] || $(MAKE) clean
	rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars

binary-indep:   checkroot build
	$(checkdir)

binary-arch:    checkroot build
	rm -rf debian/tmp
	install -d debian/tmp/DEBIAN $(docdir)
	$(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
		DESTDIR=$$(pwd)/debian/tmp install
	cp -a NEWS debian/copyright $(docdir)
	cp -a debian/changelog $(docdir)/changelog.Debian
	cd $(docdir) && gzip -9 changelog.Debian
	dpkg-gencontrol -isp
	chown -R root:root debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f src/charon/daemon.c -a -f debian/rules
endef

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test $$(id -u) = 0

.PHONY: binary binary-arch binary-indep clean checkroot