# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Dmitry Romanenko <dmitry@romanenko.in>
maintainer="fossdd <fossdd@pwned.life>"
pkgname=py3-certifi
pkgver=2025.4.26
pkgrel=0
pkgdesc="Python3 package for providing Mozilla's CA Bundle"
url="https://pypi.org/project/certifi"
arch="noarch"
license="MPL-2.0"
depends="ca-certificates-bundle"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/c/certifi/certifi-$pkgver.tar.gz
	use-alpine-system-certs.patch
	"
builddir="$srcdir/certifi-$pkgver"
options="!check" # no tests

replaces="py-certifi" # Backwards compatibility
provides="py-certifi=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	# Remove bundled certificates, we use system certificates
	rm -f "$pkgdir"/usr/lib/python3*/site-packages/certifi/cacert.pem
}

sha512sums="
905ad0bb54c7662281e8def04f0895c46567290690f2520ac068db0c35f2f036bca0164cd21eca85cf5c34943ab3308c68b627da1c3258d9b1f738e5de6bdd23  certifi-2025.4.26.tar.gz
1002ff4648c79ced36c27dde110415091685d0a73f346068b38f0110a3439ce01a5db94121a709bda4b91c1a6d1d760c69f7e304aec27690cfe28ca5be725796  use-alpine-system-certs.patch
"
