Browse Source

nmap-7.92-1

Tomohiro "Tomo-p" KATO 2 years ago
parent
commit
e4b51b9a99
1 changed files with 75 additions and 28 deletions
  1. 75 28
      n/nmap/nmap-vl.spec

+ 75 - 28
n/nmap/nmap-vl.spec

@@ -1,11 +1,11 @@
-%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
+%bcond_with gtk2
 
 Summary: Network exploration tool and security scanner
 Summary(ja): 多機能なポートスキャナー
 Name: nmap
-Version: 7.80
+Version: 7.92
 Release: 1%{?_dist_release}
-Group: Applications/System
+Group: network
 Vendor: Project Vine
 Distribution: Vine Linux
 
@@ -22,16 +22,24 @@ Patch1: nmap-4.03-mktemp.patch
 Patch2: nmap-4.52-noms.patch
 
 # upstream provided patch for rhbz#845005, not yet in upstream repository
-Patch5: ncat_reg_stdin.diff
-Patch6: nmap-6.25-displayerror.patch
+Patch3: ncat_reg_stdin.diff
+Patch4: nmap-6.25-displayerror.patch
+# https://github.com/nmap/nmap/pull/2247
+Patch7: nmap_resolve_config.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: libpcap-devel
+BuildRequires: libssh2-devel
+BuildRequires: lua-devel
+BuildRequires: openssl-devel 
 BuildRequires: pcre-devel 
+BuildRequires: zlib-devel
+%if %{with gtk2}
 BuildRequires: python-devel
 BuildRequires: pygtk2-devel 
-BuildRequires: openssl-devel 
-BuildRequires: lua-devel 
+%else
+Obsoletes: nmap-frontend < 7.92
+%endif
 
 %description
 Nmap is a utility for network exploration or security auditing. It
@@ -52,6 +60,8 @@ ping によるスキャン(どのホストが稼働中かの調査)、様々な
 予測可能な性質の測定、Sun RPC スキャン、逆 identd スキャンなどの
 機能も提供します。
 
+
+%if %{with gtk2}
 %package frontend
 Summary: Gtk+ frontend for nmap
 Summary(ja): Nmap の GTK+ フロントエンド
@@ -67,26 +77,50 @@ be installed before installing nmap-frontend.
 %description frontend -l ja
 Nmap の GTK+ ベースのフロントエンド(zenmap)です。このパッケージをインストール
 する前に、nmap パッケージをインストールする必要があります。
+%endif
+
+
+%debug_package
+
 
 %prep
 %setup -q
+%autopatch -p1
+
+#be sure we're not using tarballed copies of some libraries
+#rm -rf liblua libpcap libpcre macosx mswin32 ###TODO###
+rm -rf libpcap libpcre macosx mswin32 libssh2 libz
 
-%patch1 -p1 -b .mktemp
-%patch2 -p1 -b .noms
-%patch5 -p1 -b .ncat_reg_stdin
-%patch6 -p1 -b .displayerror
 
 %build
-export CPPFLAGS="-I%{_includedir}/pcap -I%{_includedir}/pcre"
-%configure 
-make
+export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
+export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
+%configure \
+	--without-zenmap \
+	--without-ndiff \
+	--with-libpcap=yes \
+	--with-liblua=included \
+	--with-libssh2=yes \
+	--enable-dbus
+%make_build
+
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT STRIP=true
 
-rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_zenmap
 rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_ndiff
+
+#do not include certificate bundle (#734389)
+rm -f %{buildroot}%{_datadir}/ncat/ca-bundle.crt
+rmdir %{buildroot}%{_datadir}/ncat
+
+#we provide 'nc' replacement (#1653119)
+touch %{buildroot}%{_mandir}/man1/nc.1.gz
+touch %{buildroot}%{_bindir}/nc
+
+%if %{with gtk2}
+rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_zenmap
 cp docs/zenmap.1 $RPM_BUILD_ROOT%{_mandir}/man1/
 gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || :
 pushd $RPM_BUILD_ROOT%{_mandir}/man1
@@ -94,39 +128,46 @@ ln -s zenmap.1.gz nmapfe.1.gz
 ln -s zenmap.1.gz xnmap.1.gz
 popd
 
-#pushd $RPM_BUILD_ROOT%{_datadir}/pixmaps
-#mkdir zenmap
-#mv *.svg zenmap
-#mv *.png zenmap
-#popd
-
 #desktop-file-install --vendor= \
 #	--dir $RPM_BUILD_ROOT%{_datadir}/applications \
 #	%{SOURCE1};
 rm -f $RPM_BUILD_ROOT%{_datadir}/applications/zenmap-root.desktop
+%endif
 
 %find_lang %{name} --with-man
 
+
 %clean
 rm -rf %{buildroot}
 
+
+%post
+%{_sbindir}/alternatives --install %{_bindir}/nc nc %{_bindir}/ncat 10 \
+  --slave %{_mandir}/man1/nc.1.gz nc-man %{_mandir}/man1/ncat.1.gz
+
+%preun
+if [ $1 -eq 0 ]; then
+  %{_sbindir}/alternatives --remove nc %{_bindir}/ncat
+fi
+
+
 %files -f %{name}.lang
 %defattr(-,root,root)
-%license COPYING
-%doc CHANGELOG README*
+%license LICENSE
+%doc CHANGELOG README.md
 %doc docs/nmap.usage.txt docs/nmap.dtd
 %{_bindir}/nmap
 %{_bindir}/ncat
-%{_bindir}/ndiff
 %{_bindir}/nping
 %{_datadir}/nmap
-%{_datadir}/ncat
-#%{_libexecdir}/nmap
 %{_mandir}/man1/nmap.1*
 %{_mandir}/man1/ncat.1*
-%{_mandir}/man1/ndiff.1*
 %{_mandir}/man1/nping.1*
+%ghost %{_bindir}/nc
+%ghost %{_mandir}/man1/nc.1.gz
+
 
+%if %{with gtk2}
 %files frontend
 %defattr(-,root,root)
 %{_bindir}/nmapfe
@@ -140,8 +181,14 @@ rm -rf %{buildroot}
 %{_mandir}/man1/zenmap.1*
 %{_mandir}/man1/nmapfe.1*
 %{_mandir}/man1/xnmap.1*
+%endif
+
 
 %changelog
+* Wed Oct 27 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.92-1
+- new upstream release.
+- built with openssl-3.0.0.
+
 * Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.80-1
 - new upstream release.