#
# Conditional build:
-%bcond_without gtk # build without gtk-based frontend (fewer dependencies)
+%bcond_without geoip # GeoIP support
+%bcond_without gtk # gtk-based frontend
+%bcond_with gtk2 # use GTK+ 2.x instead of 3.x
+%bcond_with lua # experimental Lua support
#
Summary: ettercap - a ncurses-based sniffer/interceptor utility
Summary(pl.UTF-8): ettercap - oparte o ncurses narzędzie do sniffowania/przechwytywania
Summary(pt_BR.UTF-8): ettercap e um interceptador/sniffer paseado em ncurses
Name: ettercap
-Version: 0.7.3
+Version: 0.8.3
Release: 2
Epoch: 1
-License: GPL
+License: GPL v2+ with OpenSSL exception
Group: Networking/Utilities
-Source0: http://dl.sourceforge.net/ettercap/%{name}-NG-%{version}.tar.gz
-# Source0-md5: 28fb15cd024162c55249888fe1b97820
-Patch1: %{name}-ncurses.patch
-Patch2: %{name}-plugin_dir.patch
-Patch3: %{name}-kernel_version.patch
-Patch4: %{name}-as-needed.patch
-URL: http://ettercap.sourceforge.net/
-BuildRequires: autoconf
-BuildRequires: automake
-%{?with_gtk:BuildRequires: gtk+2-devel}
-BuildRequires: libltdl-devel
-BuildRequires: libnet-devel >= 1.1.2.1
+#Source0Download: https://github.com/Ettercap/ettercap/releases
+Source0: https://github.com/Ettercap/ettercap/releases/download/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 6b27d329a509e65fef9044c95a2dde35
+Patch0: %{name}-buildtype.patch
+Patch1: %{name}-gtk3.patch
+Patch2: %{name}-link.patch
+Patch3: %{name}-no-common.patch
+URL: https://www.ettercap-project.org/
+%{?with_geoip:BuildRequires: GeoIP-devel}
+BuildRequires: bison
+BuildRequires: cmake >= 2.8
+BuildRequires: curl-devel >= 7.26.0
+BuildRequires: flex
+%if %{with gtk}
+%{?with_gtk2:BuildRequires: gtk+2-devel >= 2:2.10}
+%{!?with_gtk2:BuildRequires: gtk+3-devel >= 3.12.0}
+%endif
+BuildRequires: libbsd-devel
+BuildRequires: libnet-devel >= 1:1.1.5
BuildRequires: libpcap-devel
+%{?with_lua:BuildRequires: luajit-devel >= 2.0.0}
BuildRequires: ncurses-ext-devel
BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: pcre-devel
+BuildRequires: pkgconfig
+BuildRequires: zlib-devel
+Requires: curl-libs >= 7.26.0
+%if %{with gtk}
+%{?with_gtk2:Requires: gtk+2 >= 2:2.10}
+%{!?with_gtk2:Requires: gtk+3 >= 3.12.0}
+%endif
+Requires: libnet >= 1:1.1.5
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define specflags -fomit-frame-pointer
(gateway, router ou um computador) e a distância estimada no hop.
%prep
-%setup -q -n %{name}-NG-%{version}
-#%patch1 -p0
-#%patch2 -p1
-%patch4 -p1
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
%build
-#cp -f /usr/share/automake/config.sub .
-#%{__aclocal}
-#%{__autoconf}
-#%{__autoheader}
-CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
-%configure \
- --%{!?debug:dis}%{?debug:en}able-debug \
- --%{?with_gtk:en}%{!?with_gtk:dis}able-gtk \
- --enable-plugins \
- --enable-https
+install -d build
+cd build
+%cmake .. \
+ -DBUNDLED_LIBS=OFF \
+ %{!?with_geoip:-DENABLE_GEOIP=OFF} \
+ %{!?with_gtk:-DENABLE_GTK=OFF} \
+ -DENABLE_IPV6=ON
+ %{?with_lua:-DENABLE_LUA=ON} \
+ %{?with_gtk2:-DGTK_BUILD_TYPE=GTK2}
+
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
+# API not exported
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libettercap*.so
+
%clean
rm -rf $RPM_BUILD_ROOT
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
%files
%defattr(644,root,root,755)
-%doc README CHANGELOG AUTHORS TODO doc/*
-%doc THANKS README.BUGS
-%attr(755,root,root) %{_bindir}/*
+%doc AUTHORS CHANGELOG LICENSE.OPENSSL README README.{BINARIES,BUGS} THANKS TODO doc/*
+%attr(755,root,root) %{_bindir}/ettercap
+%attr(755,root,root) %{_bindir}/ettercap-pkexec
+%attr(755,root,root) %{_bindir}/etterfilter
+%attr(755,root,root) %{_bindir}/etterlog
+%attr(755,root,root) %{_libdir}/libettercap.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libettercap.so.0
+%attr(755,root,root) %{_libdir}/libettercap-ui.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libettercap-ui.so.0
%dir %{_libdir}/ettercap
-%attr(755,root,root) %{_libdir}/ettercap/*.so
-%{_libdir}/ettercap/*.la
+%attr(755,root,root) %{_libdir}/ettercap/ec_*.so
+%dir %{_sysconfdir}/ettercap
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.dns
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.mdns
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.nbns
+%{_datadir}/appdata/ettercap.appdata.xml
%{_datadir}/ettercap
-%{_mandir}/man8/*
-%{_mandir}/man5/*
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/etter.conf
+%{_datadir}/polkit-1/actions/org.pkexec.ettercap.policy
+%{_desktopdir}/ettercap.desktop
+%{_pixmapsdir}/ettercap.svg
+%{_mandir}/man5/etter.conf.5*
+%{_mandir}/man8/ettercap.8*
+%{_mandir}/man8/ettercap-pkexec.8*
+%{_mandir}/man8/ettercap_curses.8*
+%{_mandir}/man8/ettercap_plugins.8*
+%{_mandir}/man8/etterfilter.8*
+%{_mandir}/man8/etterlog.8*