From 3ca45d253111b101476fdb3a9dae103947983145 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 31 Jul 2014 07:28:14 +0000 Subject: testing/connman: new aport An alternative daemon for managing internet connections on Linux http://connman.net/ --- testing/connman/APKBUILD | 60 ++++++++++++ testing/connman/libresolv.patch | 61 ++++++++++++ testing/connman/musl-fixes.patch | 207 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 328 insertions(+) create mode 100644 testing/connman/APKBUILD create mode 100644 testing/connman/libresolv.patch create mode 100644 testing/connman/musl-fixes.patch diff --git a/testing/connman/APKBUILD b/testing/connman/APKBUILD new file mode 100644 index 000000000..3bf806f13 --- /dev/null +++ b/testing/connman/APKBUILD @@ -0,0 +1,60 @@ +# Maintainer: Natanael Copa +pkgname=connman +pkgver=1.24 +pkgrel=0 +pkgdesc="An alternative daemon for managing internet connections on Linux" +url="http://connman.net/" +arch="all" +license="GPLv2" +depends="wpa_supplicant" +depends_dev="" +makedepends="$depends_dev glib-dev iptables-dev gnutls-dev readline-dev + dbus-dev" +install="" +subpackages="$pkgname-dev $pkgname-doc" +source="http://www.kernel.org/pub/linux/network/connman/connman-$pkgver.tar.xz + musl-fixes.patch + libresolv.patch + " + +_builddir="$srcdir"/connman-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done + update_config_sub +} + +build() { + cd "$_builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + rm -f "$pkgdir"/usr/lib/*.la +} + +md5sums="dd6e1b4d9b9a28d127edb9f9b58bdec1 connman-1.24.tar.xz +07b13030c281a0114cd376e094f1eb1c musl-fixes.patch +7ce81d8578903db13b92aae7479f0624 libresolv.patch" +sha256sums="551df7a5f0c6e4d69523dd2b3aa2c54525b323457d5135f64816215bad3dc24c connman-1.24.tar.xz +76b43bb4b0ee93434721e4aa0d1b6f4e45fbe5c33329286f6cb4f3cf458b6eed musl-fixes.patch +6a36a7d85d12d5ce927c741ca41ddb40a4eb5351dd0112cebc93134113641edb libresolv.patch" +sha512sums="12ed0b476e8b590602eb5eea6175404cb6e377aba3a061fe42a16548325e2ad1ac3e285e92b4e66bd430ba3766c84da884383abaed0c89dca2ca511d83c8d7b4 connman-1.24.tar.xz +aee4fd55447492edc0f4ee9f9c8fa4eb45a4b7eb158bd896cff31773a069c2aed1feeac0b4189ffd314b38275768601cb37b89f2fbbf12945410c9b7c7928c07 musl-fixes.patch +c258e747e13b86c81ae96ac1743abf0c1461b9053c5b386d594a49f0b1890f10d89bea92610762ff609a4cc5fea04a43fab83894702f552b05af400f01cb011e libresolv.patch" diff --git a/testing/connman/libresolv.patch b/testing/connman/libresolv.patch new file mode 100644 index 000000000..c28a7c1e3 --- /dev/null +++ b/testing/connman/libresolv.patch @@ -0,0 +1,61 @@ +musl does not implement res_ninit + +diff --exclude '*.*o' -ru connman-1.24.orig/gweb/gresolv.c connman-1.24/gweb/gresolv.c +--- connman-1.24.orig/gweb/gresolv.c 2014-07-18 20:17:25.000000000 -0300 ++++ connman-1.24/gweb/gresolv.c 2014-07-18 20:24:01.874669130 -0300 +@@ -874,8 +874,6 @@ + resolv->index = index; + resolv->nameserver_list = NULL; + +- res_ninit(&resolv->res); +- + return resolv; + } + +@@ -915,8 +913,6 @@ + + flush_nameservers(resolv); + +- res_nclose(&resolv->res); +- + g_free(resolv); + } + +@@ -1019,24 +1015,19 @@ + debug(resolv, "hostname %s", hostname); + + if (!resolv->nameserver_list) { +- int i; +- +- for (i = 0; i < resolv->res.nscount; i++) { +- char buf[100]; +- int family = resolv->res.nsaddr_list[i].sin_family; +- void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr; +- +- if (family != AF_INET && +- resolv->res._u._ext.nsaddrs[i]) { +- family = AF_INET6; +- sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr; ++ FILE *f = fopen("/etc/resolv.conf", "r"); ++ if (f) { ++ char line[256], *s; ++ int i; ++ while (fgets(line, sizeof(line), f)) { ++ if (strncmp(line, "nameserver", 10) || !isspace(line[10])) ++ continue; ++ for (s = &line[11]; isspace(s[0]); s++); ++ for (i = 0; s[i] && !isspace(s[i]); i++); ++ s[i] = 0; ++ g_resolv_add_nameserver(resolv, s, 53, 0); + } +- +- if (family != AF_INET && family != AF_INET6) +- continue; +- +- if (inet_ntop(family, sa_addr, buf, sizeof(buf))) +- g_resolv_add_nameserver(resolv, buf, 53, 0); ++ fclose(f); + } + + if (!resolv->nameserver_list) + diff --git a/testing/connman/musl-fixes.patch b/testing/connman/musl-fixes.patch new file mode 100644 index 000000000..4fce03d02 --- /dev/null +++ b/testing/connman/musl-fixes.patch @@ -0,0 +1,207 @@ +diff --git a/configure.ac b/configure.ac +index 805f02b..df211d0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -165,6 +165,7 @@ fi + AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no") + AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin") + ++AC_CHECK_HEADERS(execinfo.h) + AC_CHECK_HEADERS(resolv.h, dummy=yes, + AC_MSG_ERROR(resolver header files are required)) + AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [ +diff --git a/gdhcp/common.c b/gdhcp/common.c +index e111150..ee4dc43 100644 +--- a/gdhcp/common.c ++++ b/gdhcp/common.c +@@ -22,6 +22,7 @@ + #include + #endif + ++#define _GNU_SOURCE + #include + #include + #include +@@ -31,7 +32,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -39,6 +39,8 @@ + #include "gdhcp.h" + #include "common.h" + ++#include ++ + static const DHCPOption client_options[] = { + { OPTION_IP, 0x01 }, /* subnet-mask */ + { OPTION_IP | OPTION_LIST, 0x03 }, /* routers */ +@@ -435,10 +437,12 @@ static const struct in6_addr in6addr_all_dhcp_relay_agents_and_servers_mc = + IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS_MC_INIT; + + /* from netinet/in.h */ ++#if 0 + struct in6_pktinfo { + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ + unsigned int ipi6_ifindex; /* send/recv interface index */ + }; ++#endif + + int dhcpv6_send_packet(int index, struct dhcpv6_packet *dhcp_pkt, int len) + { +diff --git a/src/log.c b/src/log.c +index a693bd0..9054462 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -30,7 +30,9 @@ + #include + #include + #include ++#ifdef HAVE_EXECINFO_H + #include ++#endif + #include + + #include "connman.h" +@@ -112,6 +114,7 @@ void connman_debug(const char *format, ...) + + static void print_backtrace(unsigned int offset) + { ++#ifdef HAVE_EXECINFO_H + void *frames[99]; + size_t n_ptrs; + unsigned int i; +@@ -210,6 +213,7 @@ static void print_backtrace(unsigned int offset) + + close(outfd[1]); + close(infd[0]); ++#endif /* HAVE_EXECINFO_H */ + } + + static void signal_handler(int signo) +diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c +index c34e10a..eae66fc 100644 +--- a/tools/dhcp-test.c ++++ b/tools/dhcp-test.c +@@ -33,7 +33,6 @@ + #include + #include + #include +-#include + + #include + +diff --exclude '*.*o' -ru connman-1.24.orig/plugins/wifi.c connman-1.24/plugins/wifi.c +--- connman-1.24.orig/plugins/wifi.c 2014-06-07 21:46:22.000000000 -0300 ++++ connman-1.24/plugins/wifi.c 2014-07-18 20:37:16.811343663 -0300 +@@ -30,9 +30,8 @@ + #include + #include + #include +-#include +-#include + #include ++#include + + #ifndef IFF_LOWER_UP + #define IFF_LOWER_UP 0x10000 +diff --exclude '*.*o' -ru connman-1.24.orig/src/ntp.c connman-1.24/src/ntp.c +--- connman-1.24.orig/src/ntp.c 2014-06-07 21:46:22.000000000 -0300 ++++ connman-1.24/src/ntp.c 2014-07-18 20:38:12.144677543 -0300 +@@ -180,7 +180,7 @@ + msg.xmttime.fraction = htonl(transmit_timeval.tv_usec * 1000); + + len = sendto(fd, &msg, sizeof(msg), MSG_DONTWAIT, +- &addr, sizeof(addr)); ++ (struct sockaddr *) &addr, sizeof(addr)); + if (len < 0) { + connman_error("Time request for server %s failed (%d/%s)", + server, errno, strerror(errno)); +diff --exclude '*.*o' -ru connman-1.24.orig/src/tethering.c connman-1.24/src/tethering.c +--- connman-1.24.orig/src/tethering.c 2014-04-04 15:12:07.000000000 -0300 ++++ connman-1.24/src/tethering.c 2014-07-18 20:39:12.091344804 -0300 +@@ -31,10 +31,8 @@ + #include + #include + #include +-#include + #include + #include +-#include + #include + #include + +diff --exclude '*.*o' -ru connman-1.24.orig/tools/dnsproxy-test.c connman-1.24/tools/dnsproxy-test.c +--- connman-1.24.orig/tools/dnsproxy-test.c 2013-12-05 09:12:12.000000000 -0200 ++++ connman-1.24/tools/dnsproxy-test.c 2014-07-18 20:36:37.484676606 -0300 +@@ -24,6 +24,7 @@ + #endif + + #include ++#include + #include + #include + #include +diff --exclude '*.*o' -ru connman-1.24.orig/tools/private-network-test.c connman-1.24/tools/private-network-test.c +--- connman-1.24.orig/tools/private-network-test.c 2013-08-19 19:57:25.000000000 -0300 ++++ connman-1.24/tools/private-network-test.c 2014-07-18 20:28:42.644671909 -0300 +@@ -32,7 +32,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +diff --exclude '*.*o' -ru connman-1.24.orig/tools/tap-test.c connman-1.24/tools/tap-test.c +--- connman-1.24.orig/tools/tap-test.c 2013-12-05 09:12:12.000000000 -0200 ++++ connman-1.24/tools/tap-test.c 2014-07-18 20:28:35.351338499 -0300 +@@ -29,7 +29,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include +diff '--exclude=*.*o' -ru connman-1.24.orig/gweb/gresolv.c connman-1.24/gweb/gresolv.c +--- connman-1.24.orig/gweb/gresolv.c 2014-07-18 20:43:40.000000000 -0300 ++++ connman-1.24/gweb/gresolv.c 2014-07-18 20:44:43.284681413 -0300 +@@ -24,6 +24,7 @@ + #endif + + #include ++#include + #include + #include + #include +diff '--exclude=*.*o' -ru connman-1.24.orig/src/ippool.c connman-1.24/src/ippool.c +--- connman-1.24.orig/src/ippool.c 2014-04-04 15:12:07.000000000 -0300 ++++ connman-1.24/src/ippool.c 2014-07-18 20:44:56.068014872 -0300 +@@ -28,7 +28,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include "connman.h" +diff '--exclude=*.*o' -ru connman-1.24.orig/src/iptables.c connman-1.24/src/iptables.c +--- connman-1.24.orig/src/iptables.c 2014-04-04 15:12:07.000000000 -0300 ++++ connman-1.24/src/iptables.c 2014-07-18 20:44:25.844681240 -0300 +@@ -28,7 +28,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + + -- cgit v1.2.3