arpd/arpd.spec

Thu, 04 Oct 2012 20:26:02 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Oct 2012 20:26:02 +0200
changeset 714
119553d296d2
child 715
c10fb90893b9
permissions
-rw-r--r--

Import package vendor original spec for necessary manipulations.

michael@714 1 ##
michael@714 2 ## arpd.spec -- OpenPKG RPM Package Specification
michael@714 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@714 4 ##
michael@714 5 ## Permission to use, copy, modify, and distribute this software for
michael@714 6 ## any purpose with or without fee is hereby granted, provided that
michael@714 7 ## the above copyright notice and this permission notice appear in all
michael@714 8 ## copies.
michael@714 9 ##
michael@714 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@714 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@714 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@714 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@714 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@714 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@714 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@714 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@714 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@714 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@714 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@714 21 ## SUCH DAMAGE.
michael@714 22 ##
michael@714 23
michael@714 24 # package information
michael@714 25 Name: arpd
michael@714 26 Summary: Address Resolution Protocol (ARP) Reply Daemon
michael@714 27 URL: http://www.honeyd.org/tools.php
michael@714 28 Vendor: Niels Provos, Dug Song
michael@714 29 Packager: OpenPKG Foundation e.V.
michael@714 30 Distribution: OpenPKG Community
michael@714 31 Class: EVAL
michael@714 32 Group: Mapping
michael@714 33 License: GNU
michael@714 34 Version: 0.2
michael@714 35 Release: 20080101
michael@714 36
michael@714 37 # package options
michael@714 38 %option with_fsl yes
michael@714 39
michael@714 40 # list of sources
michael@714 41 Source0: http://www.citi.umich.edu/u/provos/honeyd/arpd-%{version}.tar.gz
michael@714 42 Source1: rc.arpd
michael@714 43 Source2: fsl.arpd
michael@714 44 Patch0: arpd.patch
michael@714 45
michael@714 46 # build information
michael@714 47 Prefix: %{l_prefix}
michael@714 48 BuildRoot: %{l_buildroot}
michael@714 49 BuildPreReq: OpenPKG, openpkg >= 20060823, libdnet, libpcap, libevent, gcc, make
michael@714 50 PreReq: OpenPKG, openpkg >= 20060823, libdnet, libpcap, libevent
michael@714 51 %if "%{with_fsl}" == "yes"
michael@714 52 BuildPreReq: fsl
michael@714 53 PreReq: fsl
michael@714 54 %endif
michael@714 55 AutoReq: no
michael@714 56 AutoReqProv: no
michael@714 57
michael@714 58 %description
michael@714 59 Arpd is an Address Resolution Protocol (ARP) daemon which replies to
michael@714 60 any ARP request for an IP address matching the specified destination
michael@714 61 network with the hardware MAC address of the own interface, but only
michael@714 62 after determining if another host already claims it. Any IP address
michael@714 63 claimed by arpd is eventually forgotten after a period of inactivity
michael@714 64 or after a hard timeout, and is relinquished if the real owner shows
michael@714 65 up. This enables a single host to claim all unassigned addresses on
michael@714 66 a LAN for network monitoring or simulation.
michael@714 67
michael@714 68 %track
michael@714 69 prog arpd = {
michael@714 70 version = %{version}
michael@714 71 url = http://www.honeyd.org/tools.php
michael@714 72 regex = arpd-(__VER__)\.tar\.gz
michael@714 73 }
michael@714 74
michael@714 75 %prep
michael@714 76 %setup -q -n arpd
michael@714 77 %patch -p0
michael@714 78 %{l_shtool} subst \
michael@714 79 -e 's;LIBS=$DNETLIB;LIBS="$LIBS $DNETLIB";' \
michael@714 80 -e 's;CFLAGS=$DNETINC;CFLAGS="$CFLAGS $DNETINC";' \
michael@714 81 -e 's;net/bpf\.h;pcap-bpf.h;g' \
michael@714 82 configure
michael@714 83 %{l_shtool} subst \
michael@714 84 -e 's;/var/run/arpd.pid;%{l_prefix}/var/arpd/arpd.pid;' \
michael@714 85 arpd.c arpd.8
michael@714 86
michael@714 87 %build
michael@714 88 CC="%{l_cc}" \
michael@714 89 CFLAGS="%{l_cflags -O}" \
michael@714 90 CPPFLAGS="%{l_cppflags}" \
michael@714 91 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
michael@714 92 LIBS="%{l_fsl_libs} -lpcap" \
michael@714 93 ./configure \
michael@714 94 --prefix=%{l_prefix} \
michael@714 95 --with-libdnet=%{l_prefix} \
michael@714 96 --with-libpcap=%{l_prefix} \
michael@714 97 --with-libevent=%{l_prefix}
michael@714 98 %{l_make} %{l_mflags}
michael@714 99
michael@714 100 %install
michael@714 101 rm -rf $RPM_BUILD_ROOT
michael@714 102
michael@714 103 # create directories
michael@714 104 %{l_shtool} mkdir -f -p -m 755 \
michael@714 105 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@714 106 $RPM_BUILD_ROOT%{l_prefix}/var/arpd
michael@714 107
michael@714 108 # install files
michael@714 109 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@714 110 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@714 111 %{SOURCE rc.arpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@714 112
michael@714 113 # install OSSP fsl configuration
michael@714 114 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
michael@714 115 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@714 116 %{SOURCE fsl.arpd} \
michael@714 117 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
michael@714 118
michael@714 119 # determine file list
michael@714 120 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@714 121 %{l_files_std} \
michael@714 122 '%config %{l_prefix}/etc/fsl/fsl.arpd' \
michael@714 123 '%attr(750,%{l_susr},%{l_mgrp}) %{l_prefix}/var/arpd'
michael@714 124
michael@714 125 %files -f files
michael@714 126
michael@714 127 %clean
michael@714 128 rm -rf $RPM_BUILD_ROOT
michael@714 129
michael@714 130 %pre
michael@714 131 # before upgrade, save status and stop service
michael@714 132 [ $1 -eq 2 ] || exit 0
michael@714 133 eval `%{l_rc} arpd status 2>/dev/null | tee %{l_tmpfile}`
michael@714 134 %{l_rc} arpd stop 2>/dev/null
michael@714 135 exit 0
michael@714 136
michael@714 137 %post
michael@714 138 if [ $1 -eq 1 ]; then
michael@714 139 # display final hints on initial installation
michael@714 140 ( echo "Before starting ARP daemon, please set the configuration variable"
michael@714 141 echo "\"arpd_if\" in $RPM_INSTALL_PREFIX/etc/rc.conf to the name of the"
michael@714 142 echo "used network interface."
michael@714 143 ) | %{l_rpmtool} msg -b -t notice
michael@714 144 fi
michael@714 145 if [ $1 -eq 2 ]; then
michael@714 146 # after upgrade, restore status
michael@714 147 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
michael@714 148 [ ".$arpd_active" = .yes ] && %{l_rc} arpd start
michael@714 149 fi
michael@714 150 exit 0
michael@714 151
michael@714 152 %preun
michael@714 153 # before erase, stop service and remove log files
michael@714 154 [ $1 -eq 0 ] || exit 0
michael@714 155 %{l_rc} arpd stop 2>/dev/null
michael@714 156 rm -f $RPM_INSTALL_PREFIX/var/arpd/*.log* >/dev/null 2>&1 || true
michael@714 157 exit 0
michael@714 158

mercurial