Sun, 03 Apr 2011 13:34:55 +0200
Correct and improve several packaging aspects including...
Correct datadir path for python modules, correct jar(1) path for
building libgcj classes, strip libexecdir path of version numbers,
improve name of oblbld build path, clean whitespace from as(1) and
ld(1) GNU detection, remove seemingly discarded '--with-local-prefix'
configure argument, and correct hardcoded lto plugin libtool archive
dependency information.
Most importantly, correct IA32 architecture detection logic in
config.gcc to correctly emit SSE2 instructions conditionally, leading
to the removal of all '-march' bootstrap options and replacement with
unconditional (for IA32/AMD64) '-mtune=native' options. Comments and
buildtime warnings are corrected appropriately. In theory these changes
cause a more portable, orthoganal, and optimal bootstrap to be built.
michael@64 | 1 | ## |
michael@64 | 2 | ## arpwatch.spec -- OpenPKG RPM Specification |
michael@64 | 3 | ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com> |
michael@64 | 4 | ## |
michael@64 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@64 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@64 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@64 | 8 | ## copies. |
michael@64 | 9 | ## |
michael@64 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@64 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@64 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@64 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@64 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@64 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@64 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@64 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@64 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@64 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@64 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@64 | 21 | ## SUCH DAMAGE. |
michael@64 | 22 | ## |
michael@64 | 23 | |
michael@64 | 24 | |
michael@64 | 25 | # package information |
michael@64 | 26 | Name: arpwatch |
michael@64 | 27 | Summary: Ethernet Address Monitor Program |
michael@64 | 28 | URL: http://ee.lbl.gov/ |
michael@64 | 29 | Vendor: Craig Leres |
michael@64 | 30 | Packager: Michael Schloh von Bennewitz |
michael@64 | 31 | Distribution: MSvB Recherche Production |
michael@64 | 32 | Class: EVAL |
michael@64 | 33 | Group: Network |
michael@64 | 34 | License: GPL |
michael@64 | 35 | Version: 2.1a15 |
michael@64 | 36 | Release: 20090106 |
michael@64 | 37 | |
michael@64 | 38 | # package options |
michael@64 | 39 | %option with_fsl yes |
michael@64 | 40 | |
michael@64 | 41 | # list of sources |
michael@64 | 42 | Source0: ftp://ftp.ee.lbl.gov/arpwatch.tar.gz |
michael@64 | 43 | Source1: rc.arpwatch |
michael@64 | 44 | Source2: fsl.arpwatch |
michael@64 | 45 | Patch0: arpwatch.patch |
michael@64 | 46 | |
michael@64 | 47 | # build information |
michael@64 | 48 | Prefix: %{l_prefix} |
michael@64 | 49 | BuildRoot: %{l_buildroot} |
michael@85 | 50 | BuildPreReq: OpenPKG, openpkg >= 20040130, libpcap, make |
michael@64 | 51 | PreReq: OpenPKG, openpkg >= 20040130, libpcap |
michael@64 | 52 | %if "%{with_fsl}" == "yes" |
michael@64 | 53 | BuildPreReq: fsl >= 1.2.0 |
michael@64 | 54 | PreReq: fsl >= 1.2.0 |
michael@64 | 55 | %endif |
michael@64 | 56 | AutoReq: no |
michael@64 | 57 | AutoReqProv: no |
michael@64 | 58 | |
michael@64 | 59 | %description |
michael@64 | 60 | The arpwatch daemon monitors ethernet or fddi activity |
michael@64 | 61 | and maintains a database of ethernet/ip address pairings. |
michael@64 | 62 | It reports certain changes via email as well. |
michael@64 | 63 | |
michael@64 | 64 | %track |
michael@64 | 65 | prog arpwatch = { |
michael@64 | 66 | disabled |
michael@64 | 67 | comment = "msvb: tracking is disabled as sources are unversioned" |
michael@64 | 68 | version = %{version} |
michael@64 | 69 | url = ftp://ftp.ee.lbl.gov/ |
michael@64 | 70 | regex = arpwatch-\.tar\.gz |
michael@64 | 71 | } |
michael@64 | 72 | |
michael@64 | 73 | %prep |
michael@64 | 74 | %setup -q |
michael@64 | 75 | |
michael@64 | 76 | # before patching, correct unconsistent file modes |
michael@64 | 77 | chmod u+w * |
michael@64 | 78 | |
michael@64 | 79 | %patch -p0 |
michael@64 | 80 | |
michael@64 | 81 | # supply more detailed file path information |
michael@64 | 82 | %{l_shtool} subst %{l_value -s l_prefix} \ |
michael@64 | 83 | arpwatch.8 \ |
michael@64 | 84 | arpsnmp.8 |
michael@64 | 85 | |
michael@64 | 86 | %build |
michael@64 | 87 | # query for platform specific libraries |
michael@64 | 88 | loclibs="" |
michael@64 | 89 | case "%{l_platform -t}" in |
michael@64 | 90 | *-sunos* ) loclibs="-lsocket -lnsl" ;; |
michael@64 | 91 | esac |
michael@64 | 92 | |
michael@64 | 93 | # run the autoconf(1) generated configuration logic |
michael@64 | 94 | CC="%{l_cc}" \ |
michael@64 | 95 | CFLAGS="%{l_cflags -O}" \ |
michael@64 | 96 | CPPFLAGS="%{l_cppflags}" \ |
michael@64 | 97 | LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ |
michael@64 | 98 | LIBS="%{l_fsl_libs} $loclibs" \ |
michael@64 | 99 | ./configure \ |
michael@64 | 100 | --prefix=%{l_prefix} \ |
michael@64 | 101 | --localstatedir=%{l_prefix}/var/arpwatch/run |
michael@64 | 102 | |
michael@64 | 103 | # run the native build logic using parallel make |
michael@64 | 104 | %{l_make} %{l_mflags -O} |
michael@64 | 105 | |
michael@64 | 106 | %install |
michael@64 | 107 | # remove previously existing installations |
michael@64 | 108 | rm -rf $RPM_BUILD_ROOT |
michael@64 | 109 | |
michael@64 | 110 | # create installation hierarchy |
michael@64 | 111 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@64 | 112 | $RPM_BUILD_ROOT%{l_prefix}/sbin \ |
michael@64 | 113 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
michael@64 | 114 | $RPM_BUILD_ROOT%{l_prefix}/man/man8 \ |
michael@64 | 115 | $RPM_BUILD_ROOT%{l_prefix}/var/arpwatch/log \ |
michael@64 | 116 | $RPM_BUILD_ROOT%{l_prefix}/var/arpwatch/run |
michael@64 | 117 | |
michael@64 | 118 | # run the native installation logic |
michael@64 | 119 | %{l_make} %{l_mflags} install install-man install-data DESTDIR=$RPM_BUILD_ROOT |
michael@64 | 120 | |
michael@64 | 121 | # install runcommand script |
michael@64 | 122 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@64 | 123 | %{SOURCE rc.arpwatch} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@64 | 124 | |
michael@64 | 125 | # install OSSP fsl configuration |
michael@64 | 126 | %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl |
michael@64 | 127 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@64 | 128 | %{SOURCE fsl.arpwatch} \ |
michael@64 | 129 | $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
michael@64 | 130 | |
michael@64 | 131 | # determine installation files |
michael@64 | 132 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@64 | 133 | %{l_files_std} \ |
michael@64 | 134 | '%not %dir %{l_prefix}/etc/fsl' \ |
michael@64 | 135 | '%config %{l_prefix}/etc/fsl/fsl.arpwatch' |
michael@64 | 136 | |
michael@64 | 137 | %files -f files |
michael@64 | 138 | |
michael@64 | 139 | %clean |
michael@64 | 140 | rm -rf $RPM_BUILD_ROOT |
michael@64 | 141 | |
michael@64 | 142 | %pre |
michael@64 | 143 | # before upgrading package, record runtime status and stop service |
michael@64 | 144 | [ $1 -eq 2 ] || exit 0 |
michael@64 | 145 | eval `%{l_rc} arpwatch status 2>/dev/null | tee %{l_tmpfile}` |
michael@64 | 146 | %{l_rc} arpwatch stop 2>/dev/null |
michael@64 | 147 | exit 0 |
michael@64 | 148 | |
michael@64 | 149 | %post |
michael@64 | 150 | if [ $1 -eq 1 ]; then |
michael@64 | 151 | # after installing package, generate initial arp database |
michael@64 | 152 | %{l_shtool} install -c -o %{l_musr} -g %{l_mgrp} -m 644 \ |
michael@64 | 153 | %{_builddir}/arpwatch-%{version}/arp.dat \ |
michael@64 | 154 | $RPM_INSTALL_PREFIX/var/arpwatch/run/ |
michael@64 | 155 | |
michael@64 | 156 | # after installing package, announce security provision lo0 |
michael@64 | 157 | ( echo "Before starting the arpwatch daemon, set the config variables" |
michael@64 | 158 | echo "\"arpwatch_iface\" and \"arpwatch_ipnet\" in $RPM_INSTALL_PREFIX/etc/rc.conf to" |
michael@64 | 159 | echo "describe the network interface and block(s) to be monitored." |
michael@64 | 160 | ) | %{l_rpmtool} msg -b -t notice |
michael@64 | 161 | fi |
michael@64 | 162 | if [ $1 -eq 2 ]; then |
michael@64 | 163 | # after upgrading package, restore runtime status |
michael@64 | 164 | eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} >/dev/null 2>&1 || true |
michael@64 | 165 | [ ".$arpwatch_active" = .yes ] && %{l_rc} arpwatch start |
michael@64 | 166 | fi |
michael@64 | 167 | exit 0 |
michael@64 | 168 | |
michael@64 | 169 | %preun |
michael@64 | 170 | # before removing package, stop service and remove log files |
michael@64 | 171 | [ $1 -eq 0 ] || exit 0 |
michael@64 | 172 | %{l_rc} arpwatch stop 2>/dev/null |
michael@64 | 173 | rm -f $RPM_INSTALL_PREFIX/var/arpwatch/log/* >/dev/null 2>&1 || true |
michael@64 | 174 | rm -f $RPM_INSTALL_PREFIX/var/arpwatch/run/* >/dev/null 2>&1 || true |
michael@64 | 175 | exit 0 |
michael@64 | 176 |