# Contributor: Matt Smith # Maintainer: Matt Smith pkgname=py-pygments _pkgname=Pygments pkgver=1.3.1 pkgrel=1 pkgdesc="Pygments is a syntax highlighting package written in Python." url="http://pygments.org/" arch="noarch" license="BSD" depends="python" makedepends="python-dev py-setuptools" install= subpackages="$pkgname-doc" source="http://pypi.python.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" _builddir="$srcdir"/$_pkgname-$pkgver prepare() { cd "$_builddir" # apply patches here } build() { cd "$_builddir" python setup.py build || return 1 } package() { cd "$_builddir" python setup.py install --root "$pkgdir" } doc() { cd "$_builddir" mkdir -p "$subpkgdir"/usr/share/doc/$pkgname for doc in AUTHORS CHANGES LICENSE TODO; do install -Dm644 $doc "$subpkgdir"/usr/share/doc/$pkgname/$doc done install -Dm644 docs/pygmentize.1 "$subpkgdir"/usr/share/man/man1/pygmentize.1 install -Dm644 docs/generate.py "$subpkgdir"/usr/share/doc/$pkgname/generate.py for dir in build src; do mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/$dir cp -R ./docs/$dir/* "$subpkgdir"/usr/share/doc/$pkgname/$dir/ chmod -R 644 "$subpkgdir"/usr/share/doc/$pkgname/$dir/ done # Fix subdir perms find "$subpkgdir"/usr/share/doc/$pkgname/ -type d -exec chmod 755 '{}' \; } md5sums="54be67c04834f13d7e255e1797d629a5 Pygments-1.3.1.tar.gz"