All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4] nmap: add option to build/install ncat
@ 2017-10-12 15:14 Carlos Santos
  2017-10-12 15:14 ` [Buildroot] [PATCH] netcat: add forced dependence on BusyBox Carlos Santos
  2018-04-02 13:32 ` [Buildroot] [PATCH v4] nmap: add option to build/install ncat Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Carlos Santos @ 2017-10-12 15:14 UTC (permalink / raw)
  To: buildroot

Ncat is a much-improved reimplementation of the venerable Netcat and is
compatible with uClibc and musl. It provides features not available in
the ancient GNU netcat and its Busybox double like IPv6, proxies, and
Unix sockets.

Tha nmap package now installs ncat if the BR2_PACKAGE_NMAP_NCAT option
is selected. The other programs (nmap, ndiff, etc.) are chosen via the
BR2_PACKAGE_NMAP_NMAP option.

We symlink 'nc' to ncat if neiter netcat nor netcat-openbsd is selected,
even though ncat does not have the same interface as netcat-openbsd.
However, since Fedora/RHEL install nmap-ncat as 'nc', it can be assumed
that packages that depend on 'nc' know how to deal with this diversity.
For example, the virt-manager package does that. Also user-supplied
scripts can be assumed to do the right thing, since the user also
selects whether nmap-ncat, netcat or netcat-openbsd is installed.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
Changes v1->v2:
  - Add dependens on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS, like netcat does
  - Remove forced dependence on busybox, since its installation script
    does not override existing programs.
Changes v2->v3:
  - Use a better logic to select either ncat tools, nmap or both, as
    suggested by Arnout Vandecappelle and Thomas Petazzoni.
  - Add a prominent comment about the symlink to 'nc', as suggested by
    Arnout.
Changes v3->v4:
  - Restore forced dependence on busybox, since it may be necessary if
    packages become built in parallel, leading to a race condition on
    the creation of the "nc" link.
---
 package/nmap/Config.in | 27 ++++++++++++++++++++++++++-
 package/nmap/nmap.mk   | 38 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 62 insertions(+), 3 deletions(-)

diff --git a/package/nmap/Config.in b/package/nmap/Config.in
index 79f587afd1..1843bb6ade 100644
--- a/package/nmap/Config.in
+++ b/package/nmap/Config.in
@@ -4,6 +4,12 @@ config BR2_PACKAGE_NMAP
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_PACKAGE_LIBPCAP
+	select BR2_PACKAGE_NMAP_NMAP if !BR2_PACKAGE_NMAP_NCAT
+
+if  BR2_PACKAGE_NMAP
+
+config BR2_PACKAGE_NMAP_NMAP
+	bool "install nmap tools"
 	select BR2_PACKAGE_PCRE
 	help
 	  Nmap ("Network Mapper") is a free and open source (license)
@@ -11,6 +17,25 @@ config BR2_PACKAGE_NMAP
 
 	  http://nmap.org
 
-comment "nmap needs a toolchain w/ C++, threads"
+config BR2_PACKAGE_NMAP_NCAT
+	bool "install ncat"
+	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	help
+	  Ncat is a feature-packed networking utility which reads and
+	  writes data across networks from the command line. Ncat was
+	  written for the Nmap Project as a much-improved
+	  reimplementation of the venerable Netcat.
+
+	  If symlink to "nc" is installed if neither netcat or
+	  netcat-openbsd is selected.
+
+comment "a symlink from ncat to 'nc' will be installed"
+	depends on BR2_PACKAGE_NMAP_NCAT
+	depends on !BR2_PACKAGE_NETCAT
+	depends on !BR2_PACKAGE_NETCAT_OPENBSD
+
+endif
+
+comment "nmap-nmap needs a toolchain w/ C++, threads"
 	depends on BR2_USE_MMU
 	depends on !(BR2_INSTALL_LIBSTDCPP && BR2_TOOLCHAIN_HAS_THREADS)
diff --git a/package/nmap/nmap.mk b/package/nmap/nmap.mk
index 9db06d1455..d4c9acde07 100644
--- a/package/nmap/nmap.mk
+++ b/package/nmap/nmap.mk
@@ -7,13 +7,19 @@
 NMAP_VERSION = 7.60
 NMAP_SITE = https://nmap.org/dist
 NMAP_SOURCE = nmap-$(NMAP_VERSION).tar.bz2
-NMAP_DEPENDENCIES = libpcap pcre
+NMAP_DEPENDENCIES = libpcap
 NMAP_CONF_OPTS = --without-liblua --without-zenmap \
 	--with-libdnet=included --with-liblinear=included \
