recipe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Build recipe for findutils.
  2. #
  3. # Copyright (c) 2016-2017 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. program=findutils
  18. version=4.7.0
  19. release=2
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/tools"
  22. tarname=${program}-${version}.tar.xz
  23. # Remote source(s)
  24. fetch=http://ftp.gnu.org/gnu/findutils/$tarname
  25. description="
  26. Utilities to find files.
  27. The set of GNU find utilities contains tools to find files
  28. such as exact name, creation date, size, permissions, etc.
  29. "
  30. homepage=http://www.gnu.org/software/findutils
  31. license=GPLv3+
  32. # Source documentation
  33. docs="AUTHORS COPYING ChangeLog NEWS README* THANKS TODO"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Fix minor memory leak in sharefile handling.
  41. #
  42. # http://git.savannah.gnu.org/cgit/findutils.git/commit/?id=9ad78c90c77636b5491f63470ed241123ca85cf6
  43. patch -Np1 -i "${worktree}/patches/findutils/9ad78c90c77636b5491f63470ed241123ca85cf6"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  47. $configure_args \
  48. --libdir=/usr/lib${libSuffix} \
  49. --libexecdir=/usr/lib${libSuffix}/locate \
  50. --localstatedir=/var/lib/locate \
  51. --infodir=$infodir \
  52. --mandir=$mandir \
  53. --docdir=$docsdir \
  54. --build="$(cc -dumpmachine)"
  55. make -j${jobs} V=1
  56. make -j${jobs} DESTDIR="$destdir" install
  57. # Remove locate implementation, replaced by mlocate
  58. rm -f "${destdir}/usr/bin/locate" \
  59. "${destdir}/usr/bin/updatedb" \
  60. "${destdir}/${mandir}/man1/locate.1" \
  61. "${destdir}/${mandir}/man1/updatedb.1" \
  62. "${destdir}/${mandir}/man5/locatedb.5"
  63. rm -rf "${destdir}/usr/lib${libSuffix}/locate" \
  64. "${destdir}/var/lib/locate"
  65. # Remove generated charset.alias
  66. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  67. rmdir "${destdir}/usr/lib${libSuffix}" || true
  68. # Compress info documents deleting index file for the package
  69. if test -d "${destdir}/$infodir"
  70. then
  71. rm -f "${destdir}/${infodir}/dir"
  72. lzip -9 "${destdir}/${infodir}"/*
  73. fi
  74. # Compress and link man pages (if needed)
  75. if test -d "${destdir}/$mandir"
  76. then
  77. (
  78. cd "${destdir}/$mandir"
  79. find . -type f -exec lzip -9 '{}' +
  80. find . -type l | while read -r file
  81. do
  82. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  83. rm -- "$file"
  84. done
  85. )
  86. fi
  87. # Copy documentation
  88. mkdir -p "${destdir}${docsdir}"
  89. for file in $docs
  90. do
  91. cp -p $file "${destdir}${docsdir}"
  92. done
  93. }