From 215966a6113a38ffdea61ebd471b618a018aa75d Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 5 Sep 2014 16:01:06 +0000 Subject: [PATCH] libnatpmp: added a recipe for version 20140401 --- net-libs/libnatpmp/libnatpmp-20140401.recipe | 64 +++++++++++++++++++ .../patches/libnatpmp-20140401.patchset | 36 +++++++++++ 2 files changed, 100 insertions(+) create mode 100644 net-libs/libnatpmp/libnatpmp-20140401.recipe create mode 100644 net-libs/libnatpmp/patches/libnatpmp-20140401.patchset diff --git a/net-libs/libnatpmp/libnatpmp-20140401.recipe b/net-libs/libnatpmp/libnatpmp-20140401.recipe new file mode 100644 index 000000000..fc091fec2 --- /dev/null +++ b/net-libs/libnatpmp/libnatpmp-20140401.recipe @@ -0,0 +1,64 @@ +SUMMARY="NAT-PMP client library" +DESCRIPTION=" +libnatpmp is a portable client library implementing the protocol NAT-PMP. It \ +is based on non blocking sockets and all call of the API are asynchronous. +" +HOMEPAGE="http://miniupnp.free.fr/libnatpmp.html" +COPYRIGHT=" + 2007-2009 Thomas Bernard +" +LICENSE="BSD (3-clause)" +SRC_URI="http://miniupnp.free.fr/files/download.php?file=libnatpmp-$portVersion.tar.gz" +SRC_FILENAME="libnatpmp-$portVersion.tar.gz" +CHECKSUM_SHA256="b2ce5e626a21c795cba2d118f26e54aaa89de29d4611c440fafc49a2a5bedabb" +REVISION="1" +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86_gcc2 x86" + +PATCHES="libnatpmp-$portVersion.patchset" + +PROVIDES=" + libnatpmp$secondaryArchSuffix = $portVersion + lib:libnatpmp$secondaryArchSuffix = 1 + cmd:natpmpc + " +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +BUILD() +{ + make $jobArgs +} + +INSTALL() +{ + make install INSTALLPREFIX=$prefix + + mkdir -p $(dirname $includeDir) + mv $prefix/include $includeDir + + prepareInstalledDevelLibs libnatpmp + + # devel package + packageEntries devel \ + $developDir +} + +# ----- devel package ------------------------------------------------------- + +PROVIDES_devel=" + libnatpmp${secondaryArchSuffix}_devel = $portVersion + devel:libnatpmp$secondaryArchSuffix = 1 + " +REQUIRES_devel=" + libnatpmp$secondaryArchSuffix == $portVersion base + " diff --git a/net-libs/libnatpmp/patches/libnatpmp-20140401.patchset b/net-libs/libnatpmp/patches/libnatpmp-20140401.patchset new file mode 100644 index 000000000..6ffc0c626 --- /dev/null +++ b/net-libs/libnatpmp/patches/libnatpmp-20140401.patchset @@ -0,0 +1,36 @@ +From 71ea76c0f3842a048e6f004d291176a1399ca9f5 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Fri, 5 Sep 2014 15:37:36 +0000 +Subject: Haiku patch + + +diff --git a/Makefile b/Makefile +index b67b3e8..181a9ef 100644 +--- a/Makefile ++++ b/Makefile +@@ -55,6 +55,9 @@ else + SONAMEFLAGS=-Wl,-soname,$(JNISHAREDLIB) + endif + endif ++ifeq ($(OS), Haiku) ++LDFLAGS += -lnetwork ++endif + + HEADERS = natpmp.h + +diff --git a/getgateway.c b/getgateway.c +index 45c6e6f..dd73356 100644 +--- a/getgateway.c ++++ b/getgateway.c +@@ -67,7 +67,7 @@ POSSIBILITY OF SUCH DAMAGE. + #undef USE_SYSCTL_NET_ROUTE + #endif + +-#if !defined(USE_PROC_NET_ROUTE) && !defined(USE_SOCKET_ROUTE) && !defined(USE_SYSCTL_NET_ROUTE) ++#if !defined(USE_PROC_NET_ROUTE) && !defined(USE_SOCKET_ROUTE) && !defined(USE_SYSCTL_NET_ROUTE) && !defined(__HAIKU__) + int getdefaultgateway(in_addr_t * addr) + { + return -1; +-- +1.8.3.4 +