LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ettercap.spec of Package ettercap (Project home:aevseev)

%define realname ettercap
%define srcext   tar.bz2

# Common info
Name:          %{realname}
Version:       0.7.6
Release:       wiz%{?extraver:0.}1
License:       GPL-2.0
Group:         Productivity/Networking/Security
URL:           http://ettercap.github.io/ettercap/
Summary:       Suite for man in the middle attacks on LAN

# Build-time parameters
BuildRequires: bison flex pkgconfig cmake groff ghostscript
BuildRequires: libpcap-devel ncurses-devel libnet-devel
%if 0%{?suse_version} >= 1130 || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600 || 0%{?scientificlinux_version} >= 600
BuildRequires: pkgconfig(zlib) pkgconfig(libcrypto) pkgconfig(libpcre) pkgconfig(gtk+-2.0)
BuildRequires: zlib-devel openssl-devel pcre-devel gtk-devel
%if 0%{?suse_version}
BuildRequires: libtool update-desktop-files fdupes
BuildRequires: libcurl-devel >= 7.26.0
BuildRequires: libtool-ltdl-devel
BuildRequires: curl-devel >= 7.26.0
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

Ettercap is a comprehensive suite for man in the middle attacks. It features
sniffing of live connections, content filtering on the fly and many other
interesting tricks. It supports active and passive dissection of many protocols
and includes many features for network and host analysis.

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{version}
%{__sed} -i '8ainclude(CheckLibraryExists)\n' cmake/Modules/EttercapLibCheck.cmake

###export SUSE_ASNEEDED=0
mkdir build
cd build
cmake .. \
%ifarch x86_64
 -DCMAKE_C_FLAGS="%{optflags} -I%{_includedir}/ncurses" \
 -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--strip-all" \
%{__make} %{?_smp_mflags}

cd build
%{__make} install DESTDIR=%{buildroot}
cd ..
%{__install} -D -m644 desktop/ettercap.desktop %{buildroot}%{_datadir}/applications/ettercap.desktop
%{__install} -D -m644 desktop/ettercap.svg     %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/ettercap.svg
%if 0%{?suse_version}
%suse_update_desktop_file ettercap System Security GTK
%fdupes %{buildroot}%{_datadir}

[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%dir %{_sysconfdir}/ettercap
%config(noreplace) %{_sysconfdir}/ettercap/*
%doc %{_mandir}/man5/*
%doc %{_mandir}/man8/*
%dir %{_datadir}/icons/hicolor/scalable/apps
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/polkit-1/actions
%dir %{_datadir}/polkit-1

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig