source: branches/whiterussian/openwrt/package/openvpn/Makefile @ 3814

Last change on this file since 3814 was 3814, checked in by florian, 10 years ago

Fix OpenVPN typo for management option
Restore ifup order : lan wan wifi

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1# $Id$
2
3include $(TOPDIR)/rules.mk
4
5PKG_NAME:=openvpn
6PKG_VERSION:=2.0.7
7PKG_RELEASE:=1
8PKG_MD5SUM:=93528233f1f6d02fc18e2c00f82e0aca
9
10PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12PKG_CAT:=zcat
13
14PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17include $(TOPDIR)/package/rules.mk
18
19$(eval $(call PKG_template,OPENVPN,openvpn,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
20$(eval $(call PKG_template,OPENVPN_EASY_RSA,openvpn-easy-rsa,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
21$(eval $(call PKG_template,OPENVPN_WEBIF,openvpn-webif,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22
23PKG_DEPEND:="kmod-tun"
24ifneq ($(BR2_PACKAGE_OPENVPN_OPENSSL),y)
25DISABLE_OPENSSL:=--disable-ssl --disable-crypto
26else
27PKG_DEPEND+=", libopenssl"
28endif
29ifneq ($(BR2_PACKAGE_OPENVPN_LZO),y)
30DISABLE_LZO:=--disable-lzo
31else
32PKG_DEPEND+=", liblzo"
33endif
34ifneq ($(BR2_PACKAGE_OPENVPN_SERVER),y)
35DISABLE_SERVER:=--disable-server
36endif
37ifneq ($(BR2_PACKAGE_OPENVPN_HTTP),y)
38DISABLE_HTTP:=--disable-http
39endif
40ifeq ($(BR2_PACKAGE_OPENVPN_PASSWORD_SAVE),y)
41ENABLE_PASSWORD_SAVE:=--enable-password-save
42endif
43ifeq ($(BR2_PACKAGE_OPENVPN_SMALL),y)
44ENABLE_SMALL:=--enable-small
45endif
46ifneq ($(BR2_PACKAGE_OPENVPN_MANAGEMENT),y)
47DISABLE_MANAGEMENT:=--disable-management
48endif
49
50$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
51        (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
52                $(TARGET_CONFIGURE_OPTS) \
53                CFLAGS="$(strip $(TARGET_CFLAGS))" \
54                CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
55                LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
56                ./configure \
57                  --target=$(GNU_TARGET_NAME) \
58                  --host=$(GNU_TARGET_NAME) \
59                  --build=$(GNU_HOST_NAME) \
60                  --program-prefix="" \
61                  --program-suffix="" \
62                  --prefix=/usr \
63                  --exec-prefix=/usr \
64                  --bindir=/usr/bin \
65                  --datadir=/usr/share \
66                  --includedir=/usr/include \
67                  --infodir=/usr/share/info \
68                  --libdir=/usr/lib \
69                  --libexecdir=/usr/lib \
70                  --localstatedir=/var \
71                  --mandir=/usr/share/man \
72                  --sbindir=/usr/sbin \
73                  --sysconfdir=/etc \
74                  $(DISABLE_LARGEFILE) \
75                  $(DISABLE_NLS) \
76                  --enable-shared \
77                  --disable-static \
78                  --disable-pthread \
79                  --disable-debug \
80                  --disable-plugins \
81                  --disable-management \
82                  --disable-socks \
83                  $(DISABLE_LZO) \
84                  $(DISABLE_OPENSSL) \
85                  $(DISABLE_SERVER) \
86                  $(DISABLE_HTTP) \
87                  $(ENABLE_PASSWORD_SAVE) \
88                  $(ENABLE_SMALL) \
89                  $(DISABLE_MANAGEMENT) \
90        );
91        touch $(PKG_BUILD_DIR)/.configured
92
93$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
94        $(MAKE) -C $(PKG_BUILD_DIR)
95        mkdir -p $(PKG_INSTALL_DIR)
96        $(MAKE) -C $(PKG_BUILD_DIR) \
97                DESTDIR="$(PKG_INSTALL_DIR)" \
98                install
99        touch $(PKG_BUILD_DIR)/.built
100
101$(IPKG_OPENVPN):
102        install -d -m0755 $(IDIR_OPENVPN)/usr/sbin
103        cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(IDIR_OPENVPN)/usr/sbin/
104        $(RSTRIP) $(IDIR_OPENVPN)
105        echo "Depends: $(PKG_DEPEND)" >> $(IDIR_OPENVPN)/CONTROL/control
106        $(IPKG_BUILD) $(IDIR_OPENVPN) $(PACKAGE_DIR)
107
108$(IPKG_OPENVPN_EASY_RSA):
109        install -d -m0755 $(IDIR_OPENVPN_EASY_RSA)/usr/sbin $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa
110        cp -fpR $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req} $(IDIR_OPENVPN_EASY_RSA)/usr/sbin
111        install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl.cnf $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/openssl.cnf
112        install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/vars
113        $(IPKG_BUILD) $(IDIR_OPENVPN_EASY_RSA) $(PACKAGE_DIR)
114
115$(IPKG_OPENVPN_WEBIF):
116        install -d -m0755 $(IDIR_OPENVPN_WEBIF)/etc/init.d $(IDIR_OPENVPN_WEBIF)/www/cgi-bin/webif
117        install -m0755 ./files/S50openvpn $(IDIR_OPENVPN_WEBIF)/etc/init.d/S50openvpn
118        cp -fpR .files/openvpn{,-status}.sh $(IDIR_OPENVPN_WEBIF)/www/cgi-bin/webif/
119        $(IPKG_BUILD) $(IDIR_OPENVPN_WEBIF) $(PACKAGE_DIR)
Note: See TracBrowser for help on using the repository browser.