recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / networking / libressl / recipe
blob9066f480e34efa02ce49b9482740bf31e4e56648
1 # Build recipe for libressl.
3 # Copyright (c) 2017-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
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
9 #    http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Exit immediately on any error
18 set -e
20 program=libressl
21 version=3.4.2
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/$tarname
32 description="
33 A version of the TLS/crypto stack.
35 LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in
36 2014, with goals of modernizing the codebase, improving security, and
37 applying best practice development processes.
39 Primary development occurs inside the OpenBSD source tree with the
40 usual care the project is known for.  On a regular basis the code
41 is re-packaged for portable use by other operating systems (Linux,
42 FreeBSD, Windows, etc).
45 homepage=https://www.libressl.org
46 license=Custom
48 # Source documentation
49 docs="COPYING ChangeLog README.md VERSION"
50 docsdir="${docdir}/${program}-${version}"
52 build()
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     ./configure CPPFLAGS="$QICPPFLAGS" \
62     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --mandir=$mandir \
66      --docdir=$docsdir \
67      --enable-hardening \
68      --enable-nc \
69      --with-openssldir=/etc/ssl \
70      --build="$(gcc -dumpmachine)"
72     make -j${jobs} V=1
73     make -j${jobs} DESTDIR="$destdir" install-strip
75     # This is provided by the ca-certificates package
76     rm -f "${destdir}/etc/ssl/cert.pem"
77     rmdir "${destdir}/etc/ssl/certs"
79     # To manage config file(s)
80     touch "${destdir}/etc/ssl/.graft-config"
82     # Compress and link man pages (if needed)
83     if test -d "${destdir}/$mandir"
84     then
85         (
86             cd "${destdir}/$mandir"
87             find . -type f -exec lzip -9 {} +
88             find . -type l | while read -r file
89             do
90                 ln -sf "$(readlink -- $file).lz" "${file}.lz"
91                 rm -- "$file"
92             done
93         )
94     fi
96     # Remove broken symlinks
97     find "${destdir}/$mandir" -print | while read -r file
98     do
99         if test -L "$file" && test ! -e "$file"
100         then
101             echo "Deleting dangling symlink: $file"
102             rm -f -- "$file"
103         fi
104     done
106     # Copy documentation
107     mkdir -p "${destdir}/$docsdir"
108     cp -p $docs "${destdir}/$docsdir"