summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO14
-rw-r--r--LICENSE21
-rw-r--r--PKGBUILD55
3 files changed, 72 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2fd4b430876d..848544893f0f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,22 @@
pkgbase = python-txsni
pkgdesc = Simple support for running a TLS server with Twisted
pkgver = 0.2.0
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/glyph/txsni
arch = any
license = MIT
+ checkdepends = python-pytest
makedepends = python-setuptools
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-wheel
+ depends = python-idna
depends = python-pyopenssl
+ depends = python-service-identity
depends = python-twisted
- source = https://github.com/glyph/txsni/archive/v0.2.0.tar.gz
- sha512sums = c03d2a3b3527954371ec6878a952490816c8bbbad3181b14d4d1586410e1dd9a7c4e8074f3e11ad6a19b5963e36ec3e797ef6dd7556bfdf0b4c62161ed16e829
+ source = python-txsni-0.2.0.tar.gz::https://files.pythonhosted.org/packages/source/t/txsni/TxSNI-0.2.0.tar.gz
+ source = LICENSE
+ sha256sums = bf16d221c84bf222434fde9d1f75329149bf6bf9da049855bddffbff2b7886e1
+ sha256sums = 2a41b4da4e95c95c4a9c09f87652f67cb92d7072316cc12fc16db1773976e5e3
pkgname = python-txsni
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..82445567153d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/PKGBUILD b/PKGBUILD
index 8aa6ef0903b9..bf134afed328 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,49 @@
+# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: pfm <vorticity at mail dot ru>
-_base=txsni
-pkgname=python-${_base}
+
+## python-twisted[tls] requires the following dependencies
+## * python-pyopenssl
+## * python-idna
+## * python-service-identity
+
+pkgname=python-txsni
pkgver=0.2.0
-pkgrel=3
+pkgrel=4
pkgdesc="Simple support for running a TLS server with Twisted"
-arch=(any)
-url="https://github.com/glyph/${_base}"
-license=(MIT)
-depends=(python-pyopenssl python-twisted)
-makedepends=(python-setuptools)
-source=(${url}/archive/v${pkgver}.tar.gz)
-sha512sums=('c03d2a3b3527954371ec6878a952490816c8bbbad3181b14d4d1586410e1dd9a7c4e8074f3e11ad6a19b5963e36ec3e797ef6dd7556bfdf0b4c62161ed16e829')
+arch=('any')
+url="https://github.com/glyph/txsni"
+license=('MIT')
+depends=(
+ 'python-idna'
+ 'python-pyopenssl'
+ 'python-service-identity'
+ 'python-twisted')
+makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
+checkdepends=('python-pytest')
+source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/t/txsni/TxSNI-$pkgver.tar.gz"
+ 'LICENSE')
+sha256sums=('bf16d221c84bf222434fde9d1f75329149bf6bf9da049855bddffbff2b7886e1'
+ '2a41b4da4e95c95c4a9c09f87652f67cb92d7072316cc12fc16db1773976e5e3')
+
+prepare() {
+ cd "TxSNI-$pkgver"
+ sed -i '/txsni.test/d' setup.py
+}
build() {
- cd ${_base}-${pkgver}
- python setup.py build
+ cd "TxSNI-$pkgver"
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd "TxSNI-$pkgver"
+ pytest -x --disable-warnings
}
package() {
- cd ${_base}-${pkgver}
- PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
- install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ export PYTHONHASHSEED=0
+ cd "TxSNI-$pkgver"
+ python -m installer --destdir="$pkgdir/" dist/*.whl
+ install -Dm644 "$srcdir/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
+ install -Dm644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}