recipe 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Build recipe for attr.
  2. #
  3. # Copyright (c) 2016-2018 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=attr
  17. version=2.4.48
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://download.savannah.gnu.org/releases/attr/$tarname
  24. description="
  25. Extended attributes.
  26. The extended attributes are name:value pairs associated
  27. permanently with files and directories.
  28. For more information, type: \"man 5 attr\".
  29. "
  30. homepage=http://savannah.nongnu.org/projects/attr
  31. license="GPLv2+, LGPLv2.1"
  32. # Source documentation
  33. docs="README doc/CHANGES doc/COPYING*"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. # Apply patches from upstream.
  43. #
  44. # test: escape left brace in a regex in test/run
  45. patch -p1 < "${worktree}/patches/attr/406eab7aa09da9df787a964d3c152c0bda6e23c4"
  46. # Switch back to syscall()
  47. patch -p1 < "${worktree}/patches/attr/14adc898a36948267bfe5c63b399996879e94c98"
  48. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  49. $configure_args \
  50. --libdir=/usr/lib${libSuffix} \
  51. --mandir=$mandir \
  52. --docdir=$docsdir \
  53. --build="$(cc -dumpmachine)"
  54. make -j${jobs} V=1
  55. make -j${jobs} DESTDIR="$destdir" install-strip
  56. # To handle config file(s)
  57. touch "${destdir}/etc/.graft-config"
  58. # Compress and link man pages (if needed)
  59. if test -d "${destdir}/$mandir"
  60. then
  61. (
  62. cd "${destdir}/$mandir"
  63. find . -type f -exec lzip -9 '{}' +
  64. find . -type l | while read -r file
  65. do
  66. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  67. rm -- "$file"
  68. done
  69. )
  70. fi
  71. # Copy documentation
  72. mkdir -p "${destdir}${docsdir}"
  73. cp -p $docs "${destdir}${docsdir}/"
  74. }