-	--with-libpcre="$(STAGING_DIR)/usr" --without-ncat
+	--with-libpcre="$(STAGING_DIR)/usr"
 NMAP_LICENSE = GPL-2.0
 NMAP_LICENSE_FILES = COPYING
 
+# Ensure Busybox gets built/installed before, so that this package
+# overrides Busybox nc.
+ifeq ($(BR2_PACKAGE_BUSYBOX)$(BR2_PACKAGE_NMAP_NCAT),yy)
+NMAP_DEPENDENCIES += busybox
+endif
+
 # needed by libpcap
 NMAP_LIBS_FOR_STATIC_LINK += `$(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs`
 
@@ -43,6 +49,10 @@ else
 NMAP_CONF_OPTS += --without-openssl
 endif
 
+ifeq ($(BR2_PACKAGE_NMAP_NMAP),y)
+
+NMAP_DEPENDENCIES += pcre
+
 # ndiff only works with python2.x
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 NMAP_DEPENDENCIES += python
@@ -50,4 +60,28 @@ else
 NMAP_CONF_OPTS += --without-ndiff
 endif
 
+ifeq ($(BR2_PACKAGE_NMAP_NCAT),)
+NMAP_CONF_OPTS += --without-ncat
+endif
+
+else # only ncat
+
+NMAP_CONF_OPTS += --without-ndiff --without-zenmap --without-nping --without-nmap-update
+define NMAP_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) build-ncat
+endef
+define NMAP_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install-ncat
+endef
+
+endif
+
+# Add a symlink to "nc" if none of the competing netcats is selected
+ifeq ($(BR2_PACKAGE_NMAP_NCAT):$(BR2_PACKAGE_NETCAT)$(BR2_PACKAGE_NETCAT_OPENBSD),y:)
+define NMAP_INSTALL_NCAT_SYMLINK
+        ln -fs ncat $(TARGET_DIR)/usr/bin/nc
+endef
+NMAP_POST_INSTALL_TARGET_HOOKS += NMAP_INSTALL_NCAT_SYMLINK
+endif
+
 $(eval $(autotools-package))
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] netcat: add forced dependence on BusyBox
  2017-10-12 15:14 [Buildroot] [PATCH v4] nmap: add option to build/install ncat Carlos Santos
@ 2017-10-12 15:14 ` Carlos Santos
  2018-03-31 10:34   ` Romain Naour
  2018-04-02 13:32 ` [Buildroot] [PATCH v4] nmap: add option to build/install ncat Thomas Petazzoni
  1 sibling, 1 reply; 8+ messages in thread
From: Carlos Santos @ 2017-10-12 15:14 UTC (permalink / raw)
  To: buildroot

It may be necessary if packages become built in parallel, leading to a
race condition on the creation of the "nc" link. Moreover, netcat is as
shy as BusyBox and would not override an existing file/link, so we must
remove $(TARGET_DIR)/usr/bin/nc in advance.

Of course this still leaves a race conditon if other netcat competitors
but we must assume thet the user is a grown-up person who knows what is
doing.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/netcat/netcat.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/package/netcat/netcat.mk b/package/netcat/netcat.mk
index eb7ddcac27..c032eea56d 100644
--- a/package/netcat/netcat.mk
+++ b/package/netcat/netcat.mk
@@ -9,4 +9,15 @@ NETCAT_SITE = http://downloads.sourceforge.net/project/netcat/netcat/$(NETCAT_VE
 NETCAT_LICENSE = GPL-2.0+
 NETCAT_LICENSE_FILES = COPYING
 
+# Ensure Busybox gets built/installed before, so that this package
+# overrides Busybox nc. We must remove an existing file/link because
+# netcat is as shy as Busybox and would not override existing files.
+ifeq ($(BR2_PACKAGE_BUSYBOX),y)
+NETCAT_DEPENDENCIES += busybox
+define NETCAT_RMOVE_NC_LINK
+	rm -f $(TARGET_DIR)/usr/bin/nc
+endef
+NETCAT_PRE_INSTALL_TARGET_HOOKS += NETCAT_RMOVE_NC_LINK
+endif
+
 $(eval $(autotools-package))
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] netcat: add forced dependence on BusyBox
  2017-10-12 15:14 ` [Buildroot] [PATCH] netcat: add forced dependence on BusyBox Carlos Santos
