From 5801aea50bd48aeccbb6df5a77771686ae56bf67 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Sun, 21 Aug 2022 02:29:15 +0200 Subject: [PATCH] Add PyPUG package --- python-packaging-doc/PKGBUILD | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 python-packaging-doc/PKGBUILD diff --git a/python-packaging-doc/PKGBUILD b/python-packaging-doc/PKGBUILD new file mode 100644 index 0000000..a342856 --- /dev/null +++ b/python-packaging-doc/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: LEdoian +pkgname=python-packaging-doc-git +# This is just a placeholder, real version is assigned in the pkgver function. +pkgver=0.0.1 +pkgrel=1 +pkgdesc="Python Packaging User Guide (PyPUG, a.k.a. packaging.python.org) for offline use" +arch=('any') +url="https://packaging.python.org" +license=('CC BY-SA 3.0') +groups=() +depends=() +makedepends=('git' 'python-nox') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +replaces=() +backup=() +options=() +source=('python-packaging-doc::git+https://github.com/pypa/packaging.python.org#branch=main') +noextract=() +md5sums=('SKIP') + +pkgver() { + cd "$srcdir/${pkgname%-git}" + printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "$srcdir/${pkgname%-git}" + nox -s build +} + +check() { + cd "$srcdir/${pkgname%-git}" + # We could run `nox -s linkcheck` here, but that takes quite a long time + # and checks also links out, which is not too interesting. Also, since many + # links point to github.com, we get rate-limited. + # Uncomment if you wish. + #nox -s linkcheck +} + +package() { + cd "$srcdir/${pkgname%-git}" + mkdir -p "$pkgdir/usr/share/doc" + cp -r build "$pkgdir/usr/share/doc/${pkgname%-git}" + chmod a+rX "$pkgdir/usr/share/doc/${pkgname%-git}" +}