summaryrefslogtreecommitdiff
path: root/package/aiccu
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/aiccu
Initial import
Diffstat (limited to 'package/aiccu')
-rw-r--r--package/aiccu/Config.in12
-rw-r--r--package/aiccu/Makefile36
-rw-r--r--package/aiccu/extra/common/dn_skipname.c51
-rw-r--r--package/aiccu/files/aiccu.init27
-rw-r--r--package/aiccu/ipkg/aiccu.conffiles1
-rw-r--r--package/aiccu/ipkg/aiccu.control5
-rw-r--r--package/aiccu/ipkg/aiccu.postinst3
-rw-r--r--package/aiccu/patches/patch-common_resolver_c30
-rw-r--r--package/aiccu/patches/patch-unix-console_Makefile27
9 files changed, 192 insertions, 0 deletions
diff --git a/package/aiccu/Config.in b/package/aiccu/Config.in
new file mode 100644
index 000000000..202d3c1c6
--- /dev/null
+++ b/package/aiccu/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_AICCU
+ prompt "aiccu............................. SixXS Automatic IPv6 Connectivity Client Utility"
+ depends on ADK_IPV6
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_IPV6
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ SixXS Automatic IPv6 Connectivity Client Utility
+
+ For more information about SixXS check http://www.sixxs.net/
+
diff --git a/package/aiccu/Makefile b/package/aiccu/Makefile
new file mode 100644
index 000000000..948f8eab2
--- /dev/null
+++ b/package/aiccu/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= aiccu
+PKG_VERSION:= 20070115
+PKG_RELEASE:= 7
+PKG_MD5SUM:= c9bcc83644ed788e22a7c3f3d4021350
+
+MASTER_SITES:= http://www.sixxs.net/archive/sixxs/aiccu/unix/
+DISTFILES:= $(PKG_NAME)_$(PKG_VERSION).tar.gz
+
+WRKDIST= ${WRKDIR}/$(PKG_NAME)
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,AICCU,aiccu,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+TCFLAGS+= -D_REENTRANT -D_GNU_SOURCE -DAICCU_CONSOLE \
+ -D_LINUX -DHAS_IFHEAD -DAICCU_TYPE=\"linux\"
+TLDFLAGS+= -lpthread -lresolv
+BUILD_STYLE= auto
+MAKE_FLAGS+= CC='${TARGET_CC}' CFLAGS='${TCFLAGS}' LDFLAGS='${TLDFLAGS}'
+
+do-install:
+ $(INSTALL_DIR) $(IDIR_AICCU)/usr/sbin
+ $(INSTALL_DIR) $(IDIR_AICCU)/etc/init.d
+ $(INSTALL_BIN) $(WRKBUILD)/unix-console/aiccu $(IDIR_AICCU)/usr/sbin/
+ $(INSTALL_BIN) ./files/aiccu.init \
+ $(IDIR_AICCU)/etc/init.d/aiccu
+ $(INSTALL_DATA) $(WRKBUILD)/doc/aiccu.conf $(IDIR_AICCU)/etc/aiccu.conf
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/aiccu/extra/common/dn_skipname.c b/package/aiccu/extra/common/dn_skipname.c
new file mode 100644
index 000000000..f2219f335
--- /dev/null
+++ b/package/aiccu/extra/common/dn_skipname.c
@@ -0,0 +1,51 @@
+#include <errno.h>
+#include <resolv.h>
+
+/* Ripped from glibc 2.4 sources. */
+
+/*
+ * ns_name_skip(ptrptr, eom)
+ * Advance *ptrptr to skip over the compressed name it points at.
+ * return:
+ * 0 on success, -1 (with errno set) on failure.
+ */
+int ns_name_skip(const u_char **ptrptr, const u_char *eom)
+{
+ const u_char *cp;
+ u_int n;
+
+ cp = *ptrptr;
+ while (cp < eom && (n = *cp++) != 0)
+ {
+ /* Check for indirection. */
+ switch (n & NS_CMPRSFLGS) {
+ case 0: /* normal case, n == len */
+ cp += n;
+ continue;
+ case NS_CMPRSFLGS: /* indirection */
+ cp++;
+ break;
+ default: /* illegal type */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ break;
+ }
+ if (cp > eom)
+ {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *ptrptr = cp;
+ return (0);
+}
+
+int dn_skipname(const u_char *ptr, const u_char *eom)
+{
+ const u_char *saveptr = ptr;
+
+ if(ns_name_skip(&ptr, eom) == -1)
+ return (-1);
+ return (ptr - saveptr);
+}
+
diff --git a/package/aiccu/files/aiccu.init b/package/aiccu/files/aiccu.init
new file mode 100644
index 000000000..e678664bf
--- /dev/null
+++ b/package/aiccu/files/aiccu.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${aiccu:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ aiccu start
+ ;;
+stop)
+ aiccu stop
+ ;;
+
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/aiccu/ipkg/aiccu.conffiles b/package/aiccu/ipkg/aiccu.conffiles
new file mode 100644
index 000000000..79c42f998
--- /dev/null
+++ b/package/aiccu/ipkg/aiccu.conffiles
@@ -0,0 +1 @@
+/etc/aiccu.conf
diff --git a/package/aiccu/ipkg/aiccu.control b/package/aiccu/ipkg/aiccu.control
new file mode 100644
index 000000000..98bc6f1ba
--- /dev/null
+++ b/package/aiccu/ipkg/aiccu.control
@@ -0,0 +1,5 @@
+Package: aiccu
+Priority: optional
+Section: net
+Depends: kmod-ipv6, libpthread
+Description: SixXS Automatic IPv6 Connectivity Client Utility
diff --git a/package/aiccu/ipkg/aiccu.postinst b/package/aiccu/ipkg/aiccu.postinst
new file mode 100644
index 000000000..e6d0f0d9a
--- /dev/null
+++ b/package/aiccu/ipkg/aiccu.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf aiccu aiccu NO
diff --git a/package/aiccu/patches/patch-common_resolver_c b/package/aiccu/patches/patch-common_resolver_c
new file mode 100644
index 000000000..b0ec0d99c
--- /dev/null
+++ b/package/aiccu/patches/patch-common_resolver_c
@@ -0,0 +1,30 @@
+$Id$
+--- aiccu.orig/common/resolver.c Sun Jul 23 14:54:51 2006
++++ aiccu/common/resolver.c Mon Jun 25 13:18:22 2007
+@@ -26,7 +26,7 @@
+
+ int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
+ {
+-#ifdef _LINUX
++#if defined(_LINUX) && !defined(__UCLIBC__)
+ struct __res_state res;
+ #endif
+ unsigned char answer[8192];
+@@ -38,7 +38,7 @@ int getrrs(const char *label, int rrtype
+ uint16_t type = 0, class = 0;
+ uint32_t ttl = 0;
+
+-#ifdef _LINUX
++#if defined(_LINUX) && !defined(__UCLIBC__)
+ memset(&res, 0, sizeof(res));
+ res.options = RES_DEBUG;
+ res_ninit(&res);
+@@ -47,7 +47,7 @@ int getrrs(const char *label, int rrtype
+ #endif
+
+ memset(answer, 0, sizeof(answer));
+-#ifdef _LINUX
++#if defined(_LINUX) && !defined(__UCLIBC__)
+ ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
+ #else
+ ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
diff --git a/package/aiccu/patches/patch-unix-console_Makefile b/package/aiccu/patches/patch-unix-console_Makefile
new file mode 100644
index 000000000..fe7f87f20
--- /dev/null
+++ b/package/aiccu/patches/patch-unix-console_Makefile
@@ -0,0 +1,27 @@
+$Id$
+--- aiccu.orig/unix-console/Makefile Mon Jan 15 11:04:04 2007
++++ aiccu/unix-console/Makefile Mon Jun 25 13:19:42 2007
+@@ -10,9 +10,9 @@
+ # $Date: 2007-01-15 11:04:27 $
+ # **********************************************************/
+
+-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
++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
+ 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
+-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
++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
+
+ # New features not fully implemented and thus disabled for now
+ #CFLAGS += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE
+@@ -145,11 +145,6 @@ all: aiccu
+
+ aiccu: $(OBJS) ${SRCS} ${INCS}
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)
+-ifeq ($(shell echo $(CFLAGS) | grep -c "DEBUG"),0)
+-ifeq ($(shell echo "$(RPM_OPT_FLAGS)" | wc -c),1)
+- strip $@
+-endif
+-endif
+
+ clean:
+ $(RM) -f $(OBJS) aiccu