Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
michael@34 | 1 | ## |
michael@34 | 2 | ## lsof.spec -- OpenPKG RPM Package Specification |
michael@464 | 3 | ## Copyright (c) 2000-2012 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@464 | 34 | Version: 4.86 |
michael@465 | 35 | Release: 20120800 |
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@523 | 42 | BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make |
michael@464 | 43 | PreReq: OpenPKG, openpkg >= 20100101 |
michael@34 | 44 | |
michael@34 | 45 | %description |
michael@34 | 46 | List Open Files (lsof) shows all currently open file descriptors of |
michael@34 | 47 | processes. |
michael@34 | 48 | |
michael@34 | 49 | %track |
michael@34 | 50 | prog lsof = { |
michael@34 | 51 | version = %{version} |
michael@34 | 52 | url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ |
michael@34 | 53 | regex = lsof_(__VER__)\.tar\.gz |
michael@34 | 54 | } |
michael@34 | 55 | |
michael@34 | 56 | %prep |
michael@34 | 57 | %setup -q -n lsof_%{version} |
michael@34 | 58 | %{l_tar} xf lsof_%{version}_src.tar |
michael@34 | 59 | cd lsof_%{version}_src |
michael@34 | 60 | %patch -p0 |
michael@34 | 61 | |
michael@34 | 62 | %build |
michael@34 | 63 | cd lsof_%{version}_src |
michael@34 | 64 | export PATH="/bin:/usr/bin:$PATH" |
michael@34 | 65 | export LSOF_CC="%{l_cc}" |
michael@465 | 66 | export LSOF_MAKE="%{l_make} %{l_mflags -O}" |
michael@34 | 67 | case "%{l_platform -t}" in |
michael@34 | 68 | *-freebsd* ) platform="freebsd"; LSOF_CC="/usr/bin/cc"; LSOF_MAKE="/usr/bin/make" ;; |
michael@34 | 69 | *-linux* ) platform="linux" ;; |
michael@34 | 70 | *-sunos* ) platform="solaris" ;; |
michael@34 | 71 | *-netbsd* ) platform="netbsd" ;; |
michael@34 | 72 | *-hpux* ) platform="hpuxgcc" ;; |
michael@34 | 73 | *-aix* ) platform="aixgcc" ;; |
michael@34 | 74 | * ) echo "Platform %{l_platform -t} not supported" 1>&2; exit 1 ;; |
michael@34 | 75 | esac |
michael@34 | 76 | ./Configure -n $platform |
michael@34 | 77 | eval $LSOF_MAKE |
michael@34 | 78 | |
michael@34 | 79 | %install |
michael@34 | 80 | %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin |
michael@34 | 81 | %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8 |
michael@34 | 82 | ( cd lsof_%{version}_src |
michael@34 | 83 | %{l_shtool} install -c lsof $RPM_BUILD_ROOT%{l_prefix}/bin/ |
michael@34 | 84 | %{l_shtool} install -c lsof.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ |
michael@34 | 85 | ) || exit $? |
michael@34 | 86 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/lsof >/dev/null 2>&1 || true |
michael@34 | 87 | setgid="" |
michael@34 | 88 | case "%{l_platform -t}" in |
michael@34 | 89 | *-freebsd* ) setgid="kmem" ;; |
michael@34 | 90 | *-linux* ) setgid="kmem" ;; |
michael@34 | 91 | *-sunos* ) setgid="sys" ;; |
michael@34 | 92 | *-netbsd* ) setgid="kmem" ;; |
michael@34 | 93 | *-hpux* ) setgid="sys" ;; |
michael@34 | 94 | *-aix* ) setgid="sys" ;; |
michael@34 | 95 | esac |
michael@34 | 96 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@34 | 97 | %{l_files_std} \ |
michael@34 | 98 | "%attr(2755,%{l_musr},$setgid) %{l_prefix}/bin/lsof" |
michael@34 | 99 | |
michael@34 | 100 | %files -f files |
michael@34 | 101 | |
michael@34 | 102 | %clean |
michael@34 | 103 |