recipes: tools/cryptsetup: Update recipe
[dragora.git] / recipes / tools / cryptsetup / recipe
blob3ed0af842728f0a04a43c8b76f8462e78deb9036
1 # Build recipe for cryptsetup.
3 # Copyright (c) 2022 DustDFG, <dfgdust@gmail.com>.
4 # Copyright (c) 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=cryptsetup
22 version=2.4.3
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tar.xz
30 # Remote source(s)
31 fetch=https://www.kernel.org/pub/linux/utils/cryptsetup/v2.4/$tarname
33 description="
34 A utility used to conveniently set up disk encryption.
36 These include plain dm-crypt volumes, LUKS volumes, loop-AES, TrueCrypt
37 (including VeraCrypt extension) and BitLocker formats.  The project also
38 includes a veritysetup utility used to conveniently setup DMVerity block
39 integrity checking kernel module and integritysetup to setup DMIntegrity
40 block integrity kernel module.
43 homepage=https://gitlab.com/cryptsetup/cryptsetup/
44 license="GPLv2+, LGPLv2+"
46 # Source documentation
47 docs="AUTHORS COPYING* FAQ README.md docs/v${version}-ReleaseNotes"
48 docsdir="${docdir}/${program}-${version}"
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     patch -Np0 -i "${worktree}/patches/cryptsetup/libssh2.patch"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     autoreconf -vif
63     ./configure CPPFLAGS="$QICPPFLAGS" \
64     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --infodir=$infodir \
68      --mandir=$mandir \
69      --docdir=$docsdir \
70      --disable-ssh-token \
71      --build="$(gcc -dumpmachine)"
73     make -j${jobs} V=1
74     make -j${jobs} DESTDIR="$destdir" install
76     # Compress info documents deleting index file for the package
77     if test -d "${destdir}/$infodir"
78     then
79         rm -f "${destdir}/${infodir}/dir"
80         lzip -9 "${destdir}/${infodir}"/*
81     fi
83     # Compress and link man pages (if needed)
84     if test -d "${destdir}/$mandir"
85     then
86         (
87             cd "${destdir}/$mandir"
88             find . -type f -exec lzip -9 {} +
89             find . -type l | while read -r file
90             do
91                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92                 rm -- "$file"
93             done
94         )
95     fi
97     # Copy documentation
98     mkdir -p "${destdir}/$docsdir"
99     cp -p $docs "${destdir}/$docsdir"