summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 16f68141c9c31e9b1605aa89acabc2601d7bcfc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Maintainer: Jakub Klinkovský <lahwaacz at archlinux dot org>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=python-hstspreload
_pkg="${pkgname#python-}"
pkgver=2025.1.1
pkgrel=1
pkgdesc="Chromium HSTS Preload list as a Python package"
arch=(any)
url="https://github.com/sethmlarson/hstspreload"
license=(BSD-3-Clause)
depends=(python)
makedepends=(python-build python-installer python-setuptools python-wheel)
#checkdepends=(python-pytest python-urllib3)
source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/h/$_pkg/$_pkg-$pkgver.tar.gz")
sha256sums=('346552a807b3a1762376de8ecce097544e7fcd64fb64231b4652da52f86fa6f1')

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

# This runs around 230k tests, checking to see if the online list matches the current one.
# It can take 5 minutes just to collect the tests. They're not distributed in the PyPI tarball.
#check() {
#    cd "${srcdir}"/${_pkg}-${pkgver}
#
#    python -m pytest
#}

package() {
    cd $_pkg-$pkgver
    python -m installer --destdir="$pkgdir" dist/*.whl
    local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
    install -vdm 755 "$pkgdir/usr/share/licenses/$pkgname/"
    ln -sv "$_site/$_pkg-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}