Made OpenVPN uci-aware (patch from xmff)
[openwrt/svn-archive/archive.git] / net / openvpn / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=openvpn
12 PKG_VERSION:=2.0.9
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn
17 PKG_MD5SUM:=60745008b90b7dbe25fe8337c550fec6
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/openvpn
22 SECTION:=net
23 CATEGORY:=Network
24 DEPENDS:=+kmod-tun +libopenssl +liblzo
25 TITLE:=Open source VPN solution using SSL
26 URL:=http://openvpn.net
27 SUBMENU:=VPN
28 endef
29
30 define Package/openvpn/conffiles
31 /etc/config/openvpn
32 endef
33
34 define Package/openvpn/description
35 Open source VPN solution using SSL
36 endef
37
38 define Package/openvpn-easy-rsa
39 $(call Package/openvpn)
40 DEPENDS:=openvpn +openssl-util
41 TITLE:=Simple shell scripts to manage a Certificate Authority
42 endef
43
44 define Package/openvpn-easy-rsa/conffiles
45 /etc/easy-rsa/keys/serial
46 /etc/easy-rsa/keys/index.txt
47 /etc/easy-rsa/vars
48 endef
49
50 define Build/Configure
51 $(call Build/Configure/Default, \
52 --disable-pthread \
53 --disable-debug \
54 --disable-plugins \
55 --enable-management \
56 --disable-socks \
57 --enable-password-save \
58 ,\
59 ac_cv_func_epoll_create=no \
60 )
61 endef
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 DESTDIR="$(PKG_INSTALL_DIR)" \
66 all install
67 endef
68
69 define Package/openvpn/install
70 $(INSTALL_DIR) $(1)/usr/sbin
71 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(1)/usr/sbin/
72 $(INSTALL_DIR) $(1)/etc/init.d/
73 $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
74 $(INSTALL_DIR) $(1)/etc/config
75 $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
76 endef
77
78 define Package/openvpn-easy-rsa/install
79 $(INSTALL_DIR) $(1)/usr/sbin
80 $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/
81 $(INSTALL_DIR) $(1)/etc/easy-rsa
82 $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl.cnf $(1)/etc/easy-rsa/openssl.cnf
83 $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars
84 $(INSTALL_DIR) $(1)/etc/easy-rsa/keys
85 $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt
86 $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial
87 endef
88
89 $(eval $(call BuildPackage,openvpn))
90 $(eval $(call BuildPackage,openvpn-easy-rsa))