libdnet: initial import from old-packages
authorLuka Perkov <luka@openwrt.org>
Sun, 25 Jan 2015 18:43:17 +0000 (19:43 +0100)
committerLuka Perkov <luka@openwrt.org>
Sun, 25 Jan 2015 18:44:54 +0000 (19:44 +0100)
Signed-off-by: Luka Perkov <luka@openwrt.org>
libs/libdnet/Makefile [new file with mode: 0644]
libs/libdnet/patches/001-compile.patch [new file with mode: 0644]
libs/libdnet/patches/002-config.patch [new file with mode: 0644]

diff --git a/libs/libdnet/Makefile b/libs/libdnet/Makefile
new file mode 100644 (file)
index 0000000..08d3e20
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libdnet
+PKG_VERSION:=1.12
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://libdnet.googlecode.com/files/
+PKG_MD5SUM:=9253ef6de1b5e28e9c9a62b882e44cc9
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE:=BSD
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdnet
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Low-level network library
+  URL:=http://sourceforge.net/projects/libdnet/
+endef
+
+define Package/libdnet/description
+ libdnet is a library of simplified, portable interface to several low-level
+ networking routines.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --without-check \
+       --without-python
+
+CONFIGURE_VARS += \
+       ac_cv_dnet_bsd_bpf=no
+
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(2)/bin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/dnet-config \
+               $(2)/bin/
+       $(SED) \
+               's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+               $(2)/bin/dnet-config
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA)\
+               $(PKG_INSTALL_DIR)/usr/include/dnet.h \
+               $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/dnet \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libdnet.{la,a,so*} \
+               $(1)/usr/lib/
+endef
+
+define Package/libdnet/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/sbin/dnet \
+               $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,libdnet))
diff --git a/libs/libdnet/patches/001-compile.patch b/libs/libdnet/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..54223c9
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/config/config.sub
++++ b/config/config.sub
+@@ -228,7 +228,7 @@ case $basic_machine in
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+-      | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++      | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+@@ -290,7 +290,7 @@ case $basic_machine in
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+-      | avr-* \
++      | avr-* | avr32-* \
+       | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c54x-* \
+       | clipper-* | cydra-* \
diff --git a/libs/libdnet/patches/002-config.patch b/libs/libdnet/patches/002-config.patch
new file mode 100644 (file)
index 0000000..cde376a
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/dnet-config.in
++++ b/dnet-config.in
+@@ -45,10 +45,18 @@ while test $# -gt 0; do
+ done
+ if test "$echo_cflags" = "yes"; then
+-      echo -I@includedir@
++      includes=
++      if test "@includedir@" != "/usr/include" ; then
++             includes=-I@includedir@
++      fi
++      echo $includes
+ fi
+ if test "$echo_libs" = "yes"; then
+-      echo -L@libdir@ -ldnet @LIBS@
++      libs=
++      if test "@libdir@" != "/usr/lib" ; then
++             libs=-I@libdir@
++      fi
++      echo $libs -ldnet @LIBS@
+ fi