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