recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tde / tqca / recipe
blobe37550e2c3601e5cecd233c643d1a062d6ff5195
1 # Build recipe for tqca-trinity.
3 # Copyright (c) 2020-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=tqca
21 version=20220503_8dbed86
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=tde
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch="
31  https://dragora.mirror.garr.it/current/sources/$tarname
32  rsync://rsync.dragora.org/current/sources/$tarname
35 description="
36 The TQt cryptographic architecture.
38 This library provides an easy API for the following features:
40   SSL/TLS
41   X509
42   SASL
43   RSA
44   Hashing (SHA1, MD5)
45   Ciphers (BlowFish, 3DES, AES)
47 Functionality is supplied via plugins. This is useful for avoiding
48 dependence on a particular crypto library and makes upgrading easier,
49 as there is no need to recompile your application when adding or
50 upgrading a crypto plugin.  Also, by pushing crypto functionality into
51 plugins, your application is free of legal issues, such as export
52 regulation.
55 homepage=https://www.trinitydesktop.org/
56 license=LGPLv2.1
58 # Source documentation
59 docs="COPYING README"
60 docsdir="${docdir}/${program}-${version}"
62 build()
64     unpack "${tardir}/$tarname"
66     cd "$srcdir"
68     # Set sane permissions
69     chmod -R u+w,go-w,a+rX-s .
71     rm -rf BUILD
72     mkdir BUILD
73     cd BUILD
75     cmake \
76      -DCMAKE_EXPORT_COMPILE_COMMANDS=ON                     \
77      -DCMAKE_BUILD_TYPE=RelWithDebInfo                      \
78      -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$QICFLAGS"      \
79      -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$QICXXFLAGS"  \
80      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(echo $QILDFLAGS | sed 's/-s//')" \
81      -DCMAKE_INSTALL_PREFIX=/usr                            \
82      -DLIB_SUFFIX=${libSuffix}                              \
83      -DCONFIG_INSTALL_DIR=/etc/trinity                      \
84      -DSYSCONF_INSTALL_DIR=/etc/trinity                     \
85      -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus                  \
86      -DCMAKE_VERBOSE_MAKEFILE=ON                            \
87      -DCMAKE_SKIP_RPATH=OFF                                 \
88      -DBUILD_TQCA=ON                                        \
89      -DBUILD_TQCA_TLS=ON                                    \
90      -DWITH_ALL_OPTIONS=ON                                  \
91      -G Ninja ..
93     ninja -j${jobs}
94     DESTDIR="$destdir" ninja -j${jobs} install
96     # Compress and link man pages (if needed)
97     if test -d "${destdir}/$mandir"
98     then
99         (
100             cd "${destdir}/$mandir"
101             find . -type f -exec lzip -9 {} +
102             find . -type l | while read -r file
103             do
104                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105                 rm -- "$file"
106             done
107         )
108     fi
110     cd ..
112     # Copy documentation
113     mkdir -p "${destdir}/$docsdir"
114     cp -p $docs "${destdir}/$docsdir"