summaryrefslogtreecommitdiff
path: root/package/vpnc/vpnc.mk
blob: 93f7eec1c68c87ac916beecb3f95732f166e3b50 (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
60
61
62
#############################################################
#
# vpnc
#
#############################################################

VPNC_VERSION=0.5.3
VPNC_SOURCE=vpnc-$(VPNC_VERSION).tar.gz
VPNC_SITE=http://www.unix-ag.uni-kl.de/~massar/vpnc
VPNC_DIR=$(BUILD_DIR)/vpnc-$(VPNC_VERSION)
VPNC_CAT:=$(ZCAT)
VPNC_BINARY:=$(VPNC_DIR)/vpnc
VPNC_DEST_DIR:=$(TARGET_DIR)/usr/local/sbin
VPNC_TARGET_BINARY:=$(VPNC_DEST_DIR)/vpnc
VPNC_TARGET_SCRIPT:=$(TARGET_DIR)/etc/vpnc/default.conf

$(DL_DIR)/$(VPNC_SOURCE):
	$(WGET) -P $(DL_DIR) $(VPNC_SITE)/$(VPNC_SOURCE)

$(VPNC_DIR)/.unpacked: $(DL_DIR)/$(VPNC_SOURCE)
	$(VPNC_CAT) $(DL_DIR)/$(VPNC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(VPNC_DIR) package/vpnc vpnc-$(VPNC_VERSION)\*.patch
	touch $@

$(VPNC_BINARY): $(VPNC_DIR)/.unpacked
	rm -f $@
	$(MAKE) $(TARGET_CONFIGURE_OPTS) INCLUDE=$(STAGING_DIR)/usr/include \
		CFLAGS="$(TARGET_CFLAGS)" \
		LDFLAGS+=-lgcrypt LDFLAGS+=-lgpg-error \
		CC="$(TARGET_CC)" -C $(VPNC_DIR)

$(VPNC_TARGET_BINARY): $(VPNC_BINARY)
	$(MAKE) $(TARGET_CONFIGURE_OPTS) \
		DESTDIR=$(TARGET_DIR) \
		BINDIR=/usr/local/bin \
		SBINDIR=/usr/local/sbin \
		ETCDIR=/etc/vpnc \
		MANDIR=/usr/share/man \
		VERSION=$(VPNC_VERSION) \
		INCLUDE=$(STAGING_DIR)/usr/include \
		LDFLAGS="-lgcrypt -lgpg-error" \
		-C $(VPNC_DIR) install
	$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(VPNC_TARGET_BINARY)

vpnc: uclibc libgcrypt $(VPNC_TARGET_BINARY)

vpnc-source: $(DL_DIR)/$(VPNC_SOURCE)

vpnc-clean:
	-$(MAKE) -C $(VPNC_DIR) clean
	rm -f $(STAGING_DIR)/usr/bin/vpnc

vpnc-dirclean:
	rm -rf $(VPNC_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_VPNC),y)
TARGETS+=vpnc
endif