mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-30 22:01:42 +01:00
91 lines
2.4 KiB
Plaintext
91 lines
2.4 KiB
Plaintext
# Contributor: Matt Smith <mcs@darkregion.net>
|
|
# Maintainer: Matt Smith <mcs@darkregion.net>
|
|
pkgname=py-docutils
|
|
_pkgname=docutils
|
|
pkgver=0.12
|
|
pkgrel=3
|
|
pkgdesc="Documentation Utilities for Python"
|
|
url="http://docutils.sourceforge.net/"
|
|
arch="noarch"
|
|
license="Public Domain"
|
|
depends="py3-${pkgname#py-}"
|
|
makedepends="python2-dev python3-dev py-setuptools"
|
|
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc::noarch"
|
|
source="http://downloads.sourceforge.net/$_pkgname/$_pkgname-$pkgver.tar.gz"
|
|
builddir="$srcdir/$_pkgname-$pkgver"
|
|
|
|
prepare() {
|
|
default_prepare || return 1
|
|
|
|
# Soure files are modified during build with 2to3 tool, so we must build
|
|
# it separately for each Python version.
|
|
local python; for python in python2 python3; do
|
|
cp -r "$builddir" "$builddir-$python" || return 1
|
|
done
|
|
}
|
|
|
|
build() {
|
|
local python; for python in python2 python3; do
|
|
cd "$builddir"-$python
|
|
$python setup.py build || return 1
|
|
done
|
|
}
|
|
|
|
package() {
|
|
mkdir -p "$pkgdir"
|
|
|
|
# Create unsuffixed symlinks for executables from py3 subpackage.
|
|
cd "$builddir"/tools
|
|
mkdir -p "$pkgdir"/usr/bin
|
|
local name; for name in rst*.py; do
|
|
ln -s ${name%.py}-3 "$pkgdir"/usr/bin/${name%.py}
|
|
done
|
|
}
|
|
|
|
_py2() {
|
|
replaces="$pkgname"
|
|
depends="py2-pillow py2-roman"
|
|
_py python2
|
|
}
|
|
|
|
_py3() {
|
|
depends="py3-pillow py3-roman"
|
|
_py python3
|
|
}
|
|
|
|
_py() {
|
|
local python="$1"
|
|
local pyver="${1:6:1}"
|
|
pkgdesc="$pkgdesc (for $python)"
|
|
depends="$depends $python"
|
|
install_if="$pkgname=$pkgver-r$pkgrel $python"
|
|
|
|
cd "$builddir"-$python
|
|
$python setup.py install --prefix=/usr --root="$subpkgdir"
|
|
|
|
# Remove .py extension and add version suffix to executable files.
|
|
local path; for path in "$subpkgdir"/usr/bin/*.py; do
|
|
mv "$path" "${path/.py/-$pyver}" || return 1
|
|
done
|
|
}
|
|
|
|
doc() {
|
|
pkgdesc="$pkgdesc (documentation)"
|
|
local docdir="$subpkgdir/usr/share/doc/$pkgname"
|
|
local licdir="$subpkgdir/usr/share/licenses/$pkgname"
|
|
|
|
cd "$builddir"
|
|
|
|
mkdir -p "$docdir"
|
|
cp -R docs/* "$docdir"/ || return 1
|
|
cp *.txt "$docdir"/ || return 1
|
|
|
|
mkdir -p "$licdir"
|
|
rm -f licenses/docutils.conf
|
|
cp licenses/* "$licdir"/
|
|
}
|
|
|
|
md5sums="4622263b62c5c771c03502afa3157768 docutils-0.12.tar.gz"
|
|
sha256sums="c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa docutils-0.12.tar.gz"
|
|
sha512sums="0087433f8b76e1d0302d2fab77fdbda941132d16ac1fcecb26ca66119687eefd9e2f6901e05d705f857fa31e2526136c9827dfd57c44cd295bd10dcce3faebf9 docutils-0.12.tar.gz"
|