File dsniff.spec of Package dsniff

#
# spec file for package dsniff
#
# Copyright (c) 2011 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 http://bugs.opensuse.org/
#

Name:           dsniff
Version:        2.4_0.1
%define pkg_version 2.4b1
%define pkg_srcdir  2.4
Release:        1
License:        BSD License (original)
Summary:        Sniffing Utilities for Network Security Testing
Url:            http://monkey.org/~dugsong/dsniff/
Group:          Productivity/Networking/Security
Source:         http://monkey.org/~dugsong/dsniff/beta/dsniff-%{pkg_version}.tar.gz
# PATCH-FIX-OPENSUSE dsniff-time_h.diff pascal.bleser@opensuse.org --
Patch1:         dsniff-time_h.diff
# PATCH-FIX-OPENSUSE dsniff-mailsnarf-corrupt.diff pascal.bleser@opensuse.org --
Patch2:         dsniff-mailsnarf-corrupt.diff
# PATCH-FIX-OPENSUSE dsniff-multiple_intf.diff pascal.bleser@opensuse.org --
Patch3:         dsniff-multiple_intf.diff
# PATCH-FIX-OPENSUSE dsniff-urlsnarf-zeropad.diff pascal.bleser@opensuse.org --
Patch4:         dsniff-urlsnarf-zeropad.diff
# PATCH-FIX-OPENSUSE dsniff-pcap_read_dump.diff pascal.bleser@opensuse.org --
Patch5:         dsniff-pcap_read_dump.diff
# PATCH-FIX-OPENSUSE dsniff-amd64-fix.diff pascal.bleser@opensuse.org --
Patch6:         dsniff-amd64-fix.diff
# PATCH-FIX-OPENSUSE dsniff-libnet-1.1.diff pascal.bleser@opensuse.org --
Patch7:         dsniff-libnet-1.1.diff
# PATCH-FIX-OPENSUSE dsniff-sshow-clk_tck.diff pascal.bleser@opensuse.org --
Patch8:         dsniff-sshow-clk_tck.diff
# PATCH-FIX-OPENSUSE dsniff-sshcrypto-includes.diff pascal.bleser@opensuse.org --
Patch9:         dsniff-sshcrypto-includes.diff
# PATCH-FIX-OPENSUSE dsniff-config-sysconfdir.diff pascal.bleser@opensuse.org --
Patch10:        dsniff-config-sysconfdir.diff
# PATCH-FIX-OPENSUSE dsniff-configure-ac_libobj.diff pascal.bleser@opensuse.org --
Patch11:        dsniff-configure-ac_libobj.diff
# PATCH-FIX-OPENSUSE dsniff-memset-proto.diff pascal.bleser@opensuse.org --
Patch12:        dsniff-memset-proto.diff
# PATCH-FIX-OPENSUSE dsniff-rename-csin.diff pascal.bleser@opensuse.org --
Patch13:        dsniff-rename-csin.diff
# PATCH-FIX-OPENSUSE dsniff-lib64.diff pascal.bleser@opensuse.org --
Patch14:        dsniff-lib64.diff
# PATCH-FIX-OPENSUSE dsniff-2.4-link_layer_offset.patch pascal.bleser@opensuse.org -- from Debian and Fedora, adds support for DSL, PPP, ... interfaces
Patch15:        dsniff-2.4-link_layer_offset.patch
BuildRequires:  db-devel
BuildRequires:  gcc
BuildRequires:  glibc-devel
%if 0%{?suse_version} <= 1130
BuildRequires:  libnet
BuildRequires:  glib2-devel
%else
BuildRequires:  libnet-devel
BuildRequires:  pkgconfig(glib-2.0)
%endif
BuildRequires:  libnids-devel
BuildRequires:  libpcap-devel
BuildRequires:  libtool
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  xorg-x11-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:	%ix86 amd64 x86_64 ia32e

%description
dsniff is a collection of tools for network auditing and penetration testing.

dsniff, filesnarf, mailsnarf, msgsnarf, urlsnarf, and webspy passively monitor
a network for interesting data (passwords, e-mail, files, etc.).

arpspoof, dnsspoof, and macof facilitate the interception of network traffic
normally unavailable to an attacker (e.g, due to layer-2 switching).
sshmitm and webmitm implement active monkey-in-the-middle attacks against
redirected SSH and HTTPS sessions by exploiting weak bindings in ad-hoc PKI.

%prep
%setup -q -n "dsniff-%{pkg_srcdir}"
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12
%patch13
%if "%{_lib}"=="lib64"
%patch14
%endif
%patch15 -p1

sed -i 's|/usr/local/lib/|%{_sysconfdir}/|' *.8 pathnames.h
%if "%{_lib}"=="lib64"
sed -i 's|/usr/lib|%{_libdir}|g' configure
%endif

%build
autoreconf -fiv

%if 0%{?suse_version} >= 1020
export LDFLAGS="`pkg-config --libs glib-2.0` `pkg-config --libs gthread-2.0`"
%endif
%configure

# don't pass -j, causes random build failures
make

%install
make install_prefix=%{buildroot} install

%clean
%{?buildroot:rm -rf %{buildroot}}

%files
%defattr(-,root,root)
%doc CHANGES LICENSE README TODO
%config(noreplace) %{_sysconfdir}/dnsspoof.hosts
%config(noreplace) %{_sysconfdir}/dsniff.magic
%config(noreplace) %{_sysconfdir}/dsniff.services
%{_sbindir}/arpspoof
%{_sbindir}/dnsspoof
%{_sbindir}/dsniff
%{_sbindir}/filesnarf
%{_sbindir}/macof
%{_sbindir}/mailsnarf
%{_sbindir}/msgsnarf
%{_sbindir}/sshmitm
%{_sbindir}/sshow
%{_sbindir}/tcpkill
%{_sbindir}/tcpnice
%{_sbindir}/urlsnarf
%{_sbindir}/webmitm
%{_sbindir}/webspy
%doc %{_mandir}/man8/arpspoof.8*
%doc %{_mandir}/man8/dnsspoof.8*
%doc %{_mandir}/man8/dsniff.8*
%doc %{_mandir}/man8/filesnarf.8*
%doc %{_mandir}/man8/macof.8*
%doc %{_mandir}/man8/mailsnarf.8*
%doc %{_mandir}/man8/msgsnarf.8*
%doc %{_mandir}/man8/sshmitm.8*
%doc %{_mandir}/man8/sshow.8*
%doc %{_mandir}/man8/tcpkill.8*
%doc %{_mandir}/man8/tcpnice.8*
%doc %{_mandir}/man8/urlsnarf.8*
%doc %{_mandir}/man8/webmitm.8*
%doc %{_mandir}/man8/webspy.8*

%changelog
openSUSE Build Service is sponsored by