Refactor libssh2 and zlib patch
This commit is contained in:
parent
74bf431fd5
commit
876f855fc2
@ -1,29 +1,33 @@
|
|||||||
diff --git a/nmap.cc b/nmap.cc
|
diff --git a/nmap.cc b/nmap.cc
|
||||||
index c0a2edf..4ab7f3b 100644
|
index c0a2edf..951c131 100644
|
||||||
--- a/nmap.cc
|
--- a/nmap.cc
|
||||||
+++ b/nmap.cc
|
+++ b/nmap.cc
|
||||||
@@ -182,7 +182,7 @@
|
@@ -182,12 +182,26 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_LIBSSH2
|
#if HAVE_LIBSSH2
|
||||||
-#include "libssh2/libssh2v.h"
|
+#ifdef LIBSSH2_INCLUDED
|
||||||
|
#include "libssh2/libssh2v.h"
|
||||||
|
-#endif
|
||||||
|
+#else
|
||||||
+#include "libssh2.h"
|
+#include "libssh2.h"
|
||||||
#endif
|
+#ifndef LIBSSH2_VERSION_TEXT
|
||||||
|
+#define LIBSSH2_VERSION_TEXT "Libssh2 #LIBSSH2_VERSION"
|
||||||
|
+#endif /* LIBSSH2_VERSION_TEXT */
|
||||||
|
+#endif /* LIBSSH2_INCLUDED */
|
||||||
|
+#endif /* HAVE_LIBSSH2 */
|
||||||
|
|
||||||
#if HAVE_LIBZ
|
#if HAVE_LIBZ
|
||||||
diff --git a/nmap.cc b/nmap.cc
|
+#ifdef LIBZ_INCLUDED
|
||||||
index 4ab7f3b..4864b3e 100644
|
#include "libz/libzv.h"
|
||||||
--- a/nmap.cc
|
-#endif
|
||||||
+++ b/nmap.cc
|
+#else
|
||||||
@@ -2844,9 +2844,9 @@ static void display_nmap_version() {
|
+#include "zlib.h"
|
||||||
|
+#ifndef LIBZ_VERSION_TEXT
|
||||||
|
+#define LIBZ_VERSION_TEXT "Libz #LIBZ_VERSION"
|
||||||
|
+#endif /* LIBZ_VERSION_TEXT */
|
||||||
|
+#endif /* LIBZ_INCLUDED */
|
||||||
|
+#endif /* HAVE_LIBZ */
|
||||||
|
|
||||||
#if HAVE_LIBSSH2
|
/* To get the version number only. */
|
||||||
#ifdef LIBSSH2_INCLUDED
|
#ifdef WIN32
|
||||||
- with.push_back(std::string("nmap-libssh2-") + get_word_or_quote(LIBSSH2_VERSION_TEXT, 1));
|
|
||||||
+ with.push_back(std::string("nmap-libssh2-") + get_word_or_quote(LIBSSH2_VERSION_INVALID, 1));
|
|
||||||
#else
|
|
||||||
- with.push_back(std::string("libssh2-") + get_word_or_quote(LIBSSH2_VERSION_TEXT, 1));
|
|
||||||
+ with.push_back(std::string("libssh2-") + get_word_or_quote(LIBSSH2_VERSION, 1));
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
without.push_back("libssh2");
|
|
||||||
|
66
nmap.spec
66
nmap.spec
@ -8,7 +8,7 @@ Name: nmap
|
|||||||
Epoch: 2
|
Epoch: 2
|
||||||
Version: 7.60
|
Version: 7.60
|
||||||
#global prerelease TEST5
|
#global prerelease TEST5
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
# Uses combination of licenses based on GPL license, but with extra modification
|
# Uses combination of licenses based on GPL license, but with extra modification
|
||||||
# so it got its own license tag rhbz#1055861
|
# so it got its own license tag rhbz#1055861
|
||||||
License: Nmap
|
License: Nmap
|
||||||
@ -37,7 +37,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|||||||
BuildRequires: openssl-devel, gtk2-devel, lua-devel, libpcap-devel, pcre-devel
|
BuildRequires: openssl-devel, gtk2-devel, lua-devel, libpcap-devel, pcre-devel
|
||||||
BuildRequires: desktop-file-utils, dos2unix
|
BuildRequires: desktop-file-utils, dos2unix
|
||||||
BuildRequires: libtool, automake, autoconf, gettext-devel
|
BuildRequires: libtool, automake, autoconf, gettext-devel
|
||||||
BuildRequires: libssh2
|
BuildRequires: libssh2-devel
|
||||||
|
|
||||||
%define pixmap_srcdir zenmap/share/pixmaps
|
%define pixmap_srcdir zenmap/share/pixmaps
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ Summary: The GTK+ front end for nmap
|
|||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
Requires: nmap = %{epoch}:%{version} gtk2 python2 >= 2.5 pygtk2 usermode
|
Requires: nmap = %{epoch}:%{version} gtk2 python2 >= 2.5 pygtk2 usermode
|
||||||
Requires: nmap-ndiff = %{epoch}:%{version}
|
Requires: nmap-ndiff = %{epoch}:%{version}
|
||||||
BuildRequires: python2-devel pygtk2-devel libpng-devel
|
BuildRequires: python2-devel pygtk2-devel libpng-devel
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%description frontend
|
%description frontend
|
||||||
This package includes zenmap, a GTK+ front end for nmap. The nmap package must
|
This package includes zenmap, a GTK+ front end for nmap. The nmap package must
|
||||||
@ -99,6 +99,10 @@ BuildArch: noarch
|
|||||||
%patch6 -p1 -b .displayerror
|
%patch6 -p1 -b .displayerror
|
||||||
%patch7 -p1 -b .libssh2
|
%patch7 -p1 -b .libssh2
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
# for aarch64 support, not needed with autotools 2.69+
|
# for aarch64 support, not needed with autotools 2.69+
|
||||||
for f in acinclude.m4 configure.ac nping/configure.ac
|
for f in acinclude.m4 configure.ac nping/configure.ac
|
||||||
do
|
do
|
||||||
@ -107,9 +111,6 @@ done
|
|||||||
autoreconf -I . -fiv --no-recursive
|
autoreconf -I . -fiv --no-recursive
|
||||||
cd nping; autoreconf -I .. -fiv --no-recursive; cd ..
|
cd nping; autoreconf -I .. -fiv --no-recursive; cd ..
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
#fix locale dir
|
#fix locale dir
|
||||||
mv zenmap/share/zenmap/locale zenmap/share
|
mv zenmap/share/zenmap/locale zenmap/share
|
||||||
@ -128,50 +129,50 @@ make %{?_smp_mflags}
|
|||||||
sed -i 's/-md/-mf/' nping/docs/nping.1
|
sed -i 's/-md/-mf/' nping/docs/nping.1
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
#prevent stripping - replace strip command with 'true'
|
#prevent stripping - replace strip command with 'true'
|
||||||
make DESTDIR=$RPM_BUILD_ROOT STRIP=true install
|
make DESTDIR=%{buildroot} STRIP=true install
|
||||||
rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_zenmap
|
rm -f %{buildroot}%{_bindir}/uninstall_zenmap
|
||||||
|
|
||||||
#do not include certificate bundle (#734389)
|
#do not include certificate bundle (#734389)
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/ncat/ca-bundle.crt
|
rm -f %{buildroot}%{_datadir}/ncat/ca-bundle.crt
|
||||||
rmdir $RPM_BUILD_ROOT%{_datadir}/ncat
|
rmdir %{buildroot}%{_datadir}/ncat
|
||||||
|
|
||||||
#do not include uninstall script
|
#do not include uninstall script
|
||||||
rm -f $RPM_BUILD_ROOT%{_bindir}/uninstall_ndiff
|
rm -f %{buildroot}%{_bindir}/uninstall_ndiff
|
||||||
|
|
||||||
#use consolehelper
|
#use consolehelper
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/applications/zenmap*.desktop
|
rm -f %{buildroot}%{_datadir}/applications/zenmap*.desktop
|
||||||
rm -f $RPM_BUILD_ROOT%{_datadir}/zenmap/su-to-zenmap.sh
|
rm -f %{buildroot}%{_datadir}/zenmap/su-to-zenmap.sh
|
||||||
ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/zenmap-root
|
ln -s consolehelper %{buildroot}%{_bindir}/zenmap-root
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d \
|
mkdir -p %{buildroot}%{_sysconfdir}/pam.d \
|
||||||
$RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps
|
%{buildroot}%{_sysconfdir}/security/console.apps
|
||||||
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/zenmap-root
|
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/zenmap-root
|
||||||
install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/zenmap-root
|
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/security/console.apps/zenmap-root
|
||||||
|
|
||||||
cp docs/zenmap.1 $RPM_BUILD_ROOT%{_mandir}/man1/
|
cp docs/zenmap.1 %{buildroot}%{_mandir}/man1/
|
||||||
gzip $RPM_BUILD_ROOT%{_mandir}/man1/* || :
|
gzip %{buildroot}%{_mandir}/man1/* || :
|
||||||
pushd $RPM_BUILD_ROOT%{_mandir}/man1
|
pushd %{buildroot}%{_mandir}/man1
|
||||||
ln -s zenmap.1.gz nmapfe.1.gz
|
ln -s zenmap.1.gz nmapfe.1.gz
|
||||||
ln -s zenmap.1.gz xnmap.1.gz
|
ln -s zenmap.1.gz xnmap.1.gz
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#we provide 'nc' replacement
|
#we provide 'nc' replacement
|
||||||
ln -s ncat.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/nc.1.gz
|
ln -s ncat.1.gz %{buildroot}%{_mandir}/man1/nc.1.gz
|
||||||
ln -s ncat $RPM_BUILD_ROOT%{_bindir}/nc
|
ln -s ncat %{buildroot}%{_bindir}/nc
|
||||||
|
|
||||||
desktop-file-install --vendor nmap \
|
desktop-file-install --vendor nmap \
|
||||||
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
|
--dir %{buildroot}%{_datadir}/applications \
|
||||||
--add-category X-Red-Hat-Base \
|
--add-category X-Red-Hat-Base \
|
||||||
%{SOURCE1};
|
%{SOURCE1};
|
||||||
|
|
||||||
#for .desktop and app icon
|
#for .desktop and app icon
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/256x256/apps
|
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
|
||||||
ln -s ../../../../zenmap/pixmaps/zenmap.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/256x256/apps
|
ln -s ../../../../zenmap/pixmaps/zenmap.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
|
||||||
|
|
||||||
# fix end-of-line
|
# fix end-of-line
|
||||||
pushd $RPM_BUILD_ROOT
|
pushd %{buildroot}
|
||||||
for fe in ./%{python_sitelib}/zenmapCore/Paths.py
|
for fe in ./%{python_sitelib}/zenmapCore/Paths.py
|
||||||
do
|
do
|
||||||
dos2unix <$fe >$fe.new
|
dos2unix <$fe >$fe.new
|
||||||
@ -196,7 +197,7 @@ fi
|
|||||||
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%files -f nmap.lang
|
%files -f nmap.lang
|
||||||
%doc COPYING*
|
%doc COPYING*
|
||||||
@ -241,6 +242,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%changelog
|
%changelog
|
||||||
* Thu Aug 3 2017 Pavel Zhukov <pzhukov@redhat.com> - 2:7.60-2
|
* Thu Aug 3 2017 Pavel Zhukov <pzhukov@redhat.com> - 2:7.60-2
|
||||||
- Delete bundled libssh2
|
- Delete bundled libssh2
|
||||||
|
- Delete bundled zlib
|
||||||
|
|
||||||
* Wed Aug 02 2017 Pavel Zhukov <pzhukov@redhat.com> - 2:7.60-1
|
* Wed Aug 02 2017 Pavel Zhukov <pzhukov@redhat.com> - 2:7.60-1
|
||||||
- New release 7.60 (#1477387)
|
- New release 7.60 (#1477387)
|
||||||
@ -646,7 +648,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
* Mon Nov 18 2002 Tim Powers <timp@redhat.com>
|
* Mon Nov 18 2002 Tim Powers <timp@redhat.com>
|
||||||
- rebuild on all arches
|
- rebuild on all arches
|
||||||
- remove old desktop file from $$RPM_BUILD_ROOT so rpm won't complain
|
- remove old desktop file from $%{buildroot} so rpm won't complain
|
||||||
|
|
||||||
* Thu Aug 1 2002 Harald Hoyer <harald@redhat.de>
|
* Thu Aug 1 2002 Harald Hoyer <harald@redhat.de>
|
||||||
- version 3.0
|
- version 3.0
|
||||||
@ -694,7 +696,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
* Fri Nov 3 2000 Tim Powers <timp@redhat.com>
|
* Fri Nov 3 2000 Tim Powers <timp@redhat.com>
|
||||||
- fixed nmapdatadir in the install section, forgot lto include
|
- fixed nmapdatadir in the install section, forgot lto include
|
||||||
$RPM_BUILD_ROOT in the path
|
%{buildroot} in the path
|
||||||
|
|
||||||
* Thu Nov 2 2000 Tim Powers <timp@redhat.com>
|
* Thu Nov 2 2000 Tim Powers <timp@redhat.com>
|
||||||
- update to nmap-2.54BETA7 to possibly fix bug #20199
|
- update to nmap-2.54BETA7 to possibly fix bug #20199
|
||||||
@ -730,7 +732,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
- changed group to Applications/System
|
- changed group to Applications/System
|
||||||
- quiet setup
|
- quiet setup
|
||||||
- no need to create dirs in the install section, "make
|
- no need to create dirs in the install section, "make
|
||||||
prefix=$RPM_BUILD_ROOT&{prefix} install" does this.
|
prefix=%{buildroot}&{prefix} install" does this.
|
||||||
- using defined %%{prefix}, %%{version} etc. for easier/quicker maint.
|
- using defined %%{prefix}, %%{version} etc. for easier/quicker maint.
|
||||||
- added docs
|
- added docs
|
||||||
- gzip man pages
|
- gzip man pages
|
||||||
|
Loading…
Reference in New Issue
Block a user