arpwatch/arpwatch.spec

179 lines
5.7 KiB
RPMSpec
Raw Normal View History

2023-10-26 19:33:22 +08:00
%global pkgstatedir %{_sharedstatedir}/arpwatch
2019-09-30 10:31:38 -04:00
%global _hardened_build 1
Name: arpwatch
Epoch: 14
2024-01-08 09:25:41 +00:00
Version: 3.5
2023-10-26 19:33:22 +08:00
Release: 1
2019-09-30 10:31:38 -04:00
Summary: Network monitoring tools for tracking IP addresses on a network
2024-01-08 09:25:41 +00:00
License: BSD-3-Clause
2019-09-30 10:31:38 -04:00
URL: http://ee.lbl.gov/
Source0: https://ee.lbl.gov/downloads/arpwatch/arpwatch-%{version}.tar.gz
2019-09-30 10:31:38 -04:00
Source1: arpwatch.service
Source2: ethercodes-20110707.dat.bz2
2023-10-26 19:33:22 +08:00
Source3: arpwatch.sysconfig
BuildRequires: libpcap-devel systemd sendmail python3-devel
BuildRequires: gcc make
2019-09-30 10:31:38 -04:00
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
2023-10-26 19:33:22 +08:00
Requires: sendmail python3
Patch1: arpwatch-3.1-man-references.patch
Patch2: arpwatch-3.2-change-user.patch
Patch3: arpwatch-3.1-arp2ethers-sort-invocation.patch
Patch4: arpwatch-3.1-arpfetch-stray-rm.patch
Patch5: arpwatch-3.2-no-usr-local-path.patch
Patch6: arpwatch-3.1-configure-no-local-pcap.patch
Patch7: arpwatch-3.1-all-zero-bogon.patch
2024-01-08 09:25:41 +00:00
Patch8: arpwatch-3.5-exitcode.patch
Patch9: arpwatch-3.5-devlookup.patch
2023-10-26 19:33:22 +08:00
Patch10: arpwatch-3.3-c99.patch
Patch11: arpwatch-add-sw64-architecture.patch
2019-09-30 10:31:38 -04:00
%description
The arpwatch package contains arpwatch and arpsnmp. Arpwatch and
arpsnmp are both network monitoring tools that monitor ethernet or
FDDI network traffic and maintain a database of ethernet/ip address
pairings.
%package help
Summary: arpwatch help and arpsnmp help
%description help
The arpwatch-help package provides the help manual function separately.
%prep
%autosetup -n %{name}-%{version} -p1
2023-10-26 19:33:22 +08:00
# Substitute absolute paths to awk scripts in shell scripts
sed -r -i 's|(-f *)([^[:blank:]+]\.awk)|\1%{_datadir}/arpwatch/\2|' arp2ethers
sed -r -i 's|/usr/local/arpwatch|%{pkgstatedir}|g' *.8.in *.sh.in *.sh
sed -r -i 's|/usr/local/bin/python|/usr/bin/python3|g' update-ethercodes.sh.in
2024-01-08 09:25:41 +00:00
awk '/^ \* / { print substr($0, 4); } /^ \*\// { exit }' arpwatch.c | tee LICENSE
2019-09-30 10:31:38 -04:00
%build
2024-01-08 09:25:41 +00:00
%set_build_flags
# Prior to version 3.4, this was handled by the configure script. If it is not
# defined, the build failes because time.h is not included in report.c. This
# regregression was reported upstream by email to arpwatch@ee.lbl.gov on
# 2023-09-06.
export CPPFLAGS="${CPPFLAGS-} -DTIME_WITH_SYS_TIME=1"
2023-10-26 19:33:22 +08:00
%configure --with-sendmail=/usr/sbin/sendmail PYTHON=/usr/bin/python3
%make_build ARPDIR=%{pkgstatedir}
2019-09-30 10:31:38 -04:00
%install
install -d $RPM_BUILD_ROOT%{_mandir}/man8
install -d $RPM_BUILD_ROOT%{_sbindir}
2023-10-26 19:33:22 +08:00
install -d $RPM_BUILD_ROOT%{_datadir}/arpwatch
install -d $RPM_BUILD_ROOT%{pkgstatedir}
2019-09-30 10:31:38 -04:00
install -d $RPM_BUILD_ROOT%{_unitdir}
2023-10-26 19:33:22 +08:00
install -d $RPM_BUILD_ROOT%{_prefix}/etc/rc.d
%make_install
install -p -t $RPM_BUILD_ROOT%{_datadir}/arpwatch -m 0644 *.awk
install -p -t $RPM_BUILD_ROOT%{_sbindir} arp2ethers
install -p massagevendor.py $RPM_BUILD_ROOT%{_sbindir}/massagevendor
install -p -t $RPM_BUILD_ROOT%{pkgstatedir} -m0644 *.dat
touch $RPM_BUILD_ROOT%{pkgstatedir}/arp.dat- $RPM_BUILD_ROOT%{pkgstatedir}/arp.dat.new
install -p -t $RPM_BUILD_ROOT%{_unitdir} -m 0644 %{SOURCE1}
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/arpwatch
install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{pkgstatedir}/ethercodes.dat.bz2
bunzip2 -f %{buildroot}%{pkgstatedir}/ethercodes.dat.bz2
# Remove legacy init scripts:
rm -rvf %{buildroot}%{_prefix}/etc/rc.d
2019-09-30 10:31:38 -04:00
%pre
2023-10-26 19:33:22 +08:00
getent group arpwatch >/dev/null || groupadd -f -g 77 -r arpwatch
if ! getent passwd arpwatch >/dev/null
then
if ! getent passwd 77 >/dev/null
then
useradd -r -u 77 -g arpwatch \
-d %{pkgstatedir} -s /sbin/nologin \
-c Service user for arpwatch arpwatch
else
useradd -r -g arpwatch \
-d %{pkgstatedir} -s /sbin/nologin \
-c Service user for arpwatch arpwatch
fi
2019-09-30 10:31:38 -04:00
fi
2023-10-26 19:33:22 +08:00
exit 0
2019-09-30 10:31:38 -04:00
%preun
%systemd_preun arpwatch.service
%post
%systemd_post arpwatch.service
%postun
%systemd_postun_with_restart arpwatch.service
%files
2024-01-08 09:25:41 +00:00
%license LICENSE
2019-09-30 10:31:38 -04:00
%doc README CHANGES arpfetch
2023-10-26 19:33:22 +08:00
%attr(0755,-,-)%{_sbindir}/arpwatch
%attr(0755,-,-)%{_sbindir}/arpsnmp
2019-09-30 10:31:38 -04:00
%{_sbindir}/arp2ethers
%{_sbindir}/massagevendor
2023-10-26 19:33:22 +08:00
%dir %{_datadir}/arpwatch
%{_datadir}/arpwatch/*.awk
2019-09-30 10:31:38 -04:00
%{_unitdir}/arpwatch.service
2023-10-26 19:33:22 +08:00
%config(noreplace) %{_sysconfdir}/sysconfig/arpwatch
%attr(1775,-,arpwatch) %dir %{pkgstatedir}
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/arp.dat
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/arp.dat-
%attr(0600,arpwatch,arpwatch) %verify(not md5 size mtime) %ghost %{pkgstatedir}/arp.dat.new
%attr(0644,-,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{pkgstatedir}/ethercodes.dat
2019-09-30 10:31:38 -04:00
%files help
%{_mandir}/man8/*.8*
%changelog
2024-01-08 09:25:41 +00:00
* Mon Jan 08 2024 yanglu<yanglu72@h-partners.com> - 14:3.5-1
- Type:requirements
- Id:NA
- SUG:NA
- DESC:update arpwatch version to 3.5
2023-10-26 19:33:22 +08:00
* Thu Oct 26 2023 yanglu<yanglu72@h-partners.com> - 14:3.3-1
- Type:requirements
- Id:NA
- SUG:NA
- DESC:update arpwatch version to 3.3
2022-08-04 10:47:12 +08:00
* Thu Jul 28 2022 wuzx<wuzx1226@qq.com> - 14:2.1a15-48
- Type:feature
- Id:NA
- SUG:NA
- DESC:Added sw64 patch
2022-06-08 14:23:31 +08:00
* Fri Jun 25 2021 lijingyuan <lijingyuan3@huawei.com> - 14:2.1a15-47
2021-06-02 10:56:16 +08:00
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:Added the gcc dependency
* Thu Mar 25 2021 liulong <liulong20@huawei.com> - 14:2.1a15-46
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:Modify the changelog description.
* Tue Dec 15 2020 xihaochen <xihaochen@huawei.com> - 14:2.1a15-45
- Type:requirements
- Id:NA
- SUG:NA
- DESC:remove sensitive keywords and update source url
2019-09-30 10:31:38 -04:00
* Fri Sep 06 2019 Alex Chao <zhaolei746@huawei.com> - 14:2.1a15-44
- Package init