diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb3a13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f3d2504 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-arpwatch +# $Id: Makefile,v 1.1 2020/10/10 10:04:34 brianr Exp $ +NAME := smeserver-arpwatch +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index 5e0326c..3303f29 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ -# smeserver-arpwatch +# smeserver-arpwatch -SMEServer Koozali developed git repo for smeserver-arpwatch smecontribs \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-arpwatch smecontribs + +## Wiki +
https://wiki.koozali.org/Arpwatch + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-arpwatch&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..9b7fd51 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +contribs10 diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..49f2772 --- /dev/null +++ b/createlinks @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +#service_link_enhanced("arpwatch", "S99", "7"); +#service_link_enhanced("arpwatch", "K10", "6"); +#service_link_enhanced("arpwatch", "K10", "0"); + +#safe_touch("root/var/lib/arpwatch/arp.dat"); + +templates2events("/etc/sysconfig/arpwatch", "bootstrap-console-save"); + +# our event specific for updating with yum without reboot +$event = "smeserver-arpwatch-update"; +#add here the path to your templates needed to expand +#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event + +foreach my $file (qw( + /etc/systemd/system-preset/49-koozali.preset + /etc/sysconfig/arpwatch + /etc/logrotate.d/arpwatch + /etc/rsyslog.conf +)) +{ + templates2events( $file, $event ); +} + +#action needed in case we have a systemd unit +event_link("systemd-default", $event, "10"); +event_link("systemd-reload", $event, "50"); +#action specific to this package +#event_link("conf-timezone", $event, "30"); +#services we need to restart +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/arpwatch"); diff --git a/root/etc/e-smith/db/configuration/defaults/arpwatch/status b/root/etc/e-smith/db/configuration/defaults/arpwatch/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/arpwatch/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/arpwatch/type b/root/etc/e-smith/db/configuration/defaults/arpwatch/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/arpwatch/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/templates/etc/logrotate.d/arpwatch/10All b/root/etc/e-smith/templates/etc/logrotate.d/arpwatch/10All new file mode 100644 index 0000000..5fb8cd4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/logrotate.d/arpwatch/10All @@ -0,0 +1,8 @@ +/var/log/arpwatch.log \{ + missingok + weekly + rotate 24 + compress + notifempty + copytruncate +\} diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32arpwatch b/root/etc/e-smith/templates/etc/rsyslog.conf/32arpwatch new file mode 100644 index 0000000..078e3f2 --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32arpwatch @@ -0,0 +1,4 @@ + +#arpwatch +:programname, isequal, "arpwatch" /var/log/arpwatch.log +& stop diff --git a/root/etc/e-smith/templates/etc/sysconfig/arpwatch/ALL b/root/etc/e-smith/templates/etc/sysconfig/arpwatch/ALL new file mode 100644 index 0000000..79e718a --- /dev/null +++ b/root/etc/e-smith/templates/etc/sysconfig/arpwatch/ALL @@ -0,0 +1,7 @@ +# -u : defines with what user id arpwatch should run +# -e : the where to send the reports +# -s : the -address +{ +$OUT .= "OPTIONS=\"-i ${'InternalInterface'}{'Name'} -f /var/lib/arpwatch/arp.dat -u arpwatch -e root -s 'Arpwatch@${'DomainName'}'\"\n"; +} + diff --git a/root/usr/lib/systemd/system/arpwatch.service.d/50koozali.conf b/root/usr/lib/systemd/system/arpwatch.service.d/50koozali.conf new file mode 100644 index 0000000..f4b6bbe --- /dev/null +++ b/root/usr/lib/systemd/system/arpwatch.service.d/50koozali.conf @@ -0,0 +1,11 @@ +[Unit] +After= +After=network-online.target +PartOf=network.service +[Service] +Restart=always +RestartSec=5 +[Install] +WantedBy= +WantedBy=sme-server.target + diff --git a/smeserver-arpwatch.spec b/smeserver-arpwatch.spec new file mode 100644 index 0000000..6f24bb2 --- /dev/null +++ b/smeserver-arpwatch.spec @@ -0,0 +1,116 @@ +# $Id: smeserver-arpwatch.spec,v 1.12 2022/12/22 07:54:20 terryfage Exp $ +# Authority: vip-ire +# Name: Daniel Berteaud + +Summary: Arpwatch is a tool that monitors ethernet activity +%define name smeserver-arpwatch +Name: %{name} +%define version 0.3 +%define release 10 +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: Monitoring +Source: %{name}-%{version}.tar.xz + +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch + +BuildRequires: e-smith-devtools + +Requires: e-smith-base +Requires: arpwatch + +%description +Arpwatch is a tool that monitors ethernet activity and keeps +a database of ethernet/ip address pairings. +It also reports certain changes via email. +Arpwatch uses libpcap, a system-independent interface for +user-level packet capture. + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read 0.3-10.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Thu Dec 22 2022 zsolt vasarhelyi 0.3-9.sme +- Arpwatch fails on network restart patch [SME: 12261] + +* Tue Jul 26 2022 zsolt vasarhelyi 0.3-8.sme +- 2nd typo fix added, part of previous patch [SME: 11949] + +* Tue Jul 19 2022 zsolt vasarhelyi 0.3-7.sme +- typo fix added, part of previous patch [SME: 11949] + +* Mon Jul 18 2022 zsolt vasarhelyi 0.3-6.sme +- arpwatch logs to messages, typo fix added [SME: 11949] + +* Sat Feb 27 2021 Brian Read 0.3-5.sme +- Fix service dropin file with proper extension [SME: 11026] + +* Fri Feb 26 2021 Brian Read 0.3-4.sme +- Add-After-in-service-file-to-delay-startup [SME: 11026] + +* Tue Feb 02 2021 Brian Read 0.3-3.sme +- Add in Createlink stuff for systemd [SME: 11026] + +* Wed Nov 04 2020 Brian Read 0.3-2.sme +- Add in systemd startup for arpwatch to spec file [SME: 11026] + +* Mon Oct 12 2020 John Crisp 0.3-1.sme +- based on work by Brian Read [SME: 11026] +- Build for Koozali SME v10 +- remove createlinks safetouch to fix conflict +- remove /var/lib/arpwatch lines in genfilelist + +* Mon Sep 07 2015 stephane de Labrusse 0.2-3.sme +- changed the user pcap to arpwatch [SME: 8429] + +* Mon Jun 16 2014 JP Pialasse 0.2-1.sme +- initial import to SME9 contribs + +* Tue Mar 03 2009 Daniel B. [0.1-2] +- Add e-smith-devtools as a build dependency + +* Tue Jan 27 2009 Daniel B. [0.1-1] +- Service not supervised (as the only option to disable forking is -d + which also disable email alerts) + +* Tue Jan 27 2009 Daniel B. [0.1-0] +- Initial release + +%prep + +%setup -q -n %{name}-%{version} + +%build +perl createlinks + +%install +/bin/rm -rf $RPM_BUILD_ROOT +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + > %{name}-%{version}-filelist + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +%clean +rm -rf $RPM_BUILD_ROOT +%pre + +%post +#systemctl enable arpwatch +#systemctl start arpwatch + +%preun +if [ $1 -eq 0 ] ; then + /sbin/e-smith/db configuration setprop arpwatch status disabled + #/etc/init.d/arpwatch stop +fi + +true