瀏覽代碼

radsecproxy: add package

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Toke Høiland-Jørgensen 10 年之前
父節點
當前提交
25b3404069

+ 57
- 0
net/radsecproxy/Makefile 查看文件

@@ -0,0 +1,57 @@
1
+#
2
+# Copyright (C) 2008-2012 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:=radsecproxy
11
+PKG_VERSION:=1.6.5
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/
16
+PKG_MD5SUM:=f74f82a7ae2cdf2b1d9d271a5c360617
17
+
18
+PKG_INSTALL:=1
19
+
20
+include $(INCLUDE_DIR)/package.mk
21
+
22
+define Package/radsecproxy
23
+  SECTION:=net
24
+  CATEGORY:=Network
25
+  DEPENDS:=+libopenssl +libpthread
26
+  TITLE:=radsecproxy
27
+  URL:=http://software.uninett.no/radsecproxy
28
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
29
+endef
30
+
31
+define Package/radsecproxy/description
32
+  A generic radius proxy for UDP/TLS (RadSec)
33
+endef
34
+
35
+CONFIGURE_ARGS+= \
36
+	--with-ssl="$(STAGING_DIR)/usr"
37
+
38
+#TARGET_CFLAGS += -ansi
39
+#TARGET_CFLAGS += -std=c99
40
+TARGET_CFLAGS += -Wno-long-long
41
+
42
+
43
+define Package/radsecproxy/install
44
+	$(INSTALL_DIR) $(1)/usr/sbin/
45
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radsecproxy $(1)/usr/sbin/
46
+	$(INSTALL_DIR) $(1)/etc/
47
+	$(CP) $(PKG_BUILD_DIR)/radsecproxy.conf-example $(1)/etc/radsecproxy.conf
48
+	$(INSTALL_DIR) $(1)/etc/init.d/
49
+	$(INSTALL_BIN) ./files/radsecproxy.init $(1)/etc/init.d/radsecproxy
50
+endef
51
+
52
+define Package/radsecproxy/conffiles
53
+/etc/radsecproxy.conf
54
+endef
55
+
56
+$(eval $(call BuildPackage,radsecproxy))
57
+

+ 16
- 0
net/radsecproxy/files/radsecproxy.init 查看文件

@@ -0,0 +1,16 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+
4
+START=70
5
+
6
+USE_PROCD=1
7
+PROG=/usr/sbin/radsecproxy
8
+CONFFILE=/etc/radsecproxy.conf
9
+
10
+start_service() {
11
+	procd_open_instance
12
+	procd_set_param command $PROG -f -c $CONFFILE
13
+	procd_set_param file $CONFFILE
14
+	procd_set_param respawn
15
+	procd_close_instance
16
+}

+ 58
- 0
net/radsecproxy/patches/100-missing-return.patch 查看文件

@@ -0,0 +1,58 @@
1
+--- a/dtls.c
2
++++ b/dtls.c
3
+@@ -523,6 +523,7 @@ void *udpdtlsserverrd(void *arg) {
4
+ 	free(params);
5
+ 	cacheexpire(sessioncache, &lastexpiry);
6
+     }
7
++    return NULL;
8
+ }
9
+ 
10
+ int dtlsconnect(struct server *server, struct timeval *when, int timeout, char *text) {
11
+@@ -642,6 +643,7 @@ void *udpdtlsclientrd(void *arg) {
12
+ 	if (udp2bio(s, conf->servers->rbios, cnt))
13
+ 	    debug(DBG_DBG, "radudpget: got DTLS in UDP from %s", addr2string((struct sockaddr *)&from));
14
+     }
15
++    return NULL;
16
+ }
17
+ 
18
+ void *dtlsclientrd(void *arg) {
19
+--- a/radsecproxy.c
20
++++ b/radsecproxy.c
21
+@@ -3203,6 +3203,8 @@ void *sighandler(void *arg) {
22
+             debug(DBG_WARN, "sighandler: ignoring signal %d", sig);
23
+         }
24
+     }
25
++
26
++    return NULL;
27
+ }
28
+ 
29
+ int createpidfile(const char *pidfile) {
30
+@@ -3289,6 +3291,8 @@ int radsecproxy_main(int argc, char **ar
31
+     /* just hang around doing nothing, anything to do here? */
32
+     for (;;)
33
+ 	sleep(1000);
34
++
35
++    return 0;
36
+ }
37
+ 
38
+ /* Local Variables: */
39
+--- a/udp.c
40
++++ b/udp.c
41
+@@ -266,6 +266,8 @@ void *udpclientrd(void *arg) {
42
+ 	buf = radudpget(*s, NULL, &server, NULL);
43
+ 	replyh(server, buf);
44
+     }
45
++
46
++    return NULL;
47
+ }
48
+ 
49
+ void *udpserverrd(void *arg) {
50
+@@ -310,6 +312,8 @@ void *udpserverwr(void *arg) {
51
+ 	debug(DBG_DBG, "udpserverwr: refcount %d", reply->refcount);
52
+ 	freerq(reply);
53
+     }
54
++
55
++    return NULL;
56
+ }
57
+ 
58
+ void addclientudp(struct client *client) {

+ 31
- 0
net/radsecproxy/patches/200-logdest-on-foreground.patch 查看文件

@@ -0,0 +1,31 @@
1
+diff --git a/radsecproxy.c b/radsecproxy.c
2
+index 563c4a8..9fa076d 100644
3
+--- a/radsecproxy.c
4
++++ b/radsecproxy.c
5
+@@ -3382,18 +3382,16 @@ int radsecproxy_main(int argc, char **argv) {
6
+ 	options.loglevel = loglevel;
7
+     else if (options.loglevel)
8
+ 	debug_set_level(options.loglevel);
9
+-    if (!foreground) {
10
+-	debug_set_destination(options.logdestination
11
+-                              ? options.logdestination
12
+-                              : "x-syslog:///", LOG_TYPE_DEBUG);
13
++    debug_set_destination(options.logdestination
14
++			  ? options.logdestination
15
++			  : "x-syslog:///", LOG_TYPE_DEBUG);
16
+ #if defined(WANT_FTICKS)
17
+-    	if (options.ftickssyslogfacility) {
18
+-            debug_set_destination(options.ftickssyslogfacility,
19
+-                                  LOG_TYPE_FTICKS);
20
+-            free(options.ftickssyslogfacility);
21
+-    	}
22
+-#endif
23
++    if (options.ftickssyslogfacility) {
24
++	debug_set_destination(options.ftickssyslogfacility,
25
++			      LOG_TYPE_FTICKS);
26
++	free(options.ftickssyslogfacility);
27
+     }
28
++#endif
29
+     free(options.logdestination);
30
+ 
31
+     if (!list_first(clconfs))