[packages] sshtunnel: Add SSH VPN support
[openwrt/svn-archive/archive.git] / net / quicktun / Makefile
1 #
2 # Copyright (C) 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:=quicktun
11 PKG_VERSION:=2.1.7
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=http://oss.ucis.nl/quicktun/src
16 PKG_MD5SUM:=6cf38b17218deb8c908cc17d91f9cbd7
17
18 PKG_BUILD_DEPENDS:=nacl
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/quicktun
23 SECTION:=net
24 CATEGORY:=Network
25 DEPENDS:=+kmod-tun
26 TITLE:=QuickTun is a simple and secure VPN software
27 URL:=http://wiki.ucis.nl/QuickTun
28 SUBMENU:=VPN
29 endef
30
31 define Package/quicktun/description
32 QuickTun is a simple and secure VPN software
33 endef
34
35 define Package/quicktun/conffiles
36 /etc/config/quicktun
37 endef
38
39 define Build/Compile
40 ( \
41 cd $(PKG_BUILD_DIR); \
42 mkdir -p obj out; \
43 \
44 export CPATH=$(STAGING_DIR)/usr/include/nacl; \
45 \
46 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/proto.raw.c -o obj/proto.raw.o; \
47 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/proto.nacl0.c -o obj/proto.nacl0.o; \
48 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/proto.nacltai.c -o obj/proto.nacltai.o; \
49 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c -DCOMBINED_BINARY src/run.combined.c -o obj/run.combined.o; \
50 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -c src/common.c -o obj/common.o; \
51 $(TARGET_CC) $(TARGET_LDFLAGS) -o out/quicktun.combined obj/common.o obj/run.combined.o obj/proto.raw.o obj/proto.nacl0.o obj/proto.nacltai.o \
52 -lnacl; \
53 \
54 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -o out/quicktun.keypair src/keypair.c -lnacl \
55 )
56 endef
57
58 define Package/quicktun/install
59 $(INSTALL_DIR) $(1)/usr/sbin
60 $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/quicktun.{combined,keypair} $(1)/usr/sbin/
61 $(LN) quicktun.combined $(1)/usr/sbin/quicktun
62
63 $(INSTALL_DIR) $(1)/etc/init.d/
64 $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
65 $(INSTALL_DIR) $(1)/etc/config
66 $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
67 endef
68
69 $(eval $(call BuildPackage,quicktun))