@ 2018-03-31 10:34   ` Romain Naour
  2018-03-31 13:03     ` Arnout Vandecappelle
  2018-03-31 22:25     ` Arnout Vandecappelle
  0 siblings, 2 replies; 8+ messages in thread
From: Romain Naour @ 2018-03-31 10:34 UTC (permalink / raw)
  To: buildroot

Hi Carlos,

Le 12/10/2017 ? 17:14, Carlos Santos a ?crit?:
> It may be necessary if packages become built in parallel, leading to a
> race condition on the creation of the "nc" link. Moreover, netcat is as
> shy as BusyBox and would not override an existing file/link, so we must
> remove $(TARGET_DIR)/usr/bin/nc in advance.
> 
> Of course this still leaves a race conditon if other netcat competitors
> but we must assume thet the user is a grown-up person who knows what is
> doing.

It seems you are using a custom busybox config file because the netcat applet is
disabled by default.

I'm agree, the dependency on busybox is missing but the TARGET_HOOKS doesn't
seems necessary. I removed it and netcat package is able to override the busybox
symlink.

 /usr/bin/install -c netcat output/target/usr/bin/netcat

Maybe we should check if other packages depending on
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS have a dependency on busybox.

Best regards,
Romain

> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/netcat/netcat.mk | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/package/netcat/netcat.mk b/package/netcat/netcat.mk
> index eb7ddcac27..c032eea56d 100644
> --- a/package/netcat/netcat.mk
> +++ b/package/netcat/netcat.mk
> @@ -9,4 +9,15 @@ NETCAT_SITE = http://downloads.sourceforge.net/project/netcat/netcat/$(NETCAT_VE
>  NETCAT_LICENSE = GPL-2.0+
>  NETCAT_LICENSE_FILES = COPYING
>  
> +# Ensure Busybox gets built/installed before, so that this package
> +# overrides Busybox nc. We must remove an existing file/link because
> +# netcat is as shy as Busybox and would not override existing files.
> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
> +NETCAT_DEPENDENCIES += busybox
> +define NETCAT_RMOVE_NC_LINK
> +	rm -f $(TARGET_DIR)/usr/bin/nc
> +endef
> +NETCAT_PRE_INSTALL_TARGET_HOOKS += NETCAT_RMOVE_NC_LINK
> +endif
> +
>  $(eval $(autotools-package))
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] netcat: add forced dependence on BusyBox
  2018-03-31 10:34   ` Romain Naour
@ 2018-03-31 13:03     ` Arnout Vandecappelle
  2018-03-31 13:17       ` Yann E. MORIN
  2018-03-31 22:25     ` Arnout Vandecappelle
  1 sibling, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2018-03-31 13:03 UTC (permalink / raw)
  To: buildroot



On 31-03-18 12:34, Romain Naour wrote:
> Hi Carlos,
> 
> Le 12/10/2017 ? 17:14, Carlos Santos a ?crit?:
>> It may be necessary if packages become built in parallel, leading to a
>> race condition on the creation of the "nc" link. Moreover, netcat is as
>> shy as BusyBox and would not override an existing file/link, so we must
>> remove $(TARGET_DIR)/usr/bin/nc in advance.
>>
>> Of course this still leaves a race conditon if other netcat competitors
>> but we must assume thet the user is a grown-up person who knows what is
>> doing.
> 
> It seems you are using a custom busybox config file because the netcat applet is
> disabled by default.
> 
> I'm agree, the dependency on busybox is missing but the TARGET_HOOKS doesn't
> seems necessary. I removed it and netcat package is able to override the busybox
> symlink.
> 
>  /usr/bin/install -c netcat output/target/usr/bin/netcat

 And anyway, in the context of PPS we will eventually have to reverse the
busybox dependencies, i.e. busybox will depend on netcat.


> Maybe we should check if other packages depending on
> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS have a dependency on busybox.

 check-uniq-files should cover this.

 Regards,
 Arnout

> 
> Best regards,
> Romain
> 
>>
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
>> ---
>>  package/netcat/netcat.mk | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/package/netcat/netcat.mk b/package/netcat/netcat.mk
>> index eb7ddcac27..c032eea56d 100644
>> --- a/package/netcat/netcat.mk
>> +++ b/package/netcat/netcat.mk
>> @@ -9,4 +9,15 @@ NETCAT_SITE = http://downloads.sourceforge.net/project/netcat/netcat/$(NETCAT_VE
>>  NETCAT_LICENSE = GPL-2.0+
>>  NETCAT_LICENSE_FILES = COPYING
>>  
>> +# Ensure Busybox gets built/installed before, so that this package
>> +# overrides Busybox nc. We must remove an existing file/link because
>> +# netcat is as shy as Busybox and would not override existing files.
>> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
>> +NETCAT_DEPENDENCIES += busybox
>> +define NETCAT_RMOVE_NC_LINK
>> +	rm -f $(TARGET_DIR)/usr/bin/nc
>> +endef
>> +NETCAT_PRE_INSTALL_TARGET_HOOKS += NETCAT_RMOVE_NC_LINK
>> +endif
>> +
>>  $(eval $(autotools-package))
>>
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] netcat: add forced dependence on BusyBox
  2018-03-31 13:03     ` Arnout Vandecappelle
