summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Martinez2022-08-30 13:40:52 -0500
committerLuis Martinez2022-08-30 13:40:52 -0500
commitee7e9d0da4cdc72bf8c8981e190f56e55bd416ba (patch)
tree8401c3879c2913fbac074f4a3b8e643087d4a6cb
parent764908e8892fe2210e9c9fb6b4f8ef8742a07270 (diff)
downloadaur-ee7e9d0da4cdc72bf8c8981e190f56e55bd416ba.tar.gz
packaging cleanup
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD34
-rw-r--r--setup.py.patch42
3 files changed, 73 insertions, 17 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3dbf7d9c5f6c..19355d9d9929 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,20 @@
pkgbase = pyutil
- pkgdesc = general-purpose python library (used by tahoe-lafs)
+ pkgdesc = General-purpose python library (used by tahoe-lafs)
pkgver = 3.3.0
- pkgrel = 1
- url = https://pypi.python.org/pypi/pyutil
+ pkgrel = 2
+ url = https://pypi.org/project/pyutil
arch = any
license = GPL2
makedepends = python-build
makedepends = python-installer
- makedepends = python-wheel
makedepends = python-setuptools
+ makedepends = python-wheel
depends = python
- source = https://files.pythonhosted.org/packages/source/p/pyutil/pyutil-3.3.0.tar.gz
+ optdepends = python-simplejson: jsonutil support
+ optdepends = python-zbase32: randcookie support
+ source = python-pyutil-3.3.0.tar.gz::https://files.pythonhosted.org/packages/source/p/pyutil/pyutil-3.3.0.tar.gz
+ source = setup.py.patch
sha256sums = 8c4d4bf668c559186389bb9bce99e4b1b871c09ba252a756ccaacd2b8f401848
+ sha256sums = c04d9474203ff677a0a23818d1d78eb7564f51f99dfac4ebf512170b5fdf7004
pkgname = python-pyutil
diff --git a/PKGBUILD b/PKGBUILD
index 080fe9884428..22150446cc09 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,36 @@
-# Maintainer: Nicolas Pouillard <nicolas.pouillard@gmail.com>
+# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
+# Contributor: Nicolas Pouillard <nicolas.pouillard@gmail.com>
# Contributor: Peter Simons <simons@cryp.to>
pkgbase=pyutil
pkgname=python-pyutil
pkgver=3.3.0
-pkgrel=1
-pkgdesc="general-purpose python library (used by tahoe-lafs)"
+pkgrel=2
+pkgdesc="General-purpose python library (used by tahoe-lafs)"
arch=('any')
-url='https://pypi.python.org/pypi/pyutil'
+url='https://pypi.org/project/pyutil'
license=('GPL2')
depends=('python')
-makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
-source=("https://files.pythonhosted.org/packages/source/p/pyutil/pyutil-${pkgver}.tar.gz")
-sha256sums=('8c4d4bf668c559186389bb9bce99e4b1b871c09ba252a756ccaacd2b8f401848')
+optdepends=('python-simplejson: jsonutil support'
+ 'python-zbase32: randcookie support')
+makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
+source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/p/pyutil/pyutil-$pkgver.tar.gz"
+ 'setup.py.patch')
+sha256sums=('8c4d4bf668c559186389bb9bce99e4b1b871c09ba252a756ccaacd2b8f401848'
+ 'c04d9474203ff677a0a23818d1d78eb7564f51f99dfac4ebf512170b5fdf7004')
+
+prepare() {
+ patch -p1 -d "pyutil-$pkgver" < setup.py.patch
+ rm -rf "$pkgbase-$pkgver/$pkgbase/test/"
+ find "$pkgbase-$pkgver" -name '*.pyc' -delete
+}
build() {
- cd "pyutil-$pkgver"
- python -m build --wheel --no-isolation
+ cd "$pkgbase-$pkgver"
+ python -m build --wheel --no-isolation
}
package_python-pyutil() {
- cd "pyutil-$pkgver"
- python -m installer --destdir="$pkgdir" dist/*.whl
- rm -r "$pkgdir/usr/pyutil"
+ cd "$pkgbase-$pkgver"
+ PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir" dist/*.whl
}
diff --git a/setup.py.patch b/setup.py.patch
new file mode 100644
index 000000000000..a14adf52d5e8
--- /dev/null
+++ b/setup.py.patch
@@ -0,0 +1,42 @@
+diff --git a/setup.py b/setup.py
+index 3941549..fbf66b9 100644
+--- a/setup.py
++++ b/setup.py
+@@ -6,7 +6,7 @@
+ #
+ # This file is part of pyutil; see README.rst for licensing terms.
+
+-import os, io, re, sys
++import os
+
+ import versioneer
+
+@@ -35,18 +35,12 @@ trove_classifiers=[
+
+ PKG=u'pyutil'
+
+-doc_fnames=[ u'COPYING.SPL.txt', u'COPYING.GPL', u'COPYING.TGPPL.rst', u'README.rst', u'CREDITS' ]
+-
+-# In case we are building for a .deb with stdeb's sdist_dsc command, we put the
+-# docs in "share/doc/python-$PKG".
+-doc_loc = u"share/doc/" + PKG
+-
+ data_files = [
+- (doc_loc, doc_fnames),
+- (os.path.join(u'pyutil', u'data'), [os.path.join(u'pyutil', u'data', u'wordlist.txt')])
++ (os.path.join(u'share', u'pyutil', u'data'), [os.path.join(u'pyutil', u'data', u'wordlist.txt')])
+ ]
+
+-readmetext = io.open(u'README.rst', encoding='utf-8').read()
++with open('README.rst') as f:
++ readmetext = f.read()
+
+ setup(name=PKG,
+ version=versioneer.get_version(),
+@@ -81,6 +75,5 @@ setup(name=PKG,
+ u'try_decoding = pyutil.scripts.try_decoding:main',
+ u'passphrase = pyutil.scripts.passphrase:main',
+ ] },
+- test_suite=PKG+u".test",
+ zip_safe=False, # I prefer unzipped for easier access.
+ )