recipe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Build recipe for gnutls.
  2. #
  3. # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
  4. # Copyright (c) 2018-2019, 2021-2022 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=gnutls
  20. version=3.7.8
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=networking
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/"$tarname"
  27. description="
  28. The GnuTLS Transport Layer Security Library.
  29. GnuTLS is a secure communications library implementing the SSL, TLS and
  30. DTLS protocols and technologies around them. It provides a simple C
  31. language application programming interface (API) to access the secure
  32. communications protocols as well as APIs to parse and write X.509,
  33. PKCS #12, and other required structures.
  34. The project strives to provide a secure communications back-end, simple
  35. to use and integrated with the rest of the base Linux libraries. A
  36. back-end designed to work and be secure out of the box, keeping the TLS
  37. and PKI complexity outside the applications.
  38. "
  39. homepage=https://gnutls.org/
  40. license="LGPLv2+, GPLv3+, GFDL1.3"
  41. # Source documentation
  42. docs="AUTHORS CONTRIBUTING.md ChangeLog LICENSE NEWS README.md THANKS"
  43. docsdir="${docdir}/${program}-${version}"
  44. build()
  45. {
  46. unpack "${tardir}/$tarname"
  47. cd "$srcdir"
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. ./configure CPPFLAGS="$QICPPFLAGS" \
  51. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  52. $configure_args \
  53. --libdir=/usr/lib${libSuffix} \
  54. --infodir=$infodir \
  55. --mandir=$mandir \
  56. --docdir=$docsdir \
  57. --htmldir=${docsdir}/html \
  58. --enable-static=no \
  59. --enable-threads=posix \
  60. --enable-guile \
  61. --with-p11-kit \
  62. --without-included-libtasn1 \
  63. --without-included-unistring \
  64. --build="$(gcc -dumpmachine)"
  65. make -j${jobs} V=1
  66. make -j${jobs} DESTDIR="$destdir" install-strip
  67. # Move wrong installed .png files to the HTML location
  68. mv "${destdir}/$infodir"/*.png "${destdir}/${docsdir}/html"
  69. # Compress info documents deleting index file for the package
  70. if test -d "${destdir}/$infodir"
  71. then
  72. rm -f "${destdir}/${infodir}/dir"
  73. lzip -9 "${destdir}/${infodir}"/*
  74. fi
  75. # Compress and link man pages (if needed)
  76. if test -d "${destdir}/$mandir"
  77. then
  78. (
  79. cd "${destdir}/$mandir"
  80. find . -type f -exec lzip -9 {} +
  81. find . -type l | while read -r file
  82. do
  83. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  84. rm -- "$file"
  85. done
  86. )
  87. fi
  88. # Copy documentation
  89. mkdir -p "${destdir}/$docsdir"
  90. cp -p $docs "${destdir}/$docsdir"
  91. }