83d119
%global _vararpwatch %{_localstatedir}/lib/arpwatch
83d119
%global _hardened_build 1
83d119
83d119
Name: arpwatch
83d119
Epoch: 14
83d119
Version: 2.1a15
407f12
Release: 44%{?dist}
83d119
Summary: Network monitoring tools for tracking IP addresses on a network
83d119
Group: Applications/System
83d119
License: BSD with advertising
83d119
URL: http://ee.lbl.gov/
83d119
Requires(pre): shadow-utils
83d119
Requires(post): systemd
83d119
Requires(preun): systemd
83d119
Requires(postun): systemd
83d119
Requires: /usr/sbin/sendmail
83d119
BuildRequires: /usr/sbin/sendmail libpcap-devel perl-interpreter systemd
83d119
83d119
Source0: ftp://ftp.ee.lbl.gov/arpwatch-%{version}.tar.gz
83d119
Source1: arpwatch.service
83d119
# created by:
83d119
# wget -O- http://standards.ieee.org/regauth/oui/oui.txt | \
83d119
# iconv -f iso8859-1 -t utf8 | massagevendor | bzip2
83d119
Source3: ethercodes-20110707.dat.bz2
83d119
Patch1: arpwatch-2.1a4-fhs.patch
83d119
Patch2: arpwatch-2.1a10-man.patch
83d119
Patch3: arpwatch-drop.patch
83d119
Patch4: arpwatch-drop-man.patch
83d119
Patch5: arpwatch-addr.patch
83d119
Patch6: arpwatch-dir-man.patch
83d119
Patch7: arpwatch-scripts.patch
83d119
Patch8: arpwatch-2.1a15-nolocalpcap.patch
83d119
Patch9: arpwatch-2.1a15-bogon.patch
83d119
Patch10: arpwatch-2.1a15-extraman.patch
83d119
Patch11: arpwatch-exitcode.patch
83d119
Patch12: arpwatch-2.1a15-dropgroup.patch
83d119
Patch13: arpwatch-2.1a15-devlookup.patch
83d119
Patch14: arpwatch-2.1a15-lookupiselect.patch
83d119
Patch16: arpwatch-201301-ethcodes.patch
83d119
Patch17: arpwatch-pie.patch
83d119
Patch18: arpwatch-aarch64.patch
83d119
Patch19: arpwatch-promisc.patch
407f12
Patch20: arpwatch-ethernet-address-format.patch
83d119
83d119
%description
83d119
The arpwatch package contains arpwatch and arpsnmp.  Arpwatch and
83d119
arpsnmp are both network monitoring tools.  Both utilities monitor
83d119
Ethernet or FDDI network traffic and build databases of Ethernet/IP
83d119
address pairs, and can report certain changes via email.
83d119
83d119
Install the arpwatch package if you need networking monitoring devices
83d119
which will automatically keep track of the IP addresses on your
83d119
network.
83d119
83d119
%prep
83d119
%setup -q
83d119
83d119
%patch1 -p1 -b .fhs
83d119
%patch2 -p1 -b .arpsnmpman
83d119
%patch3 -p1 -b .droproot
83d119
%patch4 -p0 -b .droprootman
83d119
%patch5 -p1 -b .mailuser
83d119
%patch6 -p1 -b .dirman
83d119
%patch7 -p1 -b .scripts
83d119
%patch8 -p1 -b .nolocalpcap
83d119
%patch9 -p1 -b .bogon
83d119
%patch10 -p1 -b .extraman
83d119
%patch11 -p1 -b .exitcode
83d119
%patch12 -p1 -b .dropgroup
83d119
%patch13 -p1 -b .devlookup
83d119
%patch14 -p1 -b .iselect
83d119
%patch16 -p1 -b .ethcode
83d119
%patch17 -p1 -b .pie
83d119
%patch18 -p1 -b .aarch64
83d119
%patch19 -p1 -b .promisc
407f12
%patch20 -p1 -b .ethernet-address
83d119
83d119
%build
83d119
%configure
83d119
make ARPDIR=%{_vararpwatch}
83d119
83d119
%install
83d119
83d119
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
83d119
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
83d119
mkdir -p $RPM_BUILD_ROOT%{_vararpwatch}
83d119
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
83d119
touch $RPM_BUILD_ROOT%{_vararpwatch}/arp.dat-
83d119
make DESTDIR=$RPM_BUILD_ROOT install install-man
83d119
83d119
# prepare awk scripts
83d119
perl -pi -e "s/\'/\'\\\'\'/g" *.awk
83d119
83d119
# and embed them
83d119
for i in arp2ethers massagevendor massagevendor-old; do
83d119
	cp -f $i $RPM_BUILD_ROOT%{_sbindir}
