# Tests by default. No tests: rpm -ba --define 'dotests 0' tcpdump*.spec %{!?dotests: %define dotests 1} Summary: A tool for network monitoring and data acquisition. Name: tcpdump Version: 4.9.2 Release: 2 License: IBM_ILA URL: http://www.tcpdump.org Group: Applications/Networking Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz Source1: IBM_ILA #Source2: %{name}-%{version}-%{release}.build.log BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: libpcap-devel >= 1.9.0-1 BuildRequires: sed Requires: libpcap >= 1.9.0-1 %description Tcpdump is a command-line tool for monitoring network traffic. Tcpdump can capture and display the packet headers on a particular network interface or on all interfaces. Tcpdump can display all of the packet headers, or just the ones that match particular criteria. Install tcpdump if you need a program to monitor network traffic. %prep %setup -q # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit mkdir /tmp/%{name}-%{version}-32bit mv * /tmp/%{name}-%{version}-32bit mkdir 32bit mv /tmp/%{name}-%{version}-32bit/* 32bit rm -rf /tmp/%{name}-%{version}-32bit mkdir 64bit cp -rp 32bit/* 64bit/ %build export AR="/usr/bin/ar -X32_64" #first build 64-bit version cd 64bit export CC="gcc -maix64 -O2" export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} # --disable-ipv6 is no more an option of TCPDUMP configure make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi #now build 32-bit version cd ../32bit export CC="gcc -maix32 -D_LARGE_FILES -O2" export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} # --disable-ipv6 is no more an option of TCPDUMP configure make %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_sbindir} for f in * do mv ${f} ${f}_64 done ) mv -f ${RPM_BUILD_ROOT}%{_mandir}/man1 ${RPM_BUILD_ROOT}%{_mandir}/man8 # fix section numbers /opt/freeware/bin/sed -i 's/\(\.TH[a-zA-Z ]*\)[1-9]\(.*\)/\18\2/' \ ${RPM_BUILD_ROOT}%{_mandir}/man8/* cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} strip -X32_64 ${RPM_BUILD_ROOT}%{_sbindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_sbindir} for f in tcpdump tcpdump.4.9.2 do mv ${f} ${f}_32 done ) # Make 64bit executable as default ( cd ${RPM_BUILD_ROOT}%{_sbindir} for f in tcpdump tcpdump.4.9.2 do ln -sf ${f}_64 ${f} done ) cd ${RPM_BUILD_ROOT} mkdir -p usr/linux/bin cd usr/linux/bin ln -sf ../../..%{_sbindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/LICENSE 32bit/README.md 32bit/CHANGES 32bit/CREDITS %{_sbindir}/* %{_mandir}/man8/* /usr/linux/bin/* %changelog * Fri Dec 7 2018 Ravi Hirekurabar - 4.9.2-2 - Rebuilt due to compatibility issue with libpcap built with gcc * Mon Nov 6 2017 Reshma V Kumar - Update to 4.9.2 to fix security vulnerability * Wed Mar 15 2017 Reshma V Kumar - Update to 4.9.0 to fix security vulnerability * Tue Dec 13 2016 Reshma V Kumar 4.8.1-1 - Update to latest version * Thu Apr 14 2016 Ravi Hirekurabar 4.7.4 - Update to version 4.7.4 * Mon Jan 19 2004 David Clissold 3.8.1-1 - Update to version 3.8.1 * Fri Nov 22 2002 David Clissold - Add IBM ILA license. * Fri Jul 19 2002 Chris Tysor - Update to version 3.7.1, add missing %doc files. * Mon Feb 11 2002 David Clissold - Strip the binary. * Wed May 30 2001 Marc Stephenson - Corrected summary and description * Tue May 22 2001 Marc Stephenson - Minor modifications * Mon May 21 2001 Olof Johansson - First version