pass ARCH down to uClibc
[buildroot.git] / package / vtun / vtun.mk
blobf24b1670636aa68cc314402853dc0b3bbab740f1
1 #############################################################
3 # vtun
5 # NOTE: Uses start-stop-daemon in init script, so be sure
6 # to enable that within busybox
8 #############################################################
9 VTUN_VERSION:=3.0.1
10 VTUN_SOURCE:=vtun_$(VTUN_VERSION).orig.tar.gz
11 VTUN_PATCH:=vtun_$(VTUN_VERSION)-1.diff.gz
12 VTUN_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/v/vtun
13 VTUN_DIR:=$(BUILD_DIR)/vtun-$(VTUN_VERSION)
14 VTUN_CAT:=$(ZCAT)
15 VTUN_BINARY:=vtund
16 VTUN_TARGET_BINARY:=usr/sbin/vtund
18 vtun-patched: $(VTUN_DIR)/.patched
20 $(DL_DIR)/$(VTUN_SOURCE):
21 $(WGET) -P $(DL_DIR) $(VTUN_SITE)/$(VTUN_SOURCE)
22 ifneq ($(VTUN_PATCH),)
23 VTUN_PATCH_FILE:=$(DL_DIR)/$(VTUN_PATCH)
24 $(VTUN_PATCH_FILE):
25 $(WGET) -P $(DL_DIR) $(VTUN_SITE)/$(VTUN_PATCH)
26 endif
28 $(VTUN_DIR)/.patched: $(DL_DIR)/$(VTUN_SOURCE) $(VTUN_PATCH_FILE)
29 $(VTUN_CAT) $(DL_DIR)/$(VTUN_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
30 ifneq ($(VTUN_PATCH_FILE),)
31 (cd $(VTUN_DIR) && $(VTUN_CAT) $(VTUN_PATCH_FILE) | patch -p1)
32 if [ -d $(VTUN_DIR)/debian/patches ]; then \
33 toolchain/patch-kernel.sh $(VTUN_DIR) $(VTUN_DIR)/debian/patches \*-\*; \
35 endif
36 toolchain/patch-kernel.sh $(VTUN_DIR) package/vtun/ vtun\*$(VTUN_VERSION)\*.patch
37 # fakeroot does this for us
38 $(SED) '/^INSTALL_OWNER/d' $(VTUN_DIR)/Makefile.in
39 $(CONFIG_UPDATE) $(@D)
40 touch $@
42 $(VTUN_DIR)/.configured: $(VTUN_DIR)/.patched
43 (cd $(VTUN_DIR); rm -rf config.cache; \
44 $(AUTO_CONFIGURE_TARGET) \
45 --prefix=/usr \
46 --exec-prefix=/usr \
47 --bindir=/usr/bin \
48 --sbindir=/usr/sbin \
49 --libdir=/lib \
50 --libexecdir=/usr/lib \
51 --sysconfdir=/etc \
52 --datadir=/usr/share \
53 --localstatedir=/var \
54 --mandir=/usr/share/man \
55 --infodir=/usr/share/info \
56 --with-ssl-headers=$(STAGING_DIR)/usr/include/openssl \
57 --with-lzo-headers=$(STAGING_DIR)/usr/include \
58 --with-lzo-lib=$(STAGING_DIR)/usr/lib \
59 --disable-socks \
60 --disable-shaper \
62 touch $@
64 $(VTUN_DIR)/$(VTUN_BINARY): $(VTUN_DIR)/.configured
65 $(MAKE) -C $(VTUN_DIR)
67 $(TARGET_DIR)/$(VTUN_TARGET_BINARY): $(VTUN_DIR)/$(VTUN_BINARY)
68 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(VTUN_DIR) install
69 rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/share/doc
70 ifneq ($(BR2_HAVE_MANPAGES),y)
71 rm -rf $(TARGET_DIR)/usr/man
72 endif
73 ifneq ($(BR2_HAVE_INFOPAGES),y)
74 rm -rf $(TARGET_DIR)/usr/info
75 endif
77 vtun: zlib lzo openssl $(TARGET_DIR)/$(VTUN_TARGET_BINARY)
79 vtun-source: $(DL_DIR)/$(VTUN_SOURCE) $(VTUN_PATCH_FILE)
81 vtun-clean:
82 -$(MAKE) DESTDIR=$(TARGET_DIR) -C $(VTUN_DIR) uninstall
83 -$(MAKE) -C $(VTUN_DIR) clean
85 vtun-dirclean:
86 rm -rf $(VTUN_DIR)
88 #############################################################
90 # Toplevel Makefile options
92 #############################################################
93 ifeq ($(BR2_PACKAGE_VTUN),y)
94 TARGETS+=vtun
95 endif