archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-imagesize / repos / community-any / PKGBUILD
blob25c5aa86a7756f2a9681364fc7e08f6b390ced08
1 # Maintainer: Johannes Löthberg <johannes@kyriasis.com>
2 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
4 pkgname=python-imagesize
5 pkgver=1.4.1
6 pkgrel=4
8 pkgdesc='Analyzes JPEG/JPEG 2000/PNG/GIF/TIFF/SVG/Netpbm/WebP image headers and returns image size or DPI'
9 url='https://github.com/shibukawa/imagesize_py'
10 arch=('any')
11 license=('MIT')
13 depends=('python')
14 makedepends=('python-build' 'python-installer' 'python-setuptools'
15              'python-wheel')
17 source=("https://files.pythonhosted.org/packages/source/i/imagesize/imagesize-$pkgver.tar.gz")
19 sha256sums=('69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a')
21 build() {
22   cd imagesize-$pkgver
23   python -m build --wheel --skip-dependency-check --no-isolation
26 check() {
27   cd imagesize-$pkgver
28   python -m unittest discover -v
31 package() {
32   cd imagesize-$pkgver
33   python -m installer --destdir="$pkgdir" dist/*.whl
35   # Symlink license file
36   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
37   install -d "$pkgdir"/usr/share/licenses/$pkgname
38   ln -s "$site_packages"/imagesize-$pkgver.dist-info/LICENSE.rst \
39     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.rst