PKGNAME=cryptsetup
PKGSEC=utils
PKGDEP="argon2 json-c libpwquality libssh lvm2 openssl popt util-linux"
BUILDDEP="asciidoctor"
PKGDES="Utilities and libraries for handling encrypted disks"

# Note: For all cipher related options, refer to configure --help for defaults.
AUTOTOOLS_AFTER=(
    '--disable-static'
    '--enable-fips'
    '--enable-shared'
    '--enable-fast-install'
    '--enable-libtool-lock'
    '--enable-asciidoc'
    '--enable-keyring'
    '--enable-largefile'
    '--enable-external-tokens'
    '--enable-ssh-token'
    '--enable-luks2-reencryption'
    '--enable-nls'
    '--enable-rpath'
    '--enable-fips'
    '--enable-pwquality'
    '--disable-fuzz-targets'
    '--disable-passwdqc'
    '--disable-static-cryptsetup'
    '--enable-cryptsetup'
    '--enable-veritysetup'
    '--enable-integritysetup'
    '--disable-selinux'
    '--enable-udev'
    '--enable-kernel_crypto'
    '--enable-gcrypt-pbkdf2'
    '--disable-internal-argon2'
    '--enable-libargon2'
    '--disable-internal-sse-argon2'
    '--enable-blkid'
    '--disable-dev-random'
    '--enable-luks-adjust-xts-keysize'
    '--with-crypto_backend=openssl'
    '--with-plain-hash=sha256'
    '--with-plain-cipher=aes'
    '--with-plain-mode=xts-plain64'
    '--with-plain-keybits=256'
    '--with-luks1-hash=sha256'
    '--with-luks1-cipher=aes'
    '--with-luks1-mode=xts-plain64'
    '--with-luks1-keybits=256'
    '--with-luks2-pbkdf=argon2id'
    '--with-luks1-iter-time=2000'
    '--with-luks2-iter-time=2000'
    '--with-luks2-memory-kb=1048576'
    '--with-luks2-parallel-threads=4'
    '--with-luks2-keyslot-cipher=aes-xts-plain64'
    '--with-luks2-keyslot-keybits=512'
    '--with-loopaes-cipher=aes'
    '--with-loopaes-keybits=256'
    '--with-keyfile-size-maxkb=8192'
    '--with-integrity-keyfile-size-maxkb=4'
    '--with-passphrase-size-max=512'
    '--with-verity-hash=sha256'
    '--with-verity-data-block=4096'
    '--with-verity-hash-block=4096'
    '--with-verity-salt-size=32'
    '--with-verity-fec-roots=2'
    '--with-luks2-lock-path=/run/cryptsetup'
    '--with-luks2-lock-dir-perms=0700'
    '--with-luks2-external-tokens-path=/usr/lib/cryptsetup'
    '--with-default-luks-format=LUKS2'
)

PKGBREAK="systemd<=1:238 volume-key<=0.3.9"

# Needed by Afterglow, whereas FAIL_ARCH defaults to mainline-only.
FAIL_ARCH="!(mainline|retro)"