@ 2018-03-31 13:17       ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2018-03-31 13:17 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2018-03-31 15:03 +0200, Arnout Vandecappelle spake thusly:
> On 31-03-18 12:34, Romain Naour wrote:
> > Hi Carlos,
> > 
> > Le 12/10/2017 ? 17:14, Carlos Santos a ?crit?:
> >> It may be necessary if packages become built in parallel, leading to a
> >> race condition on the creation of the "nc" link. Moreover, netcat is as
> >> shy as BusyBox and would not override an existing file/link, so we must
> >> remove $(TARGET_DIR)/usr/bin/nc in advance.
> >>
> >> Of course this still leaves a race conditon if other netcat competitors
> >> but we must assume thet the user is a grown-up person who knows what is
> >> doing.
> > 
> > It seems you are using a custom busybox config file because the netcat applet is
> > disabled by default.
> > 
> > I'm agree, the dependency on busybox is missing but the TARGET_HOOKS doesn't
> > seems necessary. I removed it and netcat package is able to override the busybox
> > symlink.
> > 
> >  /usr/bin/install -c netcat output/target/usr/bin/netcat
> 
>  And anyway, in the context of PPS we will eventually have to reverse the
> busybox dependencies, i.e. busybox will depend on netcat.

Actually, we can do that even before PPS...

Regards,
Yann E. MORIN.

> > Maybe we should check if other packages depending on
> > BR2_PACKAGE_BUSYBOX_SHOW_OTHERS have a dependency on busybox.
> 
>  check-uniq-files should cover this.
> 
>  Regards,
>  Arnout
> 
> > 
> > Best regards,
> > Romain
> > 
> >>
> >> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> >> ---
> >>  package/netcat/netcat.mk | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> diff --git a/package/netcat/netcat.mk b/package/netcat/netcat.mk
> >> index eb7ddcac27..c032eea56d 100644
> >> --- a/package/netcat/netcat.mk
> >> +++ b/package/netcat/netcat.mk
> >> @@ -9,4 +9,15 @@ NETCAT_SITE = http://downloads.sourceforge.net/project/netcat/netcat/$(NETCAT_VE
> >>  NETCAT_LICENSE = GPL-2.0+
> >>  NETCAT_LICENSE_FILES = COPYING
> >>  
> >> +# Ensure Busybox gets built/installed before, so that this package
> >> +# overrides Busybox nc. We must remove an existing file/link because
> >> +# netcat is as shy as Busybox and would not override existing files.
> >> +ifeq ($(BR2_PACKAGE_BUSYBOX),y)
> >> +NETCAT_DEPENDENCIES += busybox
> >> +define NETCAT_RMOVE_NC_LINK
> >> +	rm -f $(TARGET_DIR)/usr/bin/nc
> >> +endef
> >> +NETCAT_PRE_INSTALL_TARGET_HOOKS += NETCAT_RMOVE_NC_LINK
> >> +endif
> >> +
> >>  $(eval $(autotools-package))
> >>
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> > 
> 
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] netcat: add forced dependence on BusyBox
  2018-03-31 10:34   ` Romain Naour
  2018-03-31 13:03     ` Arnout Vandecappelle
@ 2018-03-31 22:25     ` Arnout Vandecappelle
  2018-03-31 22:31       ` Arnout Vandecappelle
  1 sibling, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2018-03-31 22:25 UTC (permalink / raw)
  To: buildroot



On 31-03-18 12:34, Romain Naour wrote:
> Hi Carlos,
> 
> Le 12/10/2017 ? 17:14, Carlos Santos a ?crit?:
>> It may be necessary if packages become built in parallel, leading to a
>> race condition on the creation of the "nc" link. Moreover, netcat is as
>> shy as BusyBox and would not override an existing file/link, so we must
>> remove $(TARGET_DIR)/usr/bin/nc in advance.
>>
>> Of course this still leaves a race conditon if other netcat competitors
>> but we must assume thet the user is a grown-up person who knows what is
>> doing.
> 
> It seems you are using a custom busybox config file because the netcat applet is
> disabled by default.
> 
> I'm agree, the dependency on busybox is missing but the TARGET_HOOKS doesn't
> seems necessary. I removed it and netcat package is able to override the busybox
> symlink.
> 
>  /usr/bin/install -c netcat output/target/usr/bin/netcat

 I've applied, after removing the unneeded removal of nc.

 If it turns out to be needed after all, please submit a follow-up patch.

 Regards,
 Arnout

