netcat-openbsd: don't conflict with netcat from nmap

Unfortunately subpackages do not support debscripts currently, so nc & netcat
symlinks can't be managed through update-alternatives. As there no other way
to have these symlinks in multiple packages without conflict, nmap package
receives the following changes:

* Rename netcat subpackage to nmap-ncat.
* Remove symlinks nc and netcat pointing to ncat.

***

Requested in https://github.com/termux/termux-packages/issues/6921.
This commit is contained in:
Leonid Pliushch 2021-05-29 21:13:15 +03:00
parent ca1d255cc7
commit bd7dd8a9b3
No known key found for this signature in database
GPG Key ID: 45F2964132545795
4 changed files with 12 additions and 19 deletions

View File

@ -3,11 +3,10 @@ TERMUX_PKG_DESCRIPTION="TCP/IP swiss army knife. OpenBSD variant."
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.217-2
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://salsa.debian.org/debian/netcat-openbsd/-/archive/debian/${TERMUX_PKG_VERSION}/netcat-openbsd-debian-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=bb6427c49015c8d485c013898b08808192bf5719c40a79676162e5c2d971a34e
TERMUX_PKG_DEPENDS="libbsd"
TERMUX_PKG_CONFLICTS="netcat"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {

View File

@ -3,24 +3,13 @@ TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=7.91
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=18cc4b5070511c51eb243cdd2b0b30ff9b2c4dc4544c6312f75ce3a67a593300
# Depend on netcat so that it gets installed automatically when installing
# nmap, since the ncat program is usually distributed as part of nmap.
TERMUX_PKG_DEPENDS="libc++, libpcap, pcre, openssl, resolv-conf, netcat, liblua53, libssh2, zlib"
TERMUX_PKG_DEPENDS="libc++, libpcap, pcre, openssl, resolv-conf, liblua53, libssh2, zlib"
TERMUX_PKG_RECOMMENDS="nmap-ncat"
# --without-nmap-update to avoid linking against libsvn_client:
# --without-zenmap to avoid python scripts for graphical gtk frontend:
# --without-ndiff to avoid python2-using ndiff utility:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-static --with-liblua=$TERMUX_PREFIX --without-nmap-update --without-zenmap --without-ndiff"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_post_make_install() {
# Setup 'netcat' and 'nc' as symlink to 'ncat', since the other netcat implementations
# are outdated (gnu-netcat) or non-portable (openbsd-netcat).
for prog in netcat nc; do
cd $TERMUX_PREFIX/bin
ln -s -f ncat $prog
cd $TERMUX_PREFIX/share/man/man1
ln -s -f ncat.1 ${prog}.1
done
}

View File

@ -1,3 +0,0 @@
TERMUX_SUBPKG_INCLUDE="bin/ncat bin/netcat bin/nc share/man/man1/ncat.1.gz share/man/man1/netcat.1.gz share/man/man1/nc.1.gz"
TERMUX_SUBPKG_DESCRIPTION="Feature-packed networking utility which reads and writes data across networks from the command line"
TERMUX_SUBPKG_DEPENDS="libpcap, openssl, liblua53"

View File

@ -0,0 +1,8 @@
# FIXME: unsplit and use update-alternatives to provide symlinks and avoid
# the conflict with netcat-openbsd? We do not split nping from nmap package.
TERMUX_SUBPKG_INCLUDE="bin/ncat share/man/man1/ncat.1.gz"
TERMUX_SUBPKG_DESCRIPTION="Feature-packed networking utility which reads and writes data across networks from the command line"
TERMUX_SUBPKG_DEPENDS="libpcap, openssl, liblua53"
TERMUX_SUBPKG_BREAKS="netcat"
TERMUX_SUBPKG_REPLACES="netcat"