summaryrefslogtreecommitdiff
path: root/package/netcat-openbsd
diff options
context:
space:
mode:
authorMaxime Hadjinlian <maxime.hadjinlian@gmail.com>2014-10-05 21:48:02 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-05 23:13:27 +0200
commit1218ab64d09c715ce985d2c957e24ed4ad1ca5f0 (patch)
treeb2cb6d6aed785e5b2682c30017c54780babf04bf /package/netcat-openbsd
parentf25a672f2df90917f935b069d0cb2417d457d510 (diff)
netcat-openbsd: new package
The OpenBSD implementations of netcat. The main difference from netcat is the support for IPv6, proxies, and Unix sockets. [Thomas: use tabs in the command applying Debian patches, add dependency on Busybox when enabled so that we override the 'nc' command installed by Busybox.] Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/netcat-openbsd')
-rw-r--r--package/netcat-openbsd/Config.in24
-rw-r--r--package/netcat-openbsd/netcat-openbsd.mk35
2 files changed, 59 insertions, 0 deletions
diff --git a/package/netcat-openbsd/Config.in b/package/netcat-openbsd/Config.in
new file mode 100644
index 000000000..16be610b0
--- /dev/null
+++ b/package/netcat-openbsd/Config.in
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_NETCAT_OPENBSD
+ bool "netcat-openbsd"
+ select BR2_PACKAGE_LIBBSD
+ depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ help
+ A simple Unix utility which reads and writes data across network
+ connections using TCP or UDP protocol. It is designed to be a
+ reliable "back-end" tool that can be used directly or easily driven
+ by other programs and scripts. At the same time it is a feature-rich
+ network debugging and exploration tool, since it can create almost
+ any kind of connection you would need and has several interesting
+ built-in capabilities.
+
+ This package contains the OpenBSD rewrite of netcat, including
+ support for IPv6, proxies, and Unix sockets.
+
+ https://packages.debian.org/sid/netcat-openbsd
+
+comment "netcat-openbsd needs an (e)glibc toolchain w/ threads"
+ depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS
+ depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_USES_GLIBC
+~
diff --git a/package/netcat-openbsd/netcat-openbsd.mk b/package/netcat-openbsd/netcat-openbsd.mk
new file mode 100644
index 000000000..64fb7f083
--- /dev/null
+++ b/package/netcat-openbsd/netcat-openbsd.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# netcat-openbsd
+#
+################################################################################
+
+NETCAT_OPENBSD_VERSION = debian/1.105-7
+NETCAT_OPENBSD_SITE = git://anonscm.debian.org/collab-maint/netcat-openbsd
+NETCAT_OPENBSD_LICENSE = BSD-3c
+NETCAT_OPENBSD_LICENSE_FILE = debian/copyright
+NETCAT_OPENBSD_DEPENDENCIES = host-pkgconf libbsd
+
+# Ensure Busybox gets built/installed before, so that this package
+# overrides Busybox nc.
+ifeq ($(BR2_PACKAGE_BUSYBOX),y)
+NETCAT_OPENBSD_DEPENDENCIES += busybox
+endif
+
+define NETCAT_OPENBSD_APPLY_DEBIAN_PATCHES
+ if [ -d $(@D)/debian/patches ]; then \
+ support/scripts/apply-patches.sh $(@D) $(@D)/debian/patches *.dpatch; \
+ fi
+endef
+
+NETCAT_OPENBSD_POST_PATCH_HOOKS += NETCAT_OPENBSD_APPLY_DEBIAN_PATCHES
+
+define NETCAT_OPENBSD_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define NETCAT_OPENBSD_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 755 -D $(@D)/nc $(TARGET_DIR)/usr/bin/nc
+endef
+
+$(eval $(generic-package))