michael@34: ## michael@34: ## lsof.spec -- OpenPKG RPM Package Specification michael@464: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@34: ## michael@34: ## Permission to use, copy, modify, and distribute this software for michael@34: ## any purpose with or without fee is hereby granted, provided that michael@34: ## the above copyright notice and this permission notice appear in all michael@34: ## copies. michael@34: ## michael@34: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@34: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@34: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@34: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@34: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@34: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@34: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@34: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@34: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@34: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@34: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@34: ## SUCH DAMAGE. michael@34: ## michael@34: michael@34: # package information michael@34: Name: lsof michael@34: Summary: List Open Files michael@34: URL: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ michael@34: Vendor: Victor A. Abell michael@34: Packager: OpenPKG Foundation e.V. michael@34: Distribution: OpenPKG Community michael@34: Class: BASE michael@34: Group: Debugging michael@34: License: BSD michael@464: Version: 4.86 michael@465: Release: 20120800 michael@34: michael@34: # list of sources michael@34: Source0: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_%{version}.tar.gz michael@34: Patch0: lsof.patch michael@34: michael@34: # build information michael@523: BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make michael@464: PreReq: OpenPKG, openpkg >= 20100101 michael@34: michael@34: %description michael@34: List Open Files (lsof) shows all currently open file descriptors of michael@34: processes. michael@34: michael@34: %track michael@34: prog lsof = { michael@34: version = %{version} michael@34: url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ michael@34: regex = lsof_(__VER__)\.tar\.gz michael@34: } michael@34: michael@34: %prep michael@34: %setup -q -n lsof_%{version} michael@34: %{l_tar} xf lsof_%{version}_src.tar michael@34: cd lsof_%{version}_src michael@34: %patch -p0 michael@34: michael@34: %build michael@34: cd lsof_%{version}_src michael@34: export PATH="/bin:/usr/bin:$PATH" michael@34: export LSOF_CC="%{l_cc}" michael@465: export LSOF_MAKE="%{l_make} %{l_mflags -O}" michael@34: case "%{l_platform -t}" in michael@34: *-freebsd* ) platform="freebsd"; LSOF_CC="/usr/bin/cc"; LSOF_MAKE="/usr/bin/make" ;; michael@34: *-linux* ) platform="linux" ;; michael@34: *-sunos* ) platform="solaris" ;; michael@34: *-netbsd* ) platform="netbsd" ;; michael@34: *-hpux* ) platform="hpuxgcc" ;; michael@34: *-aix* ) platform="aixgcc" ;; michael@34: * ) echo "Platform %{l_platform -t} not supported" 1>&2; exit 1 ;; michael@34: esac michael@34: ./Configure -n $platform michael@34: eval $LSOF_MAKE michael@34: michael@34: %install michael@34: %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin michael@34: %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8 michael@34: ( cd lsof_%{version}_src michael@34: %{l_shtool} install -c lsof $RPM_BUILD_ROOT%{l_prefix}/bin/ michael@34: %{l_shtool} install -c lsof.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ michael@34: ) || exit $? michael@34: strip $RPM_BUILD_ROOT%{l_prefix}/bin/lsof >/dev/null 2>&1 || true michael@34: setgid="" michael@34: case "%{l_platform -t}" in michael@34: *-freebsd* ) setgid="kmem" ;; michael@34: *-linux* ) setgid="kmem" ;; michael@34: *-sunos* ) setgid="sys" ;; michael@34: *-netbsd* ) setgid="kmem" ;; michael@34: *-hpux* ) setgid="sys" ;; michael@34: *-aix* ) setgid="sys" ;; michael@34: esac michael@34: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@34: %{l_files_std} \ michael@34: "%attr(2755,%{l_musr},$setgid) %{l_prefix}/bin/lsof" michael@34: michael@34: %files -f files michael@34: michael@34: %clean michael@34: