recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Build recipe for tar.
  2. #
  3. # Copyright (c) 2016-2017 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2019, 2021 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. # Exit immediately on any error
  18. set -e
  19. program=tar
  20. version=1.34
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=tools
  24. tarname=${program}-${version}.tar.bz2
  25. # Remote source(s)
  26. fetch=https://ftp.gnu.org/gnu/tar/$tarname
  27. description="
  28. Tool to package and manipulate files.
  29. The tar program provides the ability to create tar archives, as well as
  30. various other kinds of manipulation. For example, you can use tar on
  31. previously created archives to extract files, to store additional
  32. files, or to update or list files which were already stored.
  33. The name of tar comes from \"Tape ARchiver\".
  34. "
  35. homepage=https://www.gnu.org/software/tar
  36. license=GPLv3+
  37. # Source documentation
  38. docs="AUTHORS COPYING ChangeLog NEWS README THANKS TODO"
  39. docsdir="${docdir}/${program}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  47. FORCE_UNSAFE_CONFIGURE="1" \
  48. $configure_args \
  49. --libdir=/usr/lib${libSuffix} \
  50. --infodir=$infodir \
  51. --mandir=$mandir \
  52. --docdir=$docsdir \
  53. --enable-backup-scripts \
  54. --enable-nls \
  55. --build="$(gcc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install
  58. # Remove generated charset.alias
  59. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  60. rmdir "${destdir}/usr/lib${libSuffix}" || true
  61. # Compress info documents deleting index file for the package
  62. if test -d "${destdir}/$infodir"
  63. then
  64. rm -f "${destdir}/${infodir}/dir"
  65. lzip -9 "${destdir}/${infodir}"/*
  66. fi
  67. # Compress and link man pages (if needed)
  68. if test -d "${destdir}/$mandir"
  69. then
  70. (
  71. cd "${destdir}/$mandir"
  72. find . -type f -exec lzip -9 {} +
  73. find . -type l | while read -r file
  74. do
  75. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  76. rm -- "$file"
  77. done
  78. )
  79. fi
  80. # Copy documentation
  81. mkdir -p "${destdir}/$docsdir"
  82. cp -p $docs "${destdir}/$docsdir"
  83. }