Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/cryptsetup/
Date: Fri, 17 Sep 2021 10:24:27
Message-Id: 1631874257.b92b1ef6f12e3f5d8fd5d99a108bd520819c969b.polynomial-c@gentoo
1 commit: b92b1ef6f12e3f5d8fd5d99a108bd520819c969b
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 17 10:17:30 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 17 10:24:17 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b92b1ef6
7
8 sys-fs/cryptsetup: Bump to version 2.4.1
9
10 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
11
12 sys-fs/cryptsetup/Manifest | 1 +
13 sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild | 133 ++++++++++++++++++++++++++++++
14 2 files changed, 134 insertions(+)
15
16 diff --git a/sys-fs/cryptsetup/Manifest b/sys-fs/cryptsetup/Manifest
17 index e71ad1a733d..fdf916e6343 100644
18 --- a/sys-fs/cryptsetup/Manifest
19 +++ b/sys-fs/cryptsetup/Manifest
20 @@ -1,2 +1,3 @@
21 DIST cryptsetup-2.3.6.tar.xz 11154148 BLAKE2B 23a7d6fdeed2b8fb0492e800266a263b12dcf2b8c4304bda82e46d2de90b6c05a97a40f0f6f9c337b3dc428d51689d76953de5cc4daed210967cf0ea0ff503d2 SHA512 5b25cc806140d24181a0e4f0e7b0bd3caa8263aa502e8633b41c980f06ecba2e6acbf9c2d9cc4a785d38ce90d86dd8d22c52b28b9ca4a15824c2e8bdb3656665
22 DIST cryptsetup-2.4.0.tar.xz 11162168 BLAKE2B a2074d1607ff3c136818b14ea3939fde3a528430b50ebd4d483d1e164ede6a62432c27e0d7d8b29b89ad6bce69dae30fc6bdf5ce458b3c6faa5178f6218519e6 SHA512 9c868b1dee7145f91092160cf977d3ada57a14634b5312d54477e111250975b6f077a92c417373bb7de07244b01ab19553bcce5030ee456ca2c38030e3067186
23 +DIST cryptsetup-2.4.1.tar.xz 11171180 BLAKE2B 6b999a19df54276d295eb2f1729be2eefb5fb09cd29aae5f7c0b93c539b4b552f92327f2474e0f4793a3c7f8a264a4ef927178dabfc9ba56012bdf9949ef9ada SHA512 17fc73c180e41acbd4ebeddebaf54f8baeef09fce7f154aa9c55936a58bda7adcc7b1bb257336c22295d7b5af426fc8dfd0e4e644e4a52098bcb8a2adb562ca7
24
25 diff --git a/sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild b/sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild
26 new file mode 100644
27 index 00000000000..09141d7320f
28 --- /dev/null
29 +++ b/sys-fs/cryptsetup/cryptsetup-2.4.1.ebuild
30 @@ -0,0 +1,133 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit autotools linux-info tmpfiles
37 +
38 +DESCRIPTION="Tool to setup encrypted devices with dm-crypt"
39 +HOMEPAGE="https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md"
40 +SRC_URI="https://www.kernel.org/pub/linux/utils/${PN}/v$(ver_cut 1-2)/${P/_/-}.tar.xz"
41 +
42 +LICENSE="GPL-2+"
43 +SLOT="0/12" # libcryptsetup.so version
44 +[[ ${PV} != *_rc* ]] && \
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
46 +CRYPTO_BACKENDS="gcrypt kernel nettle +openssl"
47 +# we don't support nss since it doesn't allow cryptsetup to be built statically
48 +# and it's missing ripemd160 support so it can't provide full backward compatibility
49 +IUSE="${CRYPTO_BACKENDS} +argon2 nls pwquality reencrypt ssh static static-libs +udev urandom"
50 +REQUIRED_USE="^^ ( ${CRYPTO_BACKENDS//+/} )
51 + static? ( !gcrypt !udev )" #496612
52 +
53 +LIB_DEPEND="
54 + dev-libs/json-c:=[static-libs(+)]
55 + dev-libs/libgpg-error[static-libs(+)]
56 + dev-libs/popt[static-libs(+)]
57 + >=sys-apps/util-linux-2.31-r1[static-libs(+)]
58 + argon2? ( app-crypt/argon2:=[static-libs(+)] )
59 + gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] )
60 + nettle? ( >=dev-libs/nettle-2.4[static-libs(+)] )
61 + openssl? ( dev-libs/openssl:0=[static-libs(+)] )
62 + pwquality? ( dev-libs/libpwquality[static-libs(+)] )
63 + ssh? ( net-libs/libssh[static-libs(+)] )
64 + sys-fs/lvm2[static-libs(+)]"
65 +# We have to always depend on ${LIB_DEPEND} rather than put behind
66 +# !static? () because we provide a shared library which links against
67 +# these other packages. #414665
68 +RDEPEND="static-libs? ( ${LIB_DEPEND} )
69 + ${LIB_DEPEND//\[static-libs\([+-]\)\]}
70 + udev? ( virtual/libudev:= )"
71 +DEPEND="${RDEPEND}
72 + static? ( ${LIB_DEPEND} )"
73 +BDEPEND="
74 + virtual/pkgconfig
75 +"
76 +
77 +S="${WORKDIR}/${P/_/-}"
78 +
79 +PATCHES=( "${FILESDIR}"/${PN}-2.0.4-fix-static-pwquality-build.patch )
80 +
81 +pkg_setup() {
82 + local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC ~CRYPTO_SHA256"
83 + local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n"
84 + local WARNING_CRYPTO_SHA256="CONFIG_CRYPTO_SHA256:\tis not set (required for cryptsetup)\n"
85 + local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n"
86 + local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n"
87 + check_extra_config
88 +}
89 +
90 +src_prepare() {
91 + sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die
92 + default
93 + eautoreconf
94 +}
95 +
96 +src_configure() {
97 + if use kernel ; then
98 + ewarn "Note that kernel backend is very slow for this type of operation"
99 + ewarn "and is provided mainly for embedded systems wanting to avoid"
100 + ewarn "userspace crypto libraries."
101 + fi
102 +
103 + local myeconfargs=(
104 + --disable-internal-argon2
105 + --enable-shared
106 + --sbindir=/sbin
107 + # for later use
108 + --with-default-luks-format=LUKS2
109 + --with-tmpfilesdir="${EPREFIX}/usr/lib/tmpfiles.d"
110 + --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/} ; do usev ${x} ; done)
111 + $(use_enable argon2 libargon2)
112 + $(use_enable nls)
113 + $(use_enable pwquality)
114 + $(use_enable reencrypt cryptsetup-reencrypt)
115 + $(use_enable static static-cryptsetup)
116 + $(use_enable static-libs static)
117 + $(use_enable udev)
118 + $(use_enable !urandom dev-random)
119 + $(use_enable ssh ssh-token)
120 + $(usex argon2 '' '--with-luks2-pbkdf=pbkdf2')
121 + )
122 + econf "${myeconfargs[@]}"
123 +}
124 +
125 +src_test() {
126 + if [[ ! -e /dev/mapper/control ]] ; then
127 + ewarn "No /dev/mapper/control found -- skipping tests"
128 + return 0
129 + fi
130 +
131 + local p
132 + for p in /dev/mapper /dev/loop* ; do
133 + addwrite ${p}
134 + done
135 +
136 + default
137 +}
138 +
139 +src_install() {
140 + default
141 +
142 + if use static ; then
143 + mv "${ED}"/sbin/cryptsetup{.static,} || die
144 + mv "${ED}"/sbin/veritysetup{.static,} || die
145 + mv "${ED}"/sbin/integritysetup{.static,} || die
146 + if use ssh ; then
147 + mv "${ED}"/sbin/cryptsetup-ssh{.static,} || die
148 + fi
149 + if use reencrypt ; then
150 + mv "${ED}"/sbin/cryptsetup-reencrypt{.static,} || die
151 + fi
152 + fi
153 + find "${ED}" -type f -name "*.la" -delete || die
154 +
155 + dodoc docs/v*ReleaseNotes
156 +
157 + newconfd "${FILESDIR}"/2.4.0-dmcrypt.confd dmcrypt
158 + newinitd "${FILESDIR}"/2.4.0-dmcrypt.rc dmcrypt
159 +}
160 +
161 +pkg_postinst() {
162 + tmpfiles_process cryptsetup.conf
163 +}