Просмотр исходного кода

aiccu: import from oldpackages

Signed-off-by: Ondrej Caletka <ondrej@caletka.cz>
Ondřej Caletka 10 лет назад
Родитель
Сommit
7bf4be7da8

+ 51
- 0
ipv6/aiccu/Makefile Просмотреть файл

@@ -0,0 +1,51 @@
1
+#
2
+# Copyright (C) 2006-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:=aiccu
11
+PKG_VERSION:=20070115
12
+PKG_RELEASE:=10
13
+
14
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix
16
+PKG_MD5SUM:=c9bcc83644ed788e22a7c3f3d4021350
17
+
18
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
19
+
20
+include $(INCLUDE_DIR)/package.mk
21
+
22
+define Package/aiccu
23
+  SECTION:=net
24
+  CATEGORY:=Network
25
+  DEPENDS:=+libpthread +ip +kmod-sit +kmod-tun
26
+  TITLE:=SixXS Automatic IPv6 Connectivity Client Utility
27
+  URL:=http://www.sixxs.net/tools/aiccu/
28
+endef
29
+
30
+define Build/Configure
31
+	$(SED) "s,strip,/bin/true," $(PKG_BUILD_DIR)/unix-console/Makefile
32
+endef
33
+
34
+define Build/Compile
35
+	$(MAKE) -C $(PKG_BUILD_DIR) \
36
+		CC="$(TARGET_CC)" OS_NAME="Linux" OS_VERSION="$(LINUX_VERSION)" \
37
+		EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
38
+		EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -pthread" \
39
+		DEBUG=0
40
+endef
41
+
42
+define Package/aiccu/conffiles
43
+/etc/config/aiccu
44
+endef
45
+
46
+define Package/aiccu/install
47
+	$(INSTALL_DIR) $(1)/usr/sbin
48
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/unix-console/$(PKG_NAME) $(1)/usr/sbin/
49
+endef
50
+
51
+$(eval $(call BuildPackage,aiccu))

+ 101
- 0
ipv6/aiccu/patches/100-cross_compile.patch Просмотреть файл

