7338a30f2c300b7f212468bc7357ea9acdfab680
[feed/packages.git] / net / ocserv / Makefile
1 #
2 # Copyright (C) 2007-2011 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:=ocserv
11 PKG_VERSION:=0.12.2
12 PKG_RELEASE:=1
13 PKG_USE_MIPS16:=0
14
15 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
17 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/ocserv/
18 PKG_HASH:=71ccf1dfe9e13a05d9dc1104256cad6ff91e7b7d8c07a02398842ce018a3897d
19
20 PKG_LICENSE:=GPLv2+
21 PKG_LICENSE_FILES:=COPYING
22 #PKG_FIXUP:=autoreconf
23
24 PKG_CONFIG_DEPENDS:= \
25 CONFIG_OCSERV_PAM \
26 CONFIG_OCSERV_SECCOMP \
27 CONFIG_OCSERV_PROTOBUF \
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/ocserv/config
32 source "$(SOURCE)/Config.in"
33 endef
34
35 define Package/ocserv
36 SECTION:=net
37 CATEGORY:=Network
38 SUBMENU:=VPN
39 TITLE:=OpenConnect VPN server
40 URL:=http://www.infradead.org/ocserv/
41 MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
42 DEPENDS:= +OCSERV_RADIUS:libradcli +OCSERV_HTTP_PARSER:libhttp-parser +OCSERV_SECCOMP:libseccomp +libgnutls +certtool +libncurses +libreadline +OCSERV_PAM:libpam +OCSERV_PROTOBUF:libprotobuf-c +libev +kmod-tun
43 USERID:=ocserv=72:ocserv=72
44 endef
45
46 define Package/ocserv/description
47 OpenConnect server (ocserv) is an SSL VPN server. Its purpose is to be
48 a secure, small, fast and configurable VPN server. It implements the
49 OpenConnect SSL VPN protocol, and has also (currently experimental)
50 compatibility with clients using the AnyConnect SSL VPN protocol. The
51 OpenConnect VPN protocol uses the standard IETF security protocols such
52 as TLS 1.2, and Datagram TLS to provide the secure VPN service.
53 endef
54
55 EXTRA_CPPFLAGS+=-I$(STAGING_DIR)/usr/include/readline/
56 EXTRA_LDFLAGS+=-lncurses
57
58 CONFIGURE_ARGS+= \
59 --with-pager="" \
60 --with-libreadline-prefix="$(STAGING_DIR)/" \
61 --without-libnl \
62 --without-gssapi \
63 --with-libcrypt-prefix="$(STAGING_DIR)/" \
64 --with-libev-prefix="$(STAGING_DIR)/" \
65 --without-lz4 \
66 --with-local-talloc \
67
68 ifneq ($(CONFIG_OCSERV_PAM),y)
69 CONFIGURE_ARGS += --without-pam
70 endif
71
72 ifneq ($(CONFIG_OCSERV_RADIUS),y)
73 CONFIGURE_ARGS += --without-radius
74 endif
75
76 ifneq ($(CONFIG_OCSERV_SECCOMP),y)
77 CONFIGURE_ARGS += --disable-seccomp
78 endif
79
80 ifneq ($(CONFIG_OCSERV_PROTOBUF),y)
81 CONFIGURE_ARGS += --without-protobuf
82 endif
83
84 ifneq ($(CONFIG_OCSERV_HTTP_PARSER),y)
85 CONFIGURE_ARGS += --without-http-parser
86 endif
87
88 define Package/ocserv/conffiles
89 /etc/config/ocserv
90 endef
91
92 define Package/ocserv/install
93 $(INSTALL_DIR) $(1)/usr/sbin
94 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ocserv $(1)/usr/sbin/
95 $(INSTALL_DIR) $(1)/usr/bin
96 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ocserv-fw $(1)/usr/bin/
97 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ocpasswd/ocpasswd $(1)/usr/bin/
98 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/occtl/occtl $(1)/usr/bin/
99 $(INSTALL_DIR) $(1)/etc/init.d
100 $(INSTALL_BIN) ./files/ocserv.init $(1)/etc/init.d/ocserv
101 $(INSTALL_DIR) $(1)/etc/ocserv
102 $(INSTALL_CONF) ./files/ocserv.conf.template $(1)/etc/ocserv/ocserv.conf.template
103 $(INSTALL_DIR) $(1)/etc/config
104 $(INSTALL_CONF) ./files/config $(1)/etc/config/ocserv
105 $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
106 $(INSTALL_DATA) ./files/ocserv.upgrade $(1)/lib/upgrade/keep.d/ocserv
107 endef
108
109 $(eval $(call BuildPackage,ocserv))