let ipkg fail when a package file to be installed is not found
[openwrt/svn-archive/archive.git] / openwrt / package / openvpn / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=openvpn
6 PKG_VERSION:=2.0.7
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=93528233f1f6d02fc18e2c00f82e0aca
9
10 PKG_SOURCE_URL:=http://openvpn.net/release @SF/openvpn
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(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
22 PKG_DEPEND:="kmod-tun"
23
24 ifneq ($(BR2_COMPILE_OPENVPN_WITH_OPENSSL),y)
25 DISABLE_OPENSSL:=--disable-ssl --disable-crypto
26 else
27 PKG_DEPEND+=", libopenssl"
28 endif
29
30 ifneq ($(BR2_COMPILE_OPENVPN_WITH_LZO),y)
31 DISABLE_LZO:=--disable-lzo
32 else
33 PKG_DEPEND+=", liblzo"
34 endif
35
36 ifneq ($(BR2_COMPILE_OPENVPN_WITH_SERVER),y)
37 DISABLE_SERVER:=--disable-server
38 endif
39 ifneq ($(BR2_COMPILE_OPENVPN_WITH_HTTP),y)
40 DISABLE_HTTP:=--disable-http
41 endif
42 ifeq ($(BR2_COMPILE_OPENVPN_WITH_PASSWORD_SAVE),y)
43 ENABLE_PASSWORD_SAVE:=--enable-password-save
44 endif
45 ifeq ($(BR2_COMPILE_OPENVPN_WITH_SMALL),y)
46 ENABLE_SMALL:=--enable-small
47 endif
48
49 $(PKG_BUILD_DIR)/.configured:
50 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
51 $(TARGET_CONFIGURE_OPTS) \
52 CFLAGS="$(strip $(TARGET_CFLAGS))" \
53 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
54 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
55 ./configure \
56 --target=$(GNU_TARGET_NAME) \
57 --host=$(GNU_TARGET_NAME) \
58 --build=$(GNU_HOST_NAME) \
59 --program-prefix="" \
60 --program-suffix="" \
61 --prefix=/usr \
62 --exec-prefix=/usr \
63 --bindir=/usr/bin \
64 --datadir=/usr/share \
65 --includedir=/usr/include \
66 --infodir=/usr/share/info \
67 --libdir=/usr/lib \
68 --libexecdir=/usr/lib \
69 --localstatedir=/var \
70 --mandir=/usr/share/man \
71 --sbindir=/usr/sbin \
72 --sysconfdir=/etc \
73 $(DISABLE_LARGEFILE) \
74 $(DISABLE_NLS) \
75 --enable-shared \
76 --disable-static \
77 --disable-pthread \
78 --disable-debug \
79 --disable-plugins \
80 --disable-management \
81 --disable-socks \
82 $(DISABLE_LZO) \
83 $(DISABLE_OPENSSL) \
84 $(DISABLE_SERVER) \
85 $(DISABLE_HTTP) \
86 $(ENABLE_PASSWORD_SAVE) \
87 $(ENABLE_SMALL) \
88 );
89 touch $(PKG_BUILD_DIR)/.configured
90
91 $(PKG_BUILD_DIR)/.built:
92 $(MAKE) -C $(PKG_BUILD_DIR)
93 mkdir -p $(PKG_INSTALL_DIR)
94 $(MAKE) -C $(PKG_BUILD_DIR) \
95 DESTDIR="$(PKG_INSTALL_DIR)" \
96 install
97 touch $(PKG_BUILD_DIR)/.built
98
99 $(IPKG_OPENVPN):
100 install -d -m0755 $(IDIR_OPENVPN)/usr/sbin
101 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/openvpn $(IDIR_OPENVPN)/usr/sbin/
102 $(RSTRIP) $(IDIR_OPENVPN)
103 echo "Depends: $(PKG_DEPEND)" >> $(IDIR_OPENVPN)/CONTROL/control
104 $(IPKG_BUILD) $(IDIR_OPENVPN) $(PACKAGE_DIR)
105
106 $(IPKG_OPENVPN_EASY_RSA):
107 install -d -m0755 $(IDIR_OPENVPN_EASY_RSA)/usr/sbin $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa
108 $(CP) $(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
109 install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl.cnf $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/openssl.cnf
110 install -m 0644 $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/vars
111 $(IPKG_BUILD) $(IDIR_OPENVPN_EASY_RSA) $(PACKAGE_DIR)