upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / python-certifi / trunk / PKGBUILD
blob393724e159c6babf9c6b5254cd68a491128e998d
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Maintainer: David Runge <dvzrv@archlinux.org>
3 # Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
4 # Contributor: William J Bowman <bluephoenix47@gmail.com>
6 pkgname=python-certifi
7 pkgver=2022.12.07
8 pkgrel=3
9 pkgdesc="Python package for providing Mozilla's CA Bundle (using system CA store)"
10 arch=(any)
11 url="https://github.com/certifi/python-certifi"
12 license=(MPL2)
13 depends=(ca-certificates python)
14 makedepends=(python-build python-installer python-setuptools python-wheel)
15 checkdepends=(python-pytest)
16 source=(https://github.com/certifi/python-certifi/archive/$pkgver/$pkgname-$pkgver.tar.gz)
17 sha512sums=('4e255c0d5998e98c999464ea27dff61831e97de2c812d7b06feb7ad1038c3070f2e48c58fc939485f5d806d419f0273716442c3c86165b861f0d81f0b3393f6b')
19 prepare() {
20   cd $pkgname-$pkgver
21   # Use system CA store. Replacing the copy in the source tree so the test suite is actually run against it.
22   ln -sf /etc/ssl/certs/ca-certificates.crt certifi/cacert.pem
23   # Our CA store has non-ASCII comments, but we are not packaging for JVM
24   # https://github.com/certifi/python-certifi/issues/50
25   sed -i 's/encoding="ascii"/encoding="utf-8"/' certifi/core.py
28 build() {
29   cd $pkgname-$pkgver
30   python -m build --wheel --no-isolation
33 check() {
34   cd $pkgname-$pkgver
35   pytest
38 package() {
39   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
41   cd $pkgname-$pkgver
42   python -m installer --destdir="$pkgdir" dist/*.whl
44   # Replace CA store here again because the symlink was installed as a file
45   ln -sf /etc/ssl/certs/ca-certificates.crt "$pkgdir"/$site_packages/certifi/cacert.pem
47   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/