mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-07 17:52:10 +01:00
74 lines
2.1 KiB
Plaintext
74 lines
2.1 KiB
Plaintext
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
|
|
# Maintainer: Matt Smith <mcs@darkregion.net>
|
|
pkgname=py-sphinx
|
|
_pkgname=${pkgname#py-}
|
|
pkgver=1.5.2
|
|
pkgrel=0
|
|
pkgdesc="Python Documentation Generator"
|
|
url="http://sphinx.pocoo.org/"
|
|
arch="noarch"
|
|
license="BSD"
|
|
_pydepends="py-docutils py-jinja2 py-pygments py-six py-sphinx_rtd_theme
|
|
py-alabaster<0.8 py-babel py-snowballstemmer py-imagesize py-requests"
|
|
depends="py3-${pkgname#py-}"
|
|
makedepends="python2-dev python3-dev py-setuptools"
|
|
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
|
|
source="$_pkgname-$pkgver.tar.gz::https://github.com/sphinx-doc/sphinx/archive/$pkgver.tar.gz"
|
|
builddir="$srcdir/$_pkgname-$pkgver"
|
|
|
|
prepare() {
|
|
default_prepare || return 1
|
|
|
|
# Soure files are modified during build with 2to3 tool, so we cannot
|
|
# build it for both Python versions in the same location.
|
|
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"/usr/bin
|
|
|
|
local name; for name in apidoc autogen build quickstart; do
|
|
ln -s sphinx-$name-3 "$pkgdir"/usr/bin/sphinx-$name || return 1
|
|
done
|
|
}
|
|
|
|
_py2() {
|
|
replaces="$pkgname"
|
|
depends="make ${_pydepends//py-/py2-}"
|
|
_py python2
|
|
}
|
|
|
|
_py3() {
|
|
depends="make ${_pydepends//py-/py3-}"
|
|
_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" || return 1
|
|
|
|
# Add version suffix to executable files.
|
|
local path; for path in "$subpkgdir"/usr/bin/*; do
|
|
mv "$path" "$path-$pyver" || return 1
|
|
done
|
|
}
|
|
|
|
md5sums="7c0f765e4216a8e8437c95224a01da8b sphinx-1.5.2.tar.gz"
|
|
sha256sums="21af24ad4b65d1b8714669b53e1694c70698578546e86360d3601b0f0c3c57ee sphinx-1.5.2.tar.gz"
|
|
sha512sums="cc47890d0513cc5ac1f816ad17979ef577243f9f47747aa9c06166fde53b3c6c715a0035041a4aaf54f1f3849ffc7c0e81f6aab9ec4ea471ce09e51c03a3892d sphinx-1.5.2.tar.gz"
|