recipe 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Build recipe for libcap.
  2. #
  3. # Copyright (c) 2016-2019 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. program=libcap
  17. version=2.27
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/$tarname
  24. description="
  25. Library with capabilities for POSIX.1e.
  26. The libcap package implements the user-space interfaces to the
  27. POSIX 1003.1e capabilities available in Linux kernels.
  28. These capabilities are a partitioning of the all powerful root
  29. privilege into a set of distinct privileges.
  30. "
  31. homepage=http://sites.google.com/site/fullycapable
  32. license=GPLv2+
  33. # Source documentation
  34. docs="CHANGELOG License README"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. make DEBUG="" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS"
  44. make install RAISE_SETFCAP=no \
  45. DESTDIR="$destdir" \
  46. LIBDIR=/usr/lib${libSuffix} \
  47. SBINDIR=/usr/sbin \
  48. PKGCONFIGDIR=/usr/lib${libSuffix}/pkgconfig
  49. # Fix permissions
  50. chmod 755 "${destdir}/usr/lib${libSuffix}/libcap.so"
  51. # Compress and link man pages (if needed)
  52. if test -d "${destdir}/$mandir"
  53. then
  54. (
  55. cd "${destdir}/$mandir"
  56. find . -type f -exec lzip -9 '{}' +
  57. find . -type l | while read -r file
  58. do
  59. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  60. rm -- "$file"
  61. done
  62. )
  63. fi
  64. # Copy documentation
  65. mkdir -p "${destdir}${docsdir}"
  66. cp -p $docs "${destdir}${docsdir}"
  67. }