@@ -0,0 +1,101 @@
1
+--- aiccu/unix-console/Makefile.orig	2007-09-02 23:19:39.000000000 +0200
2
++++ aiccu/unix-console/Makefile	2007-09-02 23:20:11.000000000 +0200
3
+@@ -25,7 +25,8 @@
4
+ # CWARNS += -Wpacked
5
+ 
6
+ #CFLAGS	+= $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0
7
+-CFLAGS	+= $(CWARNS) -D_GNU_SOURCE
8
++CFLAGS	+= $(CWARNS) $(EXTRA_CFLAGS) -D_GNU_SOURCE
9
++LDFLAGS += $(EXTRA_LDFLAGS)
10
+ CC      = @gcc
11
+ RM      = rm
12
+ 
13
+@@ -40,25 +41,25 @@
14
+ # GnuTLS Support ?
15
+ # Used by TIC to secure that communication
16
+ # Currently defaultly builds only on Linux, but other platforms might easily also support it
17
+-ifeq ($(shell uname | grep -c "Linux"),1)
18
++ifneq ($(HAVE_GNUTLS),)
19
+ CFLAGS	+= -D AICCU_GNUTLS
20
+ LDFLAGS += -lgnutls
21
+ endif
22
+ 
23
+ # Linux
24
+-ifeq ($(shell uname | grep -c "Linux"),1)
25
++ifeq ($(OS_NAME),Linux)
26
+ CFLAGS  += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
27
+ SRCS	+= ../common/aiccu_linux.c
28
+ OBJS	+= ../common/aiccu_linux.o
29
+-LDFLAGS	+= -lpthread -lresolv
30
++LDFLAGS	+= -pthread -lresolv
31
+ endif
32
+ 
33
+ # FreeBSD
34
+-ifeq ($(shell uname | grep -c "FreeBSD"),1)
35
++ifeq ($(OS_NAME),FreeBSD)
36
+ CFLAGS	+= -D_FREEBSD
37
+ 
38
+ # FreeBSD 4.x
39
+-ifeq ($(shell uname -r | cut -c 1),4)
40
++ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4)
41
+ CFLAGS	+= -D AICCU_TYPE="\"freebsd4\""
42
+ SRCS	+= ../common/aiccu_freebsd4.c
43
+ OBJS	+= ../common/aiccu_freebsd4.o
44
+@@ -71,7 +72,7 @@
45
+ endif
46
+ 
47
+ # DragonFlyBSD
48
+-ifeq ($(shell uname | grep -c "DragonFly"),1)
49
++ifeq ($(OS_NAME),DragonFly)
50
+ CFLAGS	+= -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
51
+ SRCS	+= ../common/aiccu_freebsd4.c
52
+ OBJS	+= ../common/aiccu_freebsd4.o
53
+@@ -79,7 +80,7 @@
54
+ endif
55
+ 
56
+ # NetBSD
57
+-ifeq ($(shell uname | grep -c "NetBSD"),1)
58
++ifeq ($(OS_NAME),NetBSD)
59
+ CFLAGS	+= -D_NETBSD -D AICCU_TYPE="\"kame\""
60
+ 
61
+ # Check if net/if_tun.h has TUNSIFHEAD and enable support for it
62
+@@ -97,10 +98,10 @@
63
+ endif
64
+ 
65
+ # OpenBSD
66
+-ifeq ($(shell uname | grep -c "OpenBSD"),1)
67
++ifeq ($(OS_NAME),OpenBSD)
68
+ CFLAGS	+= -D_OPENBSD -D HAS_IFHEAD
69
+ # 2.7-2.9
70
+-ifeq ($(shell uname -r | cut -c 1),2)
71
++ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2)
72
+ CFLAGS	+= -D AICCU_TYPE="\"openbsd2\""
73
+ SRCS	+= ../common/aiccu_openbsd2.c
74
+ OBJS	+= ../common/aiccu_openbsd2.o
75
+@@ -114,7 +115,7 @@
76
+ endif
77
+ 
78
+ # Darwin
79
+-ifeq ($(shell uname | grep -c "Darwin"),1)
80
++ifeq ($(OS_NAME),Darwin)
81
+ CFLAGS	+= -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
82
+ SRCS	+= ../common/aiccu_darwin.c
83
+ OBJS	+= ../common/aiccu_darwin.o
84
+@@ -122,7 +123,7 @@
85
+ endif
86
+ 
87
+ # SunOS / Solaris
88
+-ifeq ($(shell uname | grep -c "SunOS"),1)
89
++ifeq ($(OS_NAME),SunOS)
90
+ CFLAGS	+= -D_SUNOS -D AICCU_TYPE="\"sunos\""
91
+ SRCS	+= ../common/aiccu_sunos.c
92
+ OBJS	+= ../common/aiccu_sunos.o
93
+@@ -130,7 +131,7 @@
94
+ endif
95
+ 
96
+ # AIX
97
+-ifeq ($(shell uname | grep -c "AIX"),1)
98
++ifeq ($(OS_NAME),AIX)
99
+ CC	= @/usr/vac/bin/xlc_r
100
+ CFLAGS	= -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
101
+ CFLAGS	+= -D AICCU_CONSOLE

+ 70
- 0
ipv6/aiccu/patches/200-add_dn_skipname.patch Просмотреть файл

