1 Star 0 Fork 11

王士万/arpwatch

forked from src-openEuler/arpwatch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
arpwatch.spec 4.67 KB
一键复制 编辑 原始数据 按行查看 历史
李静元007 提交于 2021-06-02 10:56 . Added the gcc dependency
%global _vararpwatch %{_localstatedir}/lib/arpwatch
%global _hardened_build 1
Name: arpwatch
Epoch: 14
Version: 2.1a15
Release: 47
Summary: Network monitoring tools for tracking IP addresses on a network
License: BSD with advertising
URL: http://ee.lbl.gov/
Source0: https://ee.lbl.gov/downloads/arpwatch/arpwatch-%{version}.tar.gz
Source1: arpwatch.service
Source2: ethercodes-20110707.dat.bz2
BuildRequires: libpcap-devel perl-interpreter systemd sendmail
BuildRequires: gcc
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: sendmail
# The following patches come from upstream
Patch0001: arpwatch-2.1a4-fhs.patch
Patch0002: arpwatch-2.1a10-man.patch
Patch0003: arpwatch-drop.patch
Patch0004: arpwatch-drop-man.patch
Patch0005: arpwatch-addr.patch
Patch0006: arpwatch-dir-man.patch
Patch0007: arpwatch-scripts.patch
Patch0008: arpwatch-2.1a15-nolocalpcap.patch
Patch0009: arpwatch-2.1a15-bogon.patch
Patch0010: arpwatch-2.1a15-extraman.patch
Patch0011: arpwatch-exitcode.patch
Patch0012: arpwatch-2.1a15-dropgroup.patch
Patch0013: arpwatch-2.1a15-devlookup.patch
Patch0014: arpwatch-2.1a15-lookupiselect.patch
Patch0015: arpwatch-201301-ethcodes.patch
Patch0016: arpwatch-pie.patch
Patch0017: arpwatch-aarch64.patch
Patch0018: arpwatch-promisc.patch
%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
%build
%configure
%make_build ARPDIR=%{_vararpwatch}
%install
install -d $RPM_BUILD_ROOT%{_mandir}/man8
install -d $RPM_BUILD_ROOT%{_sbindir}
install -d $RPM_BUILD_ROOT%{_vararpwatch}
install -d $RPM_BUILD_ROOT%{_unitdir}
touch $RPM_BUILD_ROOT%{_vararpwatch}/arp.dat-
%make_install install-man
# prepare awk scripts
perl -pi -e "s/\'/\'\\\'\'/g" *.awk
# and embed them
for i in arp2ethers massagevendor massagevendor-old; do
cp -f $i $RPM_BUILD_ROOT%{_sbindir}
for j in *.awk; do
sed "s/-f\ *\(\<$j\>\)/\'\1\n\' /g" \
< $RPM_BUILD_ROOT%{_sbindir}/$i \
| sed "s/$j\$//;tx;b;:x;r$j" \
> $RPM_BUILD_ROOT%{_sbindir}/$i.x
mv -f $RPM_BUILD_ROOT%{_sbindir}/$i{.x,}
done
chmod 755 $RPM_BUILD_ROOT%{_sbindir}/$i
done
install -p -m644 *.dat $RPM_BUILD_ROOT%{_vararpwatch}
install -p -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/arpwatch.service
install -p -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_vararpwatch}/ethercodes.dat.bz2
bzip2 -df $RPM_BUILD_ROOT%{_vararpwatch}/ethercodes.dat.bz2
%pre
if ! getent group arpwatch &> /dev/null; then
getent group pcap 2> /dev/null | grep -q 77 &&
/usr/sbin/groupmod -n arpwatch pcap 2> /dev/null ||
/usr/sbin/groupadd -g 77 arpwatch 2> /dev/null
fi
if ! getent passwd arpwatch &> /dev/null; then
getent passwd pcap 2> /dev/null | grep -q 77 &&
/usr/sbin/usermod -l arpwatch -g 77 \
-d %{_vararpwatch} pcap 2> /dev/null ||
/usr/sbin/useradd -u 77 -g 77 -s /sbin/nologin \
-M -r -d %{_vararpwatch} arpwatch 2> /dev/null
fi
:
%preun
%systemd_preun arpwatch.service
%post
%systemd_post arpwatch.service
%postun
%systemd_postun_with_restart arpwatch.service
%files
%exclude %{_sbindir}/massagevendor-old
%doc README CHANGES arpfetch
%{_sbindir}/arpwatch
%{_sbindir}/arpsnmp
%{_sbindir}/arp2ethers
%{_sbindir}/massagevendor
%{_unitdir}/arpwatch.service
%attr(1775,-,arpwatch) %dir %{_vararpwatch}
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/arp.dat
%attr(0644,arpwatch,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/arp.dat-
%attr(0600,arpwatch,arpwatch) %verify(not md5 size mtime) %ghost %{_vararpwatch}/arp.dat.new
%attr(0644,-,arpwatch) %verify(not md5 size mtime) %config(noreplace) %{_vararpwatch}/ethercodes.dat
%files help
%{_mandir}/man8/*.8*
%changelog
* Wed Jun 25 2021 lijingyuan <lijingyuan3@huawei.com> - 14:2.1a15-47
- 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
* Fri Sep 06 2019 Alex Chao <zhaolei746@huawei.com> - 14:2.1a15-44
- Package init
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiaobaibaibaide/arpwatch.git
git@gitee.com:xiaobaibaibaide/arpwatch.git
xiaobaibaibaide
arpwatch
arpwatch
master

搜索帮助