arpwatch/arpwatch.spec

changeset 571
175768f4868b
parent 387
33ae2d61c751
child 690
67c9fa937f34
equal deleted inserted replaced
2:d7fc3a9d431d 3:3894a3879ade
1 ## 1 ##
2 ## arpwatch.spec -- OpenPKG RPM Specification 2 ## arpwatch.spec -- OpenPKG RPM Specification
3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> 3 ## Copyright (c) 2012 Michael Schloh von Bennewitz <michael@schloh.com>
4 ## 4 ##
5 ## Permission to use, copy, modify, and distribute this software for 5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that 6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all 7 ## the above copyright notice and this permission notice appear in all
8 ## copies. 8 ## copies.
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24
25 # package information 24 # package information
26 Name: arpwatch 25 Name: arpwatch
27 Summary: Ethernet Address Monitor Program 26 Summary: Ethernet Address Monitor Program
28 URL: http://ee.lbl.gov/ 27 URL: http://ee.lbl.gov/
29 Vendor: Craig Leres 28 Vendor: Craig Leres
31 Distribution: Europalab Networks Production 30 Distribution: Europalab Networks Production
32 Class: EVAL 31 Class: EVAL
33 Group: Network 32 Group: Network
34 License: GPL 33 License: GPL
35 Version: 2.1a15 34 Version: 2.1a15
36 Release: 20090106 35 Release: 20120800
37 36
38 # package options 37 # package options
39 %option with_fsl yes 38 %option with_fsl yes
40 39
41 # list of sources 40 # list of sources
42 Source0: ftp://ftp.ee.lbl.gov/arpwatch.tar.gz 41 Source0: ftp://ftp.ee.lbl.gov/arpwatch-%{version}.tar.gz
43 Source1: rc.arpwatch 42 Source1: rc.arpwatch
44 Source2: fsl.arpwatch 43 Source2: fsl.arpwatch
45 Patch0: arpwatch.patch 44 Patch0: arpwatch.patch
46 45
47 # build information 46 # build information
48 Prefix: %{l_prefix} 47 BuildPreReq: OpenPKG, openpkg >= 20100101, libpcap, make
49 BuildRoot: %{l_buildroot} 48 PreReq: OpenPKG, openpkg >= 20100101, libpcap
50 BuildPreReq: OpenPKG, openpkg >= 20040130, libpcap, make 49 PreReq: MTA
51 PreReq: OpenPKG, openpkg >= 20040130, libpcap
52 %if "%{with_fsl}" == "yes" 50 %if "%{with_fsl}" == "yes"
53 BuildPreReq: fsl >= 1.2.0 51 BuildPreReq: fsl >= 1.2.0
54 PreReq: fsl >= 1.2.0 52 PreReq: fsl >= 1.2.0
55 %endif 53 %endif
56 AutoReq: no
57 AutoReqProv: no
58 54
59 %description 55 %description
60 The arpwatch daemon monitors ethernet or fddi activity 56 The arpwatch daemon monitors ethernet or fddi activity
61 and maintains a database of ethernet/ip address pairings. 57 and maintains a database of ethernet/ip address pairings.
62 It reports certain changes via email as well. 58 It reports certain changes via email as well.
63 59
64 %track 60 %track
65 prog arpwatch = { 61 prog arpwatch = {
66 disabled
67 comment = "msvb: tracking is disabled as sources are unversioned"
68 version = %{version} 62 version = %{version}
69 url = ftp://ftp.ee.lbl.gov/ 63 url = ftp://ftp.ee.lbl.gov/
70 regex = arpwatch-\.tar\.gz 64 regex = arpwatch-(__VER__)\.tar\.gz
71 } 65 }
72 66
73 %prep 67 %prep
74 %setup -q 68 %setup -q
75
76 # before patching, correct unconsistent file modes
77 chmod u+w *
78
79 %patch -p0 69 %patch -p0
80 70
81 # supply more detailed file path information 71 # supply more detailed file path information
82 %{l_shtool} subst %{l_value -s l_prefix} \ 72 %{l_shtool} subst %{l_value -s l_prefix} \
83 arpwatch.8 \ 73 arpwatch.8 \
94 CC="%{l_cc}" \ 84 CC="%{l_cc}" \
95 CFLAGS="%{l_cflags -O}" \ 85 CFLAGS="%{l_cflags -O}" \
96 CPPFLAGS="%{l_cppflags}" \ 86 CPPFLAGS="%{l_cppflags}" \
97 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ 87 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
98 LIBS="%{l_fsl_libs} $loclibs" \ 88 LIBS="%{l_fsl_libs} $loclibs" \
89 V_SENDMAIL=%{l_prefix}/sbin/sendmail \
99 ./configure \ 90 ./configure \
100 --prefix=%{l_prefix} \ 91 --prefix=%{l_prefix} \
101 --localstatedir=%{l_prefix}/var/arpwatch/run 92 --localstatedir=%{l_prefix}/var/arpwatch/run
102 93
103 # run the native build logic using parallel make 94 # run the native build logic using parallel make
104 %{l_make} %{l_mflags -O} 95 %{l_make} %{l_mflags -O}
105 96
106 %install 97 %install
107 # remove previously existing installations
108 rm -rf $RPM_BUILD_ROOT
109
110 # create installation hierarchy 98 # create installation hierarchy
111 %{l_shtool} mkdir -f -p -m 755 \ 99 %{l_shtool} mkdir -f -p -m 755 \
112 $RPM_BUILD_ROOT%{l_prefix}/sbin \ 100 $RPM_BUILD_ROOT%{l_prefix}/sbin \
113 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 101 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
114 $RPM_BUILD_ROOT%{l_prefix}/man/man8 \ 102 $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
135 '%config %{l_prefix}/etc/fsl/fsl.arpwatch' 123 '%config %{l_prefix}/etc/fsl/fsl.arpwatch'
136 124
137 %files -f files 125 %files -f files
138 126
139 %clean 127 %clean
140 rm -rf $RPM_BUILD_ROOT
141 128
142 %pre 129 %pre
143 # before upgrading package, record runtime status and stop service 130 # before upgrading package, record runtime status and stop service
144 [ $1 -eq 2 ] || exit 0 131 [ $1 -eq 2 ] || exit 0
145 eval `%{l_rc} arpwatch status 2>/dev/null | tee %{l_tmpfile}` 132 eval `%{l_rc} arpwatch status 2>/dev/null | tee %{l_tmpfile}`
148 135
149 %post 136 %post
150 if [ $1 -eq 1 ]; then 137 if [ $1 -eq 1 ]; then
151 # after installing package, generate initial arp database 138 # after installing package, generate initial arp database
152 %{l_shtool} install -c -o %{l_musr} -g %{l_mgrp} -m 644 \ 139 %{l_shtool} install -c -o %{l_musr} -g %{l_mgrp} -m 644 \
153 %{_builddir}/arpwatch-%{version}/arp.dat \ 140 %{_builddir}/arpwatch-%{version}/ethercodes.dat \
154 $RPM_INSTALL_PREFIX/var/arpwatch/run/ 141 $RPM_INSTALL_PREFIX/var/arpwatch/run/
155 142
156 # after installing package, announce security provision lo0 143 # after installing package, announce security provision lo0
157 ( echo "Before starting the arpwatch daemon, set the config variables" 144 ( echo "Before starting the arpwatch daemon, set the config variables"
158 echo "\"arpwatch_iface\" and \"arpwatch_ipnet\" in $RPM_INSTALL_PREFIX/etc/rc.conf to" 145 echo "\"arpwatch_iface\" and \"arpwatch_ipnet\" in $RPM_INSTALL_PREFIX/etc/rc.conf to"

mercurial