@@ -0,0 +1,70 @@
1
+diff -Nru aiccu.old/common/dn_skipname.c aiccu/common/dn_skipname.c
2
+--- aiccu.old/common/dn_skipname.c	1970-01-01 02:00:00.000000000 +0200
3
++++ aiccu/common/dn_skipname.c	2006-11-04 00:50:23.000000000 +0200
4
+@@ -0,0 +1,51 @@
5
++#include <errno.h>
6
++#include <resolv.h>
7
++
8
++/* Ripped from glibc 2.4 sources. */
9
++
10
++/*
11
++ * ns_name_skip(ptrptr, eom)
12
++ *      Advance *ptrptr to skip over the compressed name it points at.
13
++ * return:
14
++ *      0 on success, -1 (with errno set) on failure.
15
++ */
16
++int ns_name_skip(const u_char **ptrptr, const u_char *eom)
17
++{
18
++	const u_char *cp;
19
++	u_int n;
20
++
21
++	cp = *ptrptr;
22
++	while (cp < eom && (n = *cp++) != 0)
23
++	{
24
++		/* Check for indirection. */
25
++		switch (n & NS_CMPRSFLGS) {
26
++		case 0:                 /* normal case, n == len */
27
++			cp += n;
28
++			continue;
29
++		case NS_CMPRSFLGS:      /* indirection */
30
++			cp++;
31
++			break;
32
++		default:                /* illegal type */
33
++			errno = EMSGSIZE;
34
++			return (-1);
35
++		}
36
++		break;
37
++	}
38
++	if (cp > eom)
39
++	{
40
++		errno = EMSGSIZE;
41
++		return (-1);
42
++	}
43
++	*ptrptr = cp;
44
++	return (0);
45
++}
46
++
47
++int dn_skipname(const u_char *ptr, const u_char *eom)
48
++{
49
++	const u_char *saveptr = ptr;
50
++
51
++	if(ns_name_skip(&ptr, eom) == -1)
52
++		return (-1);
53
++	return (ptr - saveptr);
54
++}
55
++
56
+diff -Nru aiccu.old/unix-console/Makefile aiccu/unix-console/Makefile
57
+--- aiccu.old/unix-console/Makefile	2006-11-04 00:51:20.000000000 +0200
58
++++ aiccu/unix-console/Makefile	2006-11-04 00:48:51.000000000 +0200
59
+@@ -10,9 +10,9 @@
60
+ #  $Date: 2006-07-25 09:20:48 $
61
+ # **********************************************************/
62
+ 
63
+-SRCS	= main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
64
++SRCS	= main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ../common/dn_skipname.c
65
+ INCS	= ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
66
+-OBJS	= main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
67
++OBJS	= main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ../common/dn_skipname.o
68
+ 
69
+ # New features not fully implemented and thus disabled for now
70
+ #CFLAGS	+= -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE

+ 29
- 0
ipv6/aiccu/patches/300-resolver-uclibc.patch Просмотреть файл

@@ -0,0 +1,29 @@
1
+--- aiccu/common/resolver.c.orig	2007-09-02 23:10:58.000000000 +0200
2
++++ aiccu/common/resolver.c	2007-09-02 23:11:01.000000000 +0200
3
+@@ -26,7 +26,7 @@
4
+ 
5
+ int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
6
+ {
7
+-#ifdef _LINUX
8
++#if defined(_LINUX) && !defined(__UCLIBC__)
9
+ 	struct __res_state	res;
10
+ #endif
11
+ 	unsigned char		answer[8192];
12
+@@ -38,7 +38,7 @@
13
+ 	uint16_t		type = 0, class = 0;
14
+ 	uint32_t		ttl = 0;
15
+ 
16
+-#ifdef _LINUX
17
++#if defined(_LINUX) && !defined(__UCLIBC__)
18
+ 	memset(&res, 0, sizeof(res));
19
+ 	res.options = RES_DEBUG;
20
+ 	res_ninit(&res);
21
+@@ -47,7 +47,7 @@
22
+ #endif
23
+ 
24
+ 	memset(answer, 0, sizeof(answer));
25
+-#ifdef _LINUX
26
++#if defined(_LINUX) && !defined(__UCLIBC__)
27
+ 	ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
28
+ #else
29
+ 	ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));