lsof.spec 3.3 KB

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