83d119
	for j in *.awk; do
83d119
		sed "s/-f\ *\(\<$j\>\)/\'\1\n\' /g" \
83d119
			< $RPM_BUILD_ROOT%{_sbindir}/$i \
83d119
			| sed "s/$j\$//;tx;b;:x;r$j" \
83d119
			> $RPM_BUILD_ROOT%{_sbindir}/$i.x
83d119
		mv -f $RPM_BUILD_ROOT%{_sbindir}/$i{.x,}
83d119
	done
83d119
	chmod 755 $RPM_BUILD_ROOT%{_sbindir}/$i
83d119
done
83d119
83d119
install -p -m644 *.dat $RPM_BUILD_ROOT%{_vararpwatch}
83d119
install -p -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/arpwatch.service
83d119
install -p -m644 %{SOURCE3} $RPM_BUILD_ROOT%{_vararpwatch}/ethercodes.dat.bz2
83d119
bzip2 -df $RPM_BUILD_ROOT%{_vararpwatch}/ethercodes.dat.bz2
83d119
83d119
rm -f $RPM_BUILD_ROOT%{_sbindir}/massagevendor-old
83d119
83d119
%post
83d119
%systemd_post arpwatch.service
83d119
83d119
%pre
83d119
if ! getent group arpwatch &> /dev/null; then
83d119
	getent group pcap 2> /dev/null | grep -q 77 &&
83d119
		/usr/sbin/groupmod -n arpwatch pcap 2> /dev/null ||
83d119
		/usr/sbin/groupadd -g 77 arpwatch 2> /dev/null
83d119
fi
83d119
if ! getent passwd arpwatch &> /dev/null; then
83d119
	getent passwd pcap 2> /dev/null | grep -q 77 &&
83d119
		/usr/sbin/usermod -l arpwatch -g 77 \
83d119
			-d %{_vararpwatch} pcap 2> /dev/null ||
83d119
		/usr/sbin/useradd -u 77 -g 77 -s /sbin/nologin \
83d119
			-M -r -d %{_vararpwatch} arpwatch 2> /dev/null
