diff --git a/SPECS/nmap.spec b/SPECS/nmap.spec index 1dc02ac..69ba31c 100644 --- a/SPECS/nmap.spec +++ b/SPECS/nmap.spec @@ -13,7 +13,7 @@ Name: nmap Epoch: 2 Version: 7.70 #global prerelease TEST5 -Release: 4%{?dist} +Release: 5%{?dist} # Uses combination of licenses based on GPL license, but with extra modification # so it got its own license tag rhbz#1055861 License: Nmap @@ -105,6 +105,10 @@ applications and users. Ncat will not only work with IPv4 and IPv6 but provides the user with a virtually limitless number of potential uses. +%if 0%{?rhel} && 0%{?rhel} >= 0 +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives +%endif %prep @@ -159,9 +163,13 @@ make DESTDIR=%{buildroot} STRIP=true install rm -f %{buildroot}%{_datadir}/ncat/ca-bundle.crt rmdir %{buildroot}%{_datadir}/ncat -#we provide 'nc' replacement -ln -s ncat.1.gz %{buildroot}%{_mandir}/man1/nc.1.gz -ln -s ncat %{buildroot}%{_bindir}/nc +%if 0%{?fedora} && 0%{?fedora} >= 0 +# we provide 'nc' replacement +# Do not create symlinks on manpages on rhel because of +# rhbz#1578776 +ln -s ncat.1.gz %{buildroot}/%{_mandir}/man1/nc.1.gz +ln -s ncat %{buildroot}/%{_bindir}/nc +%endif %if %{with_frontend} rm -f %{buildroot}%{_bindir}/uninstall_zenmap @@ -179,7 +187,6 @@ ln -s zenmap.1.gz nmapfe.1.gz ln -s zenmap.1.gz xnmap.1.gz popd - desktop-file-install --vendor nmap \ --dir %{buildroot}%{_datadir}/applications \ --add-category X-Red-Hat-Base \ @@ -205,6 +212,20 @@ popd %endif %find_lang nmap --with-man +touch %{buildroot}%{_bindir}/nc + +%post ncat +%{_sbindir}/update-alternatives --install %{_bindir}/nc \ + %{name} %{_bindir}/ncat 10 \ + --slave %{_mandir}/man1/nc.1.gz ncman %{_mandir}/man1/ncat.1.gz + +## ln -s ncat.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/nc.1.gz + +%postun ncat +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/ncat +fi + %files -f nmap.lang %doc COPYING* @@ -218,9 +239,14 @@ popd %files ncat %doc COPYING ncat/docs/AUTHORS ncat/docs/README ncat/docs/THANKS ncat/docs/examples +%if 0%{?fedora} && 0%{?fedora} >= 0 %{_bindir}/nc -%{_bindir}/ncat %{_mandir}/man1/nc.1.gz +%else +%ghost %{_bindir}/nc +%ghost %{_mandir}/man1/nc.1.gz +%endif +%{_bindir}/ncat %{_mandir}/man1/ncat.1.gz %if %{with_frontend} @@ -248,6 +274,9 @@ popd %endif %changelog +* Thu Mar 28 2019 Pavel Zhukov - 2:7.70-5 +- Resolves: #1653119 - Manage nc symlink using alternatives + * Mon Sep 17 2018 Pavel Zhukov - 2:7.70-4 - Resolves: #1627053 - Obsolete python2 packages