|
@@ -0,0 +1,154 @@
|
|
1
|
+#
|
|
2
|
+# Copyright (C) 2008-2014 Christian Pointner,
|
|
3
|
+# <equinox@anytun.org>
|
|
4
|
+#
|
|
5
|
+# This is free software, licensed under the GNU General Public License v2.
|
|
6
|
+# See /LICENSE for more information.
|
|
7
|
+#
|
|
8
|
+# This Makefile builds uAnytun Package for OpenWRT
|
|
9
|
+#
|
|
10
|
+# $Id: $
|
|
11
|
+
|
|
12
|
+include $(TOPDIR)/rules.mk
|
|
13
|
+
|
|
14
|
+PKG_NAME:=uanytun
|
|
15
|
+PKG_VERSION:=0.3.5
|
|
16
|
+PKG_RELEASE:=1
|
|
17
|
+
|
|
18
|
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
19
|
+PKG_SOURCE_URL:=http://www.anytun.org/download/
|
|
20
|
+PKG_MD5SUM:=ce47ad45003ff1d84eaf5276941b9ddf
|
|
21
|
+
|
|
22
|
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
23
|
+
|
|
24
|
+include $(INCLUDE_DIR)/package.mk
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+define Package/uanytun/template
|
|
28
|
+ SECTION:=net
|
|
29
|
+ CATEGORY:=Network
|
|
30
|
+ SUBMENU:=VPN
|
|
31
|
+ DEPENDS:=+kmod-tun
|
|
32
|
+ TITLE:=micro anycast tunneling daemon
|
|
33
|
+ URL:=http://www.anytun.org/
|
|
34
|
+ MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
|
|
35
|
+endef
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+define Package/uanytun
|
|
39
|
+ $(call Package/uanytun/template)
|
|
40
|
+ TITLE+= (nettle)
|
|
41
|
+ VARIANT:=nettle
|
|
42
|
+ DEPENDS+=+libnettle
|
|
43
|
+endef
|
|
44
|
+
|
|
45
|
+define Package/uanytun/conffiles
|
|
46
|
+/etc/config/uanytun
|
|
47
|
+endef
|
|
48
|
+
|
|
49
|
+define Package/uanytun/description
|
|
50
|
+uAnytun is a tiny implementation of SATP the secure anycast tunneling protocol.
|
|
51
|
+ SATP defines a protocol used for communication between any combination of
|
|
52
|
+ unicast and anycast tunnel endpoints. It has less protocol overhead than
|
|
53
|
+ IPSec in Tunnel mode and allows tunneling of every ETHER TYPE protocol (e.g.
|
|
54
|
+ ethernet, ip, arp ...). SATP directly includes cryptography and message
|
|
55
|
+ authentication based on the methods used by SRTP. It is intended to deliver
|
|
56
|
+ a generic, scaleable and secure solution for tunneling and relaying of packets
|
|
57
|
+ of any protocol.
|
|
58
|
+ Unlike Anytun which is a full featured implementation uAnytun has no support
|
|
59
|
+ for multiple connections or synchronisation. It is a small single threaded
|
|
60
|
+ implementation intended to act as a client on small platforms.
|
|
61
|
+endef
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+define Package/uanytun-sslcrypt
|
|
65
|
+ $(call Package/uanytun/template)
|
|
66
|
+ TITLE+= (openssl)
|
|
67
|
+ VARIANT:=sslcrypt
|
|
68
|
+ DEPENDS+=+libopenssl
|
|
69
|
+endef
|
|
70
|
+
|
|
71
|
+Package/uanytun-sslcrypt/conffiles=$(Package/uanytun/conffiles)
|
|
72
|
+Package/uanytun-sslcrypt/description=$(Package/uanytun/description)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+define Package/uanytun-nocrypt
|
|
76
|
+ $(call Package/uanytun/template)
|
|
77
|
+ TITLE+= (no crypt)
|
|
78
|
+ VARIANT:=nocrypt
|
|
79
|
+endef
|
|
80
|
+
|
|
81
|
+Package/uanytun-nocrypt/conffiles=$(Package/uanytun/conffiles)
|
|
82
|
+Package/uanytun-nocrypt/description=$(Package/uanytun/description)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+define Build/Configure
|
|
87
|
+ (cd $(PKG_BUILD_DIR)/src; \
|
|
88
|
+ touch include.mk; \
|
|
89
|
+ ln -s linux/tun.c .; \
|
|
90
|
+ echo '#ifndef UANYTUN_version_h_INCLUDED' > version.h; \
|
|
91
|
+ echo '#define UANYTUN_version_h_INCLUDED' >> version.h; \
|
|
92
|
+ echo '' >> version.h; \
|
|
93
|
+ echo '#define VERSION_STRING_0 "uanytun version '`cat $(PKG_BUILD_DIR)/version`'"' >> version.h; \
|
|
94
|
+ echo '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> version.h; \
|
|
95
|
+ echo '' >> version.h; \
|
|
96
|
+ echo '#endif' >> version.h \
|
|
97
|
+ )
|
|
98
|
+endef
|
|
99
|
+
|
|
100
|
+VARIANT_CFLAGS:=
|
|
101
|
+VARIANT_LDFLAGS:=-ldl
|
|
102
|
+VARIANT_MAKE_OPTS:=
|
|
103
|
+
|
|
104
|
+ifeq ($(BUILD_VARIANT),nettle)
|
|
105
|
+VARIANT_CFLAGS+=-DUSE_NETTLE
|
|
106
|
+VARIANT_LDFLAGS+=-lnettle
|
|
107
|
+endif
|
|
108
|
+
|
|
109
|
+ifeq ($(BUILD_VARIANT),sslcrypt)
|
|
110
|
+VARIANT_CFLAGS+=-DUSE_SSL_CRYPTO
|
|
111
|
+VARIANT_LDFLAGS+=-lcrypto
|
|
112
|
+endif
|
|
113
|
+
|
|
114
|
+ifeq ($(BUILD_VARIANT),nocrypt)
|
|
115
|
+VARIANT_CFLAGS+=-DNO_CRYPT
|
|
116
|
+VARIANT_MAKE_OPTS+=NO_CRYPT_OBJ=1
|
|
117
|
+endif
|
|
118
|
+
|
|
119
|
+define Build/Compile
|
|
120
|
+ $(MAKE) -C $(PKG_BUILD_DIR)/src \
|
|
121
|
+ $(TARGET_CONFIGURE_OPTS) \
|
|
122
|
+ $(VARIANT_MAKE_OPTS) \
|
|
123
|
+ TARGET=Linux \
|
|
124
|
+ CFLAGS="$(TARGET_CFLAGS) $(VARIANT_CFLAGS)" \
|
|
125
|
+ LDFLAGS="$(TARGET_LDFLAGS) $(VARIANT_LDFLAGS)"
|
|
126
|
+ $(STRIP) $(PKG_BUILD_DIR)/src/uanytun
|
|
127
|
+endef
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+define Package/uanytun/install-generic
|
|
131
|
+ $(INSTALL_DIR) $(1)/etc/config
|
|
132
|
+ $(INSTALL_DATA) ./files/$(2) $(1)/etc/config/$(PKG_NAME)
|
|
133
|
+ $(INSTALL_DIR) $(1)/usr/sbin
|
|
134
|
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/uanytun $(1)/usr/sbin/$(PKG_NAME)
|
|
135
|
+ $(INSTALL_DIR) $(1)/etc/init.d
|
|
136
|
+ $(INSTALL_BIN) ./files/uanytun.init $(1)/etc/init.d/$(PKG_NAME)
|
|
137
|
+endef
|
|
138
|
+
|
|
139
|
+define Package/uanytun/install
|
|
140
|
+ $(call Package/uanytun/install-generic,$(1),uanytun.config)
|
|
141
|
+endef
|
|
142
|
+
|
|
143
|
+define Package/uanytun-sslcrypt/install
|
|
144
|
+ $(call Package/uanytun/install-generic,$(1),uanytun.config)
|
|
145
|
+endef
|
|
146
|
+
|
|
147
|
+define Package/uanytun-nocrypt/install
|
|
148
|
+ $(call Package/uanytun/install-generic,$(1),uanytun-nocrypt.config)
|
|
149
|
+endef
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+$(eval $(call BuildPackage,uanytun))
|
|
153
|
+$(eval $(call BuildPackage,uanytun-sslcrypt))
|
|
154
|
+$(eval $(call BuildPackage,uanytun-nocrypt))
|