1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/lsof/lsof.spec Thu Jan 08 10:18:50 2009 +0100 1.3 @@ -0,0 +1,109 @@ 1.4 +## 1.5 +## lsof.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package information 1.28 +Name: lsof 1.29 +Summary: List Open Files 1.30 +URL: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ 1.31 +Vendor: Victor A. Abell 1.32 +Packager: OpenPKG Foundation e.V. 1.33 +Distribution: OpenPKG Community 1.34 +Class: BASE 1.35 +Group: Debugging 1.36 +License: BSD 1.37 +Version: 4.81 1.38 +Release: 20081023 1.39 + 1.40 +# list of sources 1.41 +Source0: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_%{version}.tar.gz 1.42 +Patch0: lsof.patch 1.43 + 1.44 +# build information 1.45 +Prefix: %{l_prefix} 1.46 +BuildRoot: %{l_buildroot} 1.47 +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc 1.48 +PreReq: OpenPKG, openpkg >= 20040130 1.49 +AutoReq: no 1.50 +AutoReqProv: no 1.51 + 1.52 +%description 1.53 + List Open Files (lsof) shows all currently open file descriptors of 1.54 + processes. 1.55 + 1.56 +%track 1.57 + prog lsof = { 1.58 + version = %{version} 1.59 + url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ 1.60 + regex = lsof_(__VER__)\.tar\.gz 1.61 + } 1.62 + 1.63 +%prep 1.64 + %setup -q -n lsof_%{version} 1.65 + %{l_tar} xf lsof_%{version}_src.tar 1.66 + cd lsof_%{version}_src 1.67 + %patch -p0 1.68 + 1.69 +%build 1.70 + cd lsof_%{version}_src 1.71 + export PATH="/bin:/usr/bin:$PATH" 1.72 + export LSOF_CC="%{l_cc}" 1.73 + export LSOF_MAKE="%{l_make} %{l_mflags}" 1.74 + case "%{l_platform -t}" in 1.75 + *-freebsd* ) platform="freebsd"; LSOF_CC="/usr/bin/cc"; LSOF_MAKE="/usr/bin/make" ;; 1.76 + *-linux* ) platform="linux" ;; 1.77 + *-sunos* ) platform="solaris" ;; 1.78 + *-netbsd* ) platform="netbsd" ;; 1.79 + *-hpux* ) platform="hpuxgcc" ;; 1.80 + *-aix* ) platform="aixgcc" ;; 1.81 + * ) echo "Platform %{l_platform -t} not supported" 1>&2; exit 1 ;; 1.82 + esac 1.83 + ./Configure -n $platform 1.84 + eval $LSOF_MAKE 1.85 + 1.86 +%install 1.87 + rm -rf $RPM_BUILD_ROOT 1.88 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin 1.89 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8 1.90 + ( cd lsof_%{version}_src 1.91 + %{l_shtool} install -c lsof $RPM_BUILD_ROOT%{l_prefix}/bin/ 1.92 + %{l_shtool} install -c lsof.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ 1.93 + ) || exit $? 1.94 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/lsof >/dev/null 2>&1 || true 1.95 + setgid="" 1.96 + case "%{l_platform -t}" in 1.97 + *-freebsd* ) setgid="kmem" ;; 1.98 + *-linux* ) setgid="kmem" ;; 1.99 + *-sunos* ) setgid="sys" ;; 1.100 + *-netbsd* ) setgid="kmem" ;; 1.101 + *-hpux* ) setgid="sys" ;; 1.102 + *-aix* ) setgid="sys" ;; 1.103 + esac 1.104 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 1.105 + %{l_files_std} \ 1.106 + "%attr(2755,%{l_musr},$setgid) %{l_prefix}/bin/lsof" 1.107 + 1.108 +%files -f files 1.109 + 1.110 +%clean 1.111 + rm -rf $RPM_BUILD_ROOT 1.112 +