lsof/lsof.spec

Fri, 16 Jan 2009 10:58:21 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2009 10:58:21 +0100
changeset 92
645923d1e875
parent 36
88242dc55a66
child 125
06debe70afb4
permissions
-rw-r--r--

Correct and improve code logic, buildconf, and packaging. In particular:
1. Use descriptive variable names <var>libs instead of just <var>.
2. Although Nokia states in all Qt builds that 'NOTE: When linking
against OpenSSL, you can override the default library names
through OPENSSL_LIBS.' and even gives an example, their own
configuration logic rejects such an attempt. Correct this by
hard coding the OpenSSL library string in the configure script.
3. Consistently use the whitespace substitution [\t ] throughout.
4. Patch the buggy INCPATH of SQL plugin Qmake project files.
5. Add the 'x11' configuration variable to the qtconfig Qmake
project using the src/gui/gui.pro file as a model. This is
needed for qtconfig although not in other tools, because
the qtconfig buildconf indirectly includes qt_x11_p.h which
is dependent on X11 headers.
6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow'
on platforms for which the config.tests/unix/[3dnow|sse2] succeed
although unsopported at run time by testing for the x86-64
instruction set at build time and regulating hardware capabilities.
7. Correctly install the desinger plugin by explicitly building it.
8. Remove custom plugin installation logic which is unnecessary.
9. Correct removal of temporary paths from shared object files.

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@34 34 Version: 4.81
michael@36 35 Release: 20090106
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