lsof/lsof.spec

Sun, 03 Apr 2011 13:34:55 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 03 Apr 2011 13:34:55 +0200
changeset 337
f71e028eb3e2
parent 85
e6a1cd7ed6ba
child 464
3e2a08d916c6
permissions
-rw-r--r--

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@34 1 ##
michael@34 2 ## lsof.spec -- OpenPKG RPM Package Specification
michael@34 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@34 4 ##
michael@34 5 ## Permission to use, copy, modify, and distribute this software for
michael@34 6 ## any purpose with or without fee is hereby granted, provided that
michael@34 7 ## the above copyright notice and this permission notice appear in all
michael@34 8 ## copies.
michael@34 9 ##
michael@34 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@34 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@34 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@34 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@34 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@34 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@34 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@34 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@34 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@34 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@34 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@34 21 ## SUCH DAMAGE.
michael@34 22 ##
michael@34 23
michael@34 24 # package information
michael@34 25 Name: lsof
michael@34 26 Summary: List Open Files
michael@34 27 URL: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
michael@34 28 Vendor: Victor A. Abell
michael@34 29 Packager: OpenPKG Foundation e.V.
michael@34 30 Distribution: OpenPKG Community
michael@34 31 Class: BASE
michael@34 32 Group: Debugging
michael@34 33 License: BSD
michael@125 34 Version: 4.82
michael@125 35 Release: 20090401
michael@34 36
michael@34 37 # list of sources
michael@34 38 Source0: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_%{version}.tar.gz
michael@34 39 Patch0: lsof.patch
michael@34 40
michael@34 41 # build information
michael@34 42 Prefix: %{l_prefix}
michael@34 43 BuildRoot: %{l_buildroot}
michael@85 44 BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
michael@34 45 PreReq: OpenPKG, openpkg >= 20040130
michael@34 46 AutoReq: no
michael@34 47 AutoReqProv: no
michael@34 48
michael@34 49 %description
michael@34 50 List Open Files (lsof) shows all currently open file descriptors of
michael@34 51 processes.
michael@34 52
michael@34 53 %track
michael@34 54 prog lsof = {
michael@34 55 version = %{version}
michael@34 56 url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
michael@34 57 regex = lsof_(__VER__)\.tar\.gz
michael@34 58 }
michael@34 59
michael@34 60 %prep
michael@34 61 %setup -q -n lsof_%{version}
michael@34 62 %{l_tar} xf lsof_%{version}_src.tar
michael@34 63 cd lsof_%{version}_src
michael@34 64 %patch -p0
michael@34 65
michael@34 66 %build
michael@34 67 cd lsof_%{version}_src
michael@34 68 export PATH="/bin:/usr/bin:$PATH"
michael@34 69 export LSOF_CC="%{l_cc}"
michael@36 70 export LSOF_MAKE="%{l_make} %{l_mflags -O}"
michael@34 71 case "%{l_platform -t}" in
michael@34 72 *-freebsd* ) platform="freebsd"; LSOF_CC="/usr/bin/cc"; LSOF_MAKE="/usr/bin/make" ;;
michael@34 73 *-linux* ) platform="linux" ;;
michael@34 74 *-sunos* ) platform="solaris" ;;
michael@34 75 *-netbsd* ) platform="netbsd" ;;
michael@34 76 *-hpux* ) platform="hpuxgcc" ;;
michael@34 77 *-aix* ) platform="aixgcc" ;;
michael@34 78 * ) echo "Platform %{l_platform -t} not supported" 1>&2; exit 1 ;;
michael@34 79 esac
michael@34 80 ./Configure -n $platform
michael@34 81 eval $LSOF_MAKE
michael@34 82
michael@34 83 %install
michael@34 84 rm -rf $RPM_BUILD_ROOT
michael@34 85 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
michael@34 86 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8
michael@34 87 ( cd lsof_%{version}_src
michael@34 88 %{l_shtool} install -c lsof $RPM_BUILD_ROOT%{l_prefix}/bin/
michael@34 89 %{l_shtool} install -c lsof.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
michael@34 90 ) || exit $?
michael@34 91 strip $RPM_BUILD_ROOT%{l_prefix}/bin/lsof >/dev/null 2>&1 || true
michael@34 92 setgid=""
michael@34 93 case "%{l_platform -t}" in
michael@34 94 *-freebsd* ) setgid="kmem" ;;
michael@34 95 *-linux* ) setgid="kmem" ;;
michael@34 96 *-sunos* ) setgid="sys" ;;
michael@34 97 *-netbsd* ) setgid="kmem" ;;
michael@34 98 *-hpux* ) setgid="sys" ;;
michael@34 99 *-aix* ) setgid="sys" ;;
michael@34 100 esac
michael@34 101 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@34 102 %{l_files_std} \
michael@34 103 "%attr(2755,%{l_musr},$setgid) %{l_prefix}/bin/lsof"
michael@34 104
michael@34 105 %files -f files
michael@34 106
michael@34 107 %clean
michael@34 108 rm -rf $RPM_BUILD_ROOT
michael@34 109

mercurial