aboutsummaryrefslogblamecommitdiffstats
path: root/main/py-sphinx/APKBUILD
blob: 5f9a6e12c69eb5289e4a441aac39031e8a402489 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                     
                                                              
                 
                       
            
        

                                        
             
             
                                                                        
                                                                 
                                                                           

                                                     
                            
                                                                             

                                                                                    
                                                             
                                                                                               
                                    
 
           
                       



                                                                            
                                                     


            
         

                                                       
                                      
            

 






                                                       
           


                                                                   
                                                                   
            



                           
                              



                   
                              




                         
                              



                                                      
                              
                                                                  


                                                          
                                         
            

 
                                                                                                                                                                  
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-sphinx
_pkgname=${pkgname#py-}
pkgver=1.8.3
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 py-sphinxcontrib-websupport py-setuptools py-packaging"
_py2depends="make ${_pydepends//py-/py2-} py2-typing"
_py3depends="make ${_pydepends//py-/py3-}"
depends="py3-${pkgname#py-}"
makedepends="python2-dev python3-dev py-setuptools $_py2depends $_py3depends"
#checkdepends="pytest py-funcsigs py-pluggy"
options="!check" # py-pluggy and some other packages needs to be moved to main first
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="$_pkgname-$pkgver.tar.gz::https://github.com/sphinx-doc/sphinx/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare

	# 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"
	done
}

build() {
	local python; for python in python2 python3; do
		cd "$builddir"-$python
		$python setup.py build
	done
}

#check() {
#	local python; for python in python2 python3; do
#		cd "$builddir"-$python
#		make PYTHON=$python test
#	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
	done
}

_py2() {
	replaces="$pkgname"
	depends="$_py2depends"
	_py python2
}

_py3() {
	depends="$_py3depends"
	_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"

	# Add version suffix to executable files.
	local path; for path in "$subpkgdir"/usr/bin/*; do
		mv "$path" "$path-$pyver"
	done
}

sha512sums="48c9bda10907db239dea01b1a6b47dad3d1f6c4f97ec4ca2447ca977460c16c4b662f32fcfcaea112bdacd0ce81337ae2144b716bcc595fe6651cad3e09bcab1  sphinx-1.8.3.tar.gz"