[package] vtun: make package more configurable
[openwrt/svn-archive/archive.git] / net / vtun / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=vtun
11 PKG_VERSION:=3.0.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/vtun
16 PKG_MD5SUM:=d3d8bc4d58886498a1c338670eab9315
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/vtun
21 SECTION:=net
22 CATEGORY:=Network
23 DEPENDS:=+kmod-tun +VTUN_LZO:liblzo +VTUN_LZO:zlib +VTUN_SSL:libopenssl
24 TITLE:=VPN tunneling daemon
25 URL:=http://vtun.sourceforge.net
26 SUBMENU:=VPN
27 MENU:=1
28 endef
29
30 define Package/vtun/config
31 menu "Configuration"
32 depends on PACKAGE_vtun
33
34 config VTUN_config
35
36 depends on PACKAGE_vtun
37 config VTUN_LZO
38 bool "enable vtun compression"
39 help
40 vtun tunnels will be compressed
41 default y
42
43 config VTUN_SSL
44 bool "enable vtun ssl encryption"
45 help
46 vtun tunnels will be encrypted
47 default y
48 endmenu
49 endef
50
51 define Package/vtun/conffiles
52 /etc/vtund.conf
53 endef
54
55 CONFIGURE_ARGS += \
56 $(if $(CONFIG_VTUN_LZO),--with-lzo-lib="$(STAGING_DIR)/usr/lib/",--disable-zlib) \
57 $(if $(CONFIG_VTUN_LZO),--with-lzo-headers="$(STAGING_DIR)/usr/include/lzo",--disable-lzo) \
58 $(if $(CONFIG_VTUN_SSL),--with-ssl-headers="$(STAGING_DIR)/usr/lib/",--disable-ssl) \
59
60 CONFIGURE_VARS += \
61 LIBS="$(TARGET_LDFLAGS)" \
62 $(if $(CONFIG_VTUN_LZO),LZO_HDR_DIR="$(STAGING_DIR)/usr/include/lzo") \
63 $(if $(CONFIG_VTUN_SSL),BLOWFISH_HDR_DIR="$(STAGING_DIR)/usr/include/openssl") \
64 $(if $(CONFIG_VTUN_SSL),SSL_HDR_DIR="$(STAGING_DIR)/usr/include/openssl") \
65
66 define Build/Compile
67 $(call Build/Compile/Default,vtund)
68 endef
69
70 define Package/vtun/install
71 $(INSTALL_DIR) $(1)/etc
72 $(INSTALL_CONF) $(PKG_BUILD_DIR)/vtund.conf $(1)/etc/
73 $(INSTALL_DIR) $(1)/usr/sbin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vtund $(1)/usr/sbin/
75 endef
76
77 $(eval $(call BuildPackage,vtun))