83d119
fi
83d119
:
83d119
83d119
%postun
83d119
%systemd_postun_with_restart arpwatch.service
83d119
83d119
%preun
83d119
%systemd_preun arpwatch.service
83d119
83d119
%files
83d119
%doc README CHANGES arpfetch
83d119
%{_sbindir}/arpwatch
83d119
%{_sbindir}/arpsnmp
83d119
%{_sbindir}/arp2ethers
83d119
%{_sbindir}/massagevendor
83d119
%{_mandir}/man8/*.8*
83d119
%{_unitdir}/arpwatch.service
83d119
%attr(1775,-,arpwatch) %dir %{_vararpwatch}
83d119
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/arp.dat
83d119
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/arp.dat-
83d119
%attr(0600,arpwatch,arpwatch) %verify(not md5 size mtime) %ghost %{_vararpwatch}/arp.dat.new
83d119
%attr(0644,-,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/ethercodes.dat
83d119
83d119
%changelog
407f12
* Tue Dec  3 2019 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-43
407f12
- MAC addresses are not shown properly (#1778313)
407f12
83d119
* Mon Mar  5 2018 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-42
83d119
- make sure arpwatch starts after network devices are up (#1551431)
83d119
83d119
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 14:2.1a15-41
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
83d119
83d119
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 14:2.1a15-40
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
83d119
83d119
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 14:2.1a15-39
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
83d119
83d119
* Mon Feb 20 2017 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-38
83d119
- fix FTBFS (#1423238)
83d119
83d119
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 14:2.1a15-37
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
83d119
83d119
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 14:2.1a15-36
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
83d119
83d119
* Tue Jan 26 2016 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-35
83d119
- fix arpwatch buffer overflow (#1301880)
83d119
- add -p option that disables promiscuous mode (#1301853)
83d119
83d119
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-34
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
83d119
83d119
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-33
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
83d119
83d119
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-32
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
83d119
83d119
* Mon Feb  3 2014 Jan Synáček <jsynacek@redhat.com> 14:2.1a15-31
83d119
- reference documentation in the service file
83d119
- remove redundant sysconfig-related stuff
83d119
83d119
* Sun Aug  4 2013 Peter Robinson <pbrobinson@fedoraproject.org> 14:2.1a15-30
83d119
- Fix FTBFS
83d119
83d119
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-29
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
83d119
83d119
* Tue Apr 23 2013 Jan Synáček <jsynacek@redhat.com> 14:2.1a15-28
83d119
- harden the package (#954336)
83d119
- support aarch64 (#925027)
83d119
83d119
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-27
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
83d119
83d119
* Thu Jan 17 2013 Ales Ledvinka <aledvink@redhat.com> - 14:2.1a15-26
83d119
- fix permissions related to collected database
83d119
- update ethcodes defaults to current public IEEE OUI-32
83d119
83d119
* Mon Oct 15 2012 Ales Ledvinka <aledvink@redhat.com> - 14:2.1a15-25
83d119
- fix -i with invalid interface specified (#842660)
83d119
83d119
* Mon Oct 15 2012 Ales Ledvinka <aledvink@redhat.com> - 14:2.1a15-24
83d119
- fix devlookup to start with -i interface specified (#842660)
83d119
83d119
* Wed Aug 22 2012 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-23
83d119
- Add system-rpm macros (#850032)
83d119
83d119
* Tue Jul 24 2012 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-22
83d119
- add devlookup patch: search for suitable default interface, if -i is not
83d119
  specified (#842660)
83d119
83d119
* Thu Jul 19 2012 Jan Synáček <jsynacek@redhat.com> - 14:2.1a15-21
83d119
- make spec slightly more fedora-review-friendly
83d119
83d119
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-21
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
83d119
83d119
* Thu May 31 2012 Aleš Ledvinka <aledvink@redhat.com> 14:2.1a15-20
83d119
- fix supplementary group list (#825328) (CVE-2012-2653)
83d119
83d119
* Thu Jan 19 2012 Jan Synáček <jsynacek@redhat.com> 14:2.1a15-19
83d119
- Turn on PrivateTmp=true in service file (#782477)
83d119
83d119
* Thu Jan 05 2012 Jan Synáček <jsynacek@redhat.com> 14:2.1a15-18
83d119
- Rebuilt for GCC 4.7
83d119
83d119
* Fri Jul 08 2011 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-17
83d119
- exit with zero error code (#699285)
83d119
- change service type to forking (#699285)
83d119
83d119
* Thu Jul 07 2011 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-16
83d119
- replace SysV init script with systemd service (#699285)
83d119
- update ethercodes.dat
83d119
83d119
* Mon Mar 28 2011 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-15
83d119
- update ethercodes.dat (#690948)
83d119
83d119
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-14
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
83d119
83d119
* Tue Mar 30 2010 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-13
83d119
- update ethercodes.dat (#577552)
83d119
- mark ethercodes.dat as noreplace
83d119
- fix init script LSB compliance
83d119
- include Debian arp2ethers and massagevendor man pages (#526160)
83d119
- don't include massagevendor-old script anymore
83d119
83d119
* Wed Sep 02 2009 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-12
83d119
- update ethercodes.dat
83d119
83d119
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-11
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
83d119
83d119
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14:2.1a15-10
83d119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
83d119
83d119
* Tue Sep 16 2008 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-9
83d119
- update ethercodes.dat (#462364)
83d119
83d119
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 14:2.1a15-8
83d119
- Autorebuild for GCC 4.3
83d119
83d119
* Wed Aug 22 2007 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-7
83d119
- rebuild
83d119
83d119
* Thu Aug 09 2007 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-6
83d119
- improve init script (#246869)
83d119
- allow -n 0/32 to disable reporting bogons from 0.0.0.0 (#244606)
83d119
- update license tag
83d119
- update ethercodes.dat
83d119
83d119
* Wed Jun 13 2007 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-5
83d119
- update ethercodes.dat
83d119
83d119
* Thu May 24 2007 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-4
83d119
- fix return codes in init script (#237781)
83d119
83d119
* Mon Jan 15 2007 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-3
83d119
- rename pcap user to arpwatch
83d119
83d119
* Tue Nov 28 2006 Miroslav Lichvar <mlichvar@redhat.com> 14:2.1a15-2
83d119
- split from tcpdump package (#193657)
83d119
- update to 2.1a15
83d119
- clean up files in /var
83d119
- force linking with system libpcap