Skip to contentSkip to conversation

netcat-openbsd: new package

PATCH Superseded Maxime Hadjinlian 2 participants 2 messages Oct 5, 2014

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 netcat-openbsd: new package

The OpenBSD implementations of netcat.
The main difference from netcat is the support for IPv6, proxies, and Unix sockets.

---
v2 -> v3:
- Use the debian git tree
- Remove the patch and uses a hook to apply them
- Set the license_file
v1 -> v2:
- Add missing license

---
 package/Config.in                        |  1 +
 package/netcat-openbsd/Config.in         | 16 ++++++++++++++++
 package/netcat-openbsd/netcat-openbsd.mk | 29 +++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 package/netcat-openbsd/Config.in
 create mode 100644 package/netcat-openbsd/netcat-openbsd.mk
package/Config.in +1 -0
index f488728..de10d4f 100644
@@ -1025,6 +1025,7 @@ endif
 	source "package/netatalk/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/netcat/Config.in"
+	source "package/netcat-openbsd/Config.in"
 endif
 	source "package/netplug/Config.in"
 	source "package/netsnmp/Config.in"
package/netcat-openbsd/Config.in new file +16 -0
new file mode 100644
index 0000000..3c44d6a
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_NETCAT_OPENBSD
+	bool "netcat-openbsd"
+	select BR2_PACKAGE_LIBBSD
+	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
package/netcat-openbsd/netcat-openbsd.mk new file +29 -0
new file mode 100644
index 0000000..471ebe7
@@ -0,0 +1,29 @@
+################################################################################
+#
+# 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 = libbsd
+
+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
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
+endef
+
+define NETCAT_OPENBSD_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -D $(@D)/nc $(TARGET_DIR)/usr/bin/nc
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.1.1
#1 lore raw

PATCH v3 1/1 netcat-openbsd: new package

Dear Maxime Hadjinlian,

Quoted 5 lines · Maxime Hadjinlian

The OpenBSD implementations of netcat.
The main difference from netcat is the support for IPv6, proxies, and Unix sockets.

Is the IPv6 support properly optional? Did you try building this tool with basic toolchain configurations such as:

http://autobuild.buildroot.org/toolchains/configs/br-arm-basic.config
http://autobuild.buildroot.org/toolchains/configs/br-arm-full-nothread.config

package/netcat-openbsd/Config.in line 3

Quoted 9 lines
package/netcat-openbsd/Config.in new file +3 -0
new file mode 100644
index 0000000..3c44d6a
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_NETCAT_OPENBSD
+	bool "netcat-openbsd"
+	select BR2_PACKAGE_LIBBSD

You need to propagate the dependencies of libbsd.

Quoted 18 lines
package/netcat-openbsd/netcat-openbsd.mk new file +12 -0
new file mode 100644
index 0000000..471ebe7
@@ -0,0 +1,29 @@
+################################################################################
+#
+# 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 = libbsd
+

package/netcat-openbsd/netcat-openbsd.mk line 22

Quoted 10 lines
package/netcat-openbsd/netcat-openbsd.mk new file +10 -0
+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
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)

$(TARGET_MAKE_ENV) please.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com