recipe 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Build recipe for libarchive.
  2. #
  3. # Copyright (c) 2018-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=libarchive
  17. version=3.4.0
  18. release=2
  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://libarchive.org/downloads/$tarname
  24. description="
  25. Multi-format archive and compression library.
  26. The libarchive project develops a portable, efficient C library that
  27. can read and write streaming archives in a variety of formats.
  28. It also includes implementations of the common tar, cpio, and zcat
  29. command-line tools that use the libarchive library.
  30. "
  31. homepage=http:/libarchive.org
  32. license=BSD
  33. # Source documentation
  34. docs="COPYING NEWS README.md"
  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. # Configure to make use of Expat and Nettle (instead of *ssl)
  44. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --mandir=$mandir \
  48. --docdir=$docsdir \
  49. --enable-static=no \
  50. --enable-shared=yes \
  51. --without-xml2 \
  52. --without-openssl \
  53. --build="$(cc -dumpmachine)"
  54. make -j${jobs} V=1
  55. make -j${jobs} DESTDIR="$destdir" install
  56. rmdir "${destdir}/usr/bin" 2> /dev/null || true;
  57. # Compress and link man pages (if needed)
  58. if test -d "${destdir}/$mandir"
  59. then
  60. (
  61. cd "${destdir}/$mandir"
  62. find . -type f -exec lzip -9 '{}' +
  63. find . -type l | while read -r file
  64. do
  65. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  66. rm -- "$file"
  67. done
  68. )
  69. fi
  70. # Copy documentation
  71. mkdir -p "${destdir}${docsdir}"
  72. cp -p $docs "${destdir}${docsdir}"
  73. }