# vim: syn=sh ft=sh et sw=2 sts=2 ts=2 tw=0:
#Packager: Cyrille Pontvieux <jrd~at~enialis~dot~net>

pkgname=Pygments
pkgver=1.6
pkgrel=1cp

source=(http://pypi.python.org/packages/source/P/${pkgname}/${pkgname}-${pkgver}.tar.gz)
sourcetemplate=http://people.salixos.org/jrd/salix/$pkgname/$pkgver-\$arch-$pkgrel/
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "license" "changes")
url=http://pygments.org

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (syntax highlighting package written in Python)"
"It is a generic syntax highlighter for general use in all kinds of"
"software such as forum systems, wikis or other applications that need"
"to prettify source code."
"Highlights are:"
" * A wide range of common languages and markup formats is supported."
" * Special attention is paid to details, increasing quality."
" * Support for new languages and formats are added easily."
" * output formats: HTML, LaTeX, RTF, SVG and ANSI sequences."
" * It is usable as a command-line tool and as a library."
)

build() {
  cd $SRC/$pkgname-$pkgver || return 1
  python setup.py install --prefix=/usr --root=$PKG || return 1
  mkdir -p $PKG/usr/doc/$pkgname-$pkgver || return 1
  cp docs/build/*.html $PKG/usr/doc/$pkgname-$pkgver/ || return 1
  mkdir -p $PKG/usr/man/man1 || return 1
  # Adapting to Slackware's directory layout
  sed "s,share/doc/python-pygments,doc/$pkgname-$pkgver," docs/pygmentize.1 > $PKG/usr/man/man1/pygmentize.1 || return 1
}