# Maintainer: Matthias Schabhuettl <aur@schabhuettl.net>

pkgname=openconnect-saml
pkgver=0.8.1
pkgrel=1
pkgdesc="OpenConnect wrapper with Azure AD / SAML SSO support"
arch=('any')
url="https://github.com/mschabhuettl/openconnect-saml"
license=('MIT')
depends=('python' 'openconnect' 'python-keyring' 'python-lxml' 'python-pyotp'
         'python-requests' 'python-structlog' 'python-toml' 'python-xdg'
         'python-attrs' 'python-prompt_toolkit')
optdepends=('python-pyqt6: GUI browser backend'
            'python-playwright: Chrome browser backend'
            'python-fido2: FIDO2/YubiKey support'
            'python-rich: status TUI'
            'iptables: kill-switch feature'
            'bitwarden-cli: Bitwarden TOTP provider'
            '1password-cli: 1Password TOTP provider'
            'pass: pass-otp TOTP provider'
            'pass-otp: pass-otp extension for TOTP')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("https://github.com/mschabhuettl/openconnect-saml/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('SKIP')

build() {
    cd "$pkgname-$pkgver"
    python -m build --wheel --no-isolation
}

package() {
    cd "$pkgname-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
