Add an init script as well as a default options file, make it more fancy and ready...
[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:=1
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 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/openvpn
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+kmod-tun +libopenssl +liblzo
29 TITLE:=Open source VPN solution using SSL
30 DESCRIPTION:=\
31 Open source VPN solution using SSL
32 URL:=http://openvpn.net
33 endef
34
35 define Package/openvpn-easy-rsa
36 $(call Package/openvpn)
37 DEPENDS:=openvpn +openssl-util
38 TITLE:=Simple shell scripts to manage a Certificate Authority
39 endef
40
41 define Build/Configure
42 $(call Build/Configure/Default, \
43 --disable-pthread \
44 --disable-debug \
45 --disable-plugins \
46 --enable-management \
47 --disable-socks \
48 --enable-password-save \
49 )
50 endef
51
52 define Build/Compile
53 $(MAKE) -C $(PKG_BUILD_DIR) \
54 DESTDIR="$(PKG_INSTALL_DIR)" \
55 all install
56 endef
57
58 define Package/openvpn/install
59 $(INSTALL_DIR) $(1)/usr/sbin
60 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(1)/usr/sbin/
61 $(INSTALL_DIR) $(1)/etc/init.d/
62 $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
63 $(INSTALL_DIR) $(1)/etc/default
64 $(INSTALL_BIN) files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME)
65 endef
66
67 define Package/openvpn-easy-rsa/install
68 $(INSTALL_DIR) $(1)/usr/sbin
69 $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/
70 $(INSTALL_DIR) $(1)/etc/easy-rsa
71 install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl.cnf $(1)/etc/easy-rsa/openssl.cnf
72 install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars
73 endef
74
75 $(eval $(call BuildPackage,openvpn))
76 $(eval $(call BuildPackage,openvpn-easy-rsa))