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)
%else
BuildRequires: zlib-devel openssl-devel pcre-devel gtk-devel
%endif
%if 0%{?suse_version}
BuildRequires: libtool update-desktop-files fdupes
BuildRequires: libcurl-devel >= 7.26.0
%else
BuildRequires: libtool-ltdl-devel
BuildRequires: curl-devel >= 7.26.0
%endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

%description
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)
%prep
%setup -q -n %{realname}-%{version}
%{__sed} -i '8ainclude(CheckLibraryExists)\n' cmake/Modules/EttercapLibCheck.cmake

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

%install
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}
%endif

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

%files
%defattr(-,root,root)
%doc AUTHORS LICENSE LICENSE.OPENSSL README README.PLATFORMS THANKS TODO
%dir %{_sysconfdir}/ettercap
%config(noreplace) %{_sysconfdir}/ettercap/*
%{_bindir}/*
%{_libdir}/%{name}/
%{_libdir}/libettercap.so
%{_datadir}/%{name}/
%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
%{_datadir}/applications/ettercap.desktop
%{_datadir}/icons/hicolor/scalable/apps/ettercap.svg
%{_datadir}/pixmaps/ettercap.svg
%{_datadir}/polkit-1/actions/org.pkexec.ettercap.policy

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

%changelog