> 
> Maybe we should check if other packages depending on
> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS have a dependency on busybox.
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] netcat: add forced dependence on BusyBox
  2018-03-31 22:25     ` Arnout Vandecappelle
@ 2018-03-31 22:31       ` Arnout Vandecappelle
  0 siblings, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2018-03-31 22:31 UTC (permalink / raw)
  To: buildroot



On 01-04-18 00:25, Arnout Vandecappelle wrote:
> 
> 
> On 31-03-18 12:34, Romain Naour wrote:
>> Hi Carlos,
>>
>> Le 12/10/2017 ? 17:14, Carlos Santos a ?crit?:
>>> It may be necessary if packages become built in parallel, leading to a
>>> race condition on the creation of the "nc" link. Moreover, netcat is as
>>> shy as BusyBox and would not override an existing file/link, so we must
>>> remove $(TARGET_DIR)/usr/bin/nc in advance.
>>>
>>> Of course this still leaves a race conditon if other netcat competitors
>>> but we must assume thet the user is a grown-up person who knows what is
>>> doing.
>>
>> It seems you are using a custom busybox config file because the netcat applet is
>> disabled by default.
>>
>> I'm agree, the dependency on busybox is missing but the TARGET_HOOKS doesn't
>> seems necessary. I removed it and netcat package is able to override the busybox
>> symlink.
>>
>>  /usr/bin/install -c netcat output/target/usr/bin/netcat
> 
>  I've applied, after removing the unneeded removal of nc.
> 
>  If it turns out to be needed after all, please submit a follow-up patch.

 OK, so it *was* needed, so I pushed a follow-up commit that does the removal.

 I've done that unconditionally, though, the 'nc' could come from somewhere else
as well.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v4] nmap: add option to build/install ncat
  2017-10-12 15:14 [Buildroot] [PATCH v4] nmap: add option to build/install ncat Carlos Santos
  2017-10-12 15:14 ` [Buildroot] [PATCH] netcat: add forced dependence on BusyBox Carlos Santos
@ 2018-04-02 13:32 ` Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2018-04-02 13:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 12 Oct 2017 12:14:17 -0300, Carlos Santos wrote:
> Ncat is a much-improved reimplementation of the venerable Netcat and is
> compatible with uClibc and musl. It provides features not available in
> the ancient GNU netcat and its Busybox double like IPv6, proxies, and
> Unix sockets.
> 
> Tha nmap package now installs ncat if the BR2_PACKAGE_NMAP_NCAT option
> is selected. The other programs (nmap, ndiff, etc.) are chosen via the
> BR2_PACKAGE_NMAP_NMAP option.
> 
> We symlink 'nc' to ncat if neiter netcat nor netcat-openbsd is selected,
> even though ncat does not have the same interface as netcat-openbsd.
> However, since Fedora/RHEL install nmap-ncat as 'nc', it can be assumed
> that packages that depend on 'nc' know how to deal with this diversity.
> For example, the virt-manager package does that. Also user-supplied
> scripts can be assumed to do the right thing, since the user also
> selects whether nmap-ncat, netcat or netcat-openbsd is installed.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

We looked at this in further details with Arnout, and we still didn't
like the special casing for the ncat-only case. In addition, it is
weird to have suboptions for nmap and ncat, while the package also
installs nping and ndiff.

So instead, I've added sub-options for nmap, ncat, ndiff and nping, and
then I've played with make targets to only build/install what's needed.
The nmap Makefile.in conveniently offers the following make targets:

 nmap, build-ncat, build-nping, build-ndiff

to build the respective programs, and:

 install-nmap, install-ncat, install-nping, install-ndiff

to install the respective programs.

I've used this solution, which makes the package a lot cleaner and
easier to read I believe. See the final commit at
https://git.buildroot.org/buildroot/commit/?id=55ec9b4e40b08a11cb9c1662c427c8d58351924a.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-02 13:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 15:14 [Buildroot] [PATCH v4] nmap: add option to build/install ncat Carlos Santos
2017-10-12 15:14 ` [Buildroot] [PATCH] netcat: add forced dependence on BusyBox Carlos Santos
2018-03-31 10:34   ` Romain Naour
2018-03-31 13:03     ` Arnout Vandecappelle
2018-03-31 13:17       ` Yann E. MORIN
2018-03-31 22:25     ` Arnout Vandecappelle
2018-03-31 22:31       ` Arnout Vandecappelle
2018-04-02 13:32 ` [Buildroot] [PATCH v4] nmap: add option to build/install ncat Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.