[packages] Use default templates instead of custom reimplementations where applicable
[openwrt/svn-archive/archive.git] / net / openvpn / 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:=openvpn
11 PKG_VERSION:=2.1.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn
16 PKG_MD5SUM:=452a83326ae198cf961e9ae02539c8fb
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/openvpn
23 SECTION:=net
24 CATEGORY:=Network
25 DEPENDS:=+kmod-tun +libopenssl +liblzo
26 TITLE:=Open source VPN solution using SSL
27 URL:=http://openvpn.net
28 SUBMENU:=VPN
29 endef
30
31 define Package/openvpn/conffiles
32 /etc/config/openvpn
33 endef
34
35 define Package/openvpn/description
36 Open source VPN solution using SSL
37 endef
38
39 define Package/openvpn-easy-rsa
40 $(call Package/openvpn)
41 DEPENDS:=openvpn +openssl-util
42 TITLE:=Simple shell scripts to manage a Certificate Authority
43 endef
44
45 define Package/openvpn-easy-rsa/conffiles
46 /etc/easy-rsa/keys/serial
47 /etc/easy-rsa/keys/index.txt
48 /etc/easy-rsa/vars
49 endef
50
51 define Build/Configure
52 $(call Build/Configure/Default, \
53 --disable-pthread \
54 --disable-debug \
55 --disable-plugins \
56 --enable-management \
57 --disable-socks \
58 --enable-password-save \
59 ,\
60 ac_cv_func_epoll_create=no \
61 )
62 endef
63
64 define Package/openvpn/install
65 $(INSTALL_DIR) $(1)/usr/sbin
66 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(1)/usr/sbin/
67 $(INSTALL_DIR) $(1)/etc/init.d/
68 $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
69 $(INSTALL_DIR) $(1)/etc/config
70 $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
71 $(INSTALL_DIR) $(1)/etc/openvpn
72 endef
73
74 define Package/openvpn-easy-rsa/install
75 $(INSTALL_DIR) $(1)/usr/sbin
76 $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/
77 $(INSTALL_DIR) $(1)/etc/easy-rsa
78 $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl.cnf $(1)/etc/easy-rsa/openssl.cnf
79 $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars
80 $(INSTALL_DIR) $(1)/etc/easy-rsa/keys
81 $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt
82 $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial
83 endef
84
85 $(eval $(call BuildPackage,openvpn))
86 $(eval $(call BuildPackage,openvpn-easy-rsa))