lsof.spec 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ##
  2. ## lsof.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: lsof
  27. Summary: List Open Files
  28. URL: ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
  29. Vendor: Victor A. Abell
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [REL]
  32. Group: Filesystem
  33. License: BSD
  34. Version: 4.58
  35. Release: 20011201
  36. # list of sources
  37. Source0: ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof_%{version}_W.tar.gz
  38. Source1: ftp://ftp.openpkg.org/DST/lsof/lsof.sparc64-solaris2.8.bin
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20011126.0
  43. PreReq: OpenPKG, openpkg >= 20011126.0
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. List Open Files (lsof) shows all currently open file descriptors of all
  48. processes.
  49. %prep
  50. %setup -q -c lsof-%{version}
  51. %{l_tar} xf lsof_%{version}.tar
  52. %build
  53. cd lsof_%{version}
  54. case "%{l_target}" in
  55. *-freebsd* ) platform="freebsd" ;;
  56. *-linux* ) platform="linux" ;;
  57. *-solaris* ) platform="solaris" ;;
  58. esac
  59. skip_build=0
  60. case "%{l_target}" in
  61. *-solaris2.8* )
  62. case "`/bin/isainfo -kv`" in
  63. 64-bit* )
  64. cp %{SOURCE lsof.sparc64-solaris2.8.bin} lsof
  65. skip_build=1
  66. ;;
  67. esac
  68. ;;
  69. esac
  70. if [ ".$skip_build" = .0 ]; then
  71. ./Configure -n $platform
  72. %{l_make} %{l_mflags -O}
  73. fi
  74. %install
  75. rm -rf $RPM_BUILD_ROOT
  76. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
  77. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man8
  78. ( cd lsof_%{version}
  79. %{l_shtool} install -c -s lsof $RPM_BUILD_ROOT%{l_prefix}/bin/
  80. %{l_shtool} install -c lsof.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  81. )
  82. setgid=""
  83. case "%{l_target}" in
  84. *-freebsd* ) setgid="kmem" ;;
  85. *-linux* ) setgid="kmem" ;;
  86. *-solaris* ) setgid="sys" ;;
  87. esac
  88. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  89. %{l_files_std} \
  90. "%attr(2755,%{l_fsusr},$setgid) %{l_prefix}/bin/lsof"
  91. %files -f files
  92. %clean
  93. rm -rf $RPM_BUILD_ROOT