File nmap.spec of Package nmap

# spec file for package nmap (Version 5.21)
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

Name:           nmap
BuildRequires:  gcc-c++
BuildRequires:  gtk2-devel
BuildRequires:  libdnet-devel
BuildRequires:  libpcap-devel
BuildRequires:  lua-devel
BuildRequires:  openssl-devel
BuildRequires:  pcre-devel
BuildRequires:  python-devel
BuildRequires:  update-desktop-files
BuildRequires:  fdupes
BuildRequires:  dos2unix
License:        GPLv2+
Group:          Productivity/Networking/Diagnostic
AutoReqProv:    on
Version:        5.21
Release:        3
Summary:        Portscanner
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch:          nmap-4.00-libpcap-filter.diff
Patch1:         nmap-4.00-noreturn.diff
Patch2:         nmap-5.00-desktop_files.patch
Patch3:         nmap-4.75-nostrip.patch
Patch4:         no-md2.patch
Patch5:         nmap-5.21-gnomesu.patch

Nmap is designed to allow system administrators and curious individuals
to scan large networks to determine which hosts are up and what
services they are offering. XNmap is a graphical front-end that shows
nmap's output clearly.

Find documentation in %{_docdir}/%{name}

    Fyodor <>

%package -n zenmap 
License:        GPLv2+
Summary:        A Graphical Front-End for Nmap
Group:          Productivity/Networking/Diagnostic
Requires:       %name = %version
Obsoletes:      %name-gtk
Provides:       %name-gtk = %{version}-%{release}

%description -n zenmap
zenmap is a graphical front-end for the nmap network scanner

    Fyodor <>

%package -n ncat
License:        GPLv2+
Summary:        Network Tool to concatenate and redirect Sockets
Group:          Productivity/Networking/Diagnostic

%description -n ncat
Ncat is a feature-packed networking utility which will read and write data
across a network from the command line. Ncat was written for the Nmap Project
and is the culmination of the currently splintered family of Netcat
incarnations. It uses both TCP and UDP for communication and is designed to be
a reliable back-end tool to instantly provide network connectivity to other
applications and users. Ncat will not only work with IPv4 and IPv6 but provides
the user with a virtually limitless number of potential uses.

Among Ncat´s vast number of features there is the ability to chain Ncats
together, redirect both TCP and UDP ports to other sites, SSL support, and
proxy connections via SOCKS4 or HTTP (CONNECT method) proxies (with optional
proxy authentication as well). Some general principles apply to most
applications and thus give you the capability of instantly adding networking
support to software that would normally never support it.  

    Fyodor <>

%package -n ndiff
License:        GPLv2+
Summary:        Compare Results of Nmap Scans
Group:          Productivity/Networking/Diagnostic

%description -n ndiff
Ndiff is a tool to aid in the comparison of Nmap scans. It takes two Nmap XML
output files and prints the differences between them: hosts coming up and down,
ports becoming open or closed, etc.

    Fyodor <>

%setup -q
%patch1 -p1
%patch2 -p0
%patch3 -p0
%patch4 -p1
%patch5 -p0

#fix locale dir
mv zenmap/share/zenmap/locale zenmap/share
sed -i -e "s|^locale_dir =.*$|locale_dir = os.path.join('share','locale')|" \
 -e 's|join(self.install_data, data_dir)|join(self.install_data, "share")|' zenmap/
sed -i 's|^LOCALE_DIR = .*|LOCALE_DIR = join(prefix, "share", "locale")|' zenmap/zenmapCore/

#fix jp/ja pt_PT/pt zh/zh_CN locale
sed -i '/ALL_LINGUAS =/s/jp/ja/'
sed -i '/ALL_LINGUAS =/s/pt_PT/pt/'
sed -i '/ALL_LINGUAS =/s/zh/zh_CN/'
mv docs/man-xlate/nmap-jp.1 docs/man-xlate/nmap-ja.1
mv docs/man-xlate/nmap-pt_PT.1 docs/man-xlate/nmap-pt.1
mv docs/man-xlate/nmap-zh.1 docs/man-xlate/nmap-zh_CN.1

%configure --with-libpcap="%{_usr}" \
           --with-libdnet=included \

%__make %{?jobs:-j%jobs}

%__make DESTDIR="%{buildroot}" deskdir="%{_datadir}/gnome/apps/Utilities/" install
%__rm "%{buildroot}%{_bindir}/uninstall_zenmap"
%__install -d "%{buildroot}/usr/share/pixmaps/"
%__ln_s ../zenmap/pixmaps/zenmap.png "%{buildroot}/usr/share/pixmaps/zenmap.png"
%suse_update_desktop_file zenmap System Network
%suse_update_desktop_file zenmap-root System Network
%find_lang zenmap
touch -r %{buildroot}/%{python_sitelib}/zenmapCore/ %{buildroot}/%{python_sitelib}/zenmapCore/Paths.pyc
dos2unix %{buildroot}%{_datadir}/%{name}/nselib/data/oracle-sids

%fdupes -s %{buildroot}

%__rm -rf "%{buildroot}"

%doc docs/README 
%doc docs/nmap.usage.txt
%dir %{_mandir}/hr
%dir %{_mandir}/hr/man1
%dir %{_mandir}/hu
%dir %{_mandir}/hu/man1
%dir %{_mandir}/pl
%dir %{_mandir}/pl/man1
%dir %{_mandir}/pt
%dir %{_mandir}/pt/man1
%dir %{_mandir}/ro
%dir %{_mandir}/ro/man1
%dir %{_mandir}/ru
%dir %{_mandir}/ru/man1
%dir %{_mandir}/sk
%dir %{_mandir}/sk/man1
%dir %{_mandir}/zh_CN
%dir %{_mandir}/zh_CN/man1

%files -n zenmap -f zenmap.lang

%files -n ncat
%dir %{_datadir}/ncat
%config(noreplace) %{_datadir}/ncat/ca-bundle.crt

%files -n ndiff

openSUSE Build Service is sponsored by