From c3997f44b9c0e0133f1b024a852d592f0952085ea30e3471b1972bbd55ed983e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Fri, 25 Jun 2010 17:21:56 +0000 Subject: [PATCH] Accepting request 42078 from home:lmuelle:branches:network:utilities Copy from home:lmuelle:branches:network:utilities/netcat-openbsd via accept of submit request 42078 revision 2. Request was accepted with message: reviewed ok. OBS-URL: https://build.opensuse.org/request/show/42078 OBS-URL: https://build.opensuse.org/package/show/network:utilities/netcat-openbsd?expand=0&rev=6 --- netcat-openbsd.changes | 6 ++++++ netcat-openbsd.spec | 27 +++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/netcat-openbsd.changes b/netcat-openbsd.changes index 84eb185..eb793aa 100644 --- a/netcat-openbsd.changes +++ b/netcat-openbsd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 25 16:55:06 UTC 2010 - lmuelle@suse.de + +- Use update-alternatives to set netcat symbolic links for compatibility. +- Provides and obsoltes netcat. + ------------------------------------------------------------------- Fri May 28 16:27:34 UTC 2010 - cristian.rodriguez@opensuse.org diff --git a/netcat-openbsd.spec b/netcat-openbsd.spec index 3c0a813..defde2f 100644 --- a/netcat-openbsd.spec +++ b/netcat-openbsd.spec @@ -25,13 +25,14 @@ Release: 67 License: BSD3c BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake glib2-devel quilt +PreReq: update-alternatives Group: Productivity/Networking/Other Summary: TCP/IP swiss army knife Source: %{name}-%{version}.tar.bz2 Source1: CMakeLists.txt Patch0: netcat-openbsd_1.89-3ubuntu2.diff.gz -Provides: nc6 = %{version} -Obsoletes: nc6 <= 1.0 +Provides: nc6 = %{version} netcat +Obsoletes: nc6 <= 1.0 netcat <= 1.10 %description A simple Unix utility which reads and writes data across network @@ -65,6 +66,13 @@ cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} . %install %makeinstall +mkdir -p \ + ${RPM_BUILD_ROOT}/etc/alternatives +touch \ + ${RPM_BUILD_ROOT}/etc/alternatives/netcat \ + ${RPM_BUILD_ROOT}/etc/alternatives/netcat.1.gz +%{__ln_s} -f %{_bindir}/nc ${RPM_BUILD_ROOT}/%{_bindir}/netcat +%{__ln_s} -f nc.1.gz ${RPM_BUILD_ROOT}/%{_mandir}/man1/netcat.1.gz %clean rm -rf "$RPM_BUILD_ROOT" @@ -72,6 +80,21 @@ rm -rf "$RPM_BUILD_ROOT" %files %defattr(-,root,root) %{_bindir}/nc +%{_bindir}/netcat %{_mandir}/man1/nc.1.gz +%{_mandir}/man1/netcat.1.gz +%ghost /etc/alternatives/netcat +%ghost /etc/alternatives/netcat.1.gz + +%post +/usr/sbin/update-alternatives --install \ + %{_bindir}/netcat netcat %{_bindir}/nc 10 \ + --slave %{_mandir}/man1/netcat.1.gz netcat.1.gz %{_mandir}/man1/nc.1.gz + +%preun +if [ "$1" = 0 ] ; then + /usr/sbin/update-alternatives --remove \ + netcat %{_bindir}/nc +fi %changelog