template 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Build recipe for [program]
  2. #
  3. # Copyright 2018 Mateus P. Rodrigues <mprodrigues@dragora.org>.
  4. #
  5. # This recipe is free software, under the terms of the Apache License 2.0
  6. program=
  7. version=
  8. release=1
  9. tarname=${program}-${version}.tar.gz
  10. # Remote source(s)
  11. fetch=https://example.com
  12. description="
  13. Example description
  14. "
  15. homepage=http://example.com
  16. license=
  17. # Source documentation
  18. docs="COPYING ChangeLog README*"
  19. docsdir="${docdir}/${program}-${version}"
  20. build()
  21. {
  22. set -e
  23. unpack "${tardir}/$tarname"
  24. cd "$srcdir"
  25. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  26. $configure_args \
  27. --libdir=/usr/lib${libSuffix} \
  28. --infodir=$infodir \
  29. --mandir=$mandir \
  30. --docdir=$docdir \
  31. --build="$(cc -dumpmachine)"
  32. make -j${jobs} V=1
  33. make -j${jobs} DESTDIR="$destdir" install
  34. # Compress info documents deleting index file for the package
  35. if test -d "${destdir}/$infodir"
  36. then
  37. rm -f "${destdir}/${infodir}/dir"
  38. lzip -9 "${destdir}/${infodir}"/*
  39. fi
  40. # Compress and link man pages (if needed)
  41. if test -d "${destdir}/$mandir"
  42. then
  43. (
  44. cd "${destdir}/$mandir"
  45. find . -type f -exec lzip -9 '{}' +
  46. find . -type l | while read -r file
  47. do
  48. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  49. rm -- "$file"
  50. done
  51. )
  52. fi
  53. # Copy documentation
  54. mkdir -p "${destdir}${docsdir}"
  55. cp -p $docs "${destdir}${docsdir}"
  56. }