LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File arpwatch.spec of Package arpwatch (Project openSUSE:11.4)

# spec file for package arpwatch (Version 2.1a15)
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

# norootforbuild

Name:           arpwatch
BuildRequires:  libpcap-devel postfix
Url:            http://www-nrg.ee.lbl.gov/nrg.html
License:        BSD3c
Group:          Productivity/Networking/Diagnostic
AutoReqProv:    on
Requires:       arpwatch-ethercodes
PreReq:         /usr/bin/touch %insserv_prereq %fillup_prereq
Summary:        Arpwatch Keeps Track of Ethernet and IP Address Pairings
Version:        2.1a15
Release:        132
Source:         %{name}-%{version}.tar.bz2
Source10:       arpwatch.init
Source11:       sysconfig.arpwatch
Patch0:         arpwatch-2.1a11-chrootbuild.diff
Patch1:         arpwatch-no-source-zero.dif
Patch3:         arpwatch-2.1a11-tokenring.diff
Patch4:         arpwatch-2.1a11-hname-overflow.dif
Patch5:         arpwatch-2.1a11-drop-privs-manpage.dif
Patch6:         arpwatch-2.1a11-drop-privs.dif
Patch7:         arpwatch-2.1a11-emailaddr.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Arpwatch keeps track of Ethernet and IP address pairings. It logs
activity to syslog and reports certain changes via e-mail.

    Craig Leres <arpwatch@ee.lbl.gov>

%package ethercodes-build
License:        BSD3c
Group:          Productivity/Networking/Diagnostic
Summary:        Tool to create ethercodes.dat from IEEE.org meta data

%description ethercodes-build
Tool and required files to create the ethercodes.dat file from the OUI
and company ID data as provided by IEEE.org.  This package is only
needed if you want to build the arpwatch-ethercodes package.

    Craig Leres <arpwatch@ee.lbl.gov>

%setup -q
%patch -P 0 -E
%patch1 -p1 -E
%patch3 -p1 -E
%patch4 -p1 -E
%patch5 -p1 -E
%patch6 -p1 -E
%patch7 -p1 -E

%{__make} ARPDIR=/var/lib/arpwatch %{?_smp_mflags}

mkdir -p \
	$RPM_BUILD_ROOT/etc/init.d \
	$RPM_BUILD_ROOT/%{_sbindir} \
	$RPM_BUILD_ROOT/%{_datadir}/arpwatch \
	$RPM_BUILD_ROOT/%{_mandir}/man8 \
# ethercodes.dat is in the arpwatch-ethercodes package
rm -f $RPM_BUILD_ROOT/%{_datadir}/arpwatch/ethercodes.dat
for file in massagevendor euppertolower.awk duplicates.awk p.awk; do
	cp -p ${file} $RPM_BUILD_ROOT/%{_datadir}/arpwatch
make DESTDIR=$RPM_BUILD_ROOT install-man
install -m 0754 $RPM_SOURCE_DIR/arpwatch.init $RPM_BUILD_ROOT/etc/init.d/arpwatch
ln -sf ../../etc/init.d/arpwatch $RPM_BUILD_ROOT/%{_sbindir}/rcarpwatch
cp -p ${RPM_SOURCE_DIR}/sysconfig.arpwatch $RPM_BUILD_ROOT/var/adm/fillup-templates
# own the database files
touch $RPM_BUILD_ROOT/var/lib/arpwatch/arp.dat
touch $RPM_BUILD_ROOT/var/lib/arpwatch/arp.dat-

%stop_on_removal arpwatch

if [ ! -f var/lib/arpwatch/arp.dat ]; then
	touch var/lib/arpwatch/arp.dat

%restart_on_update arpwatch

%config /etc/init.d/arpwatch
%dir /var/lib/arpwatch
%ghost %config(noreplace) /var/lib/arpwatch/arp.dat
%ghost %config(noreplace) /var/lib/arpwatch/arp.dat-
%doc %{_mandir}/man8/arpsnmp.8.gz
%doc %{_mandir}/man8/arpwatch.8.gz

%files ethercodes-build