# vim: syn=sh ft=sh et sw=2 sts=2 ts=2 tw=0:
#Packager: Dimitris Tzemos <dijemos~at~gmail~dot~com>

_dlid=4229
pkgname=po4a
pkgver=0.52
pkgrel=1dj
source=(https://alioth.debian.org/frs/download.php/file/${_dlid}/${pkgname}-${pkgver}.tar.gz)
docs=("COPYING" "NEWS" "README" "README.maintainers" "README.tests" "README.translators" "TODO" "changelog")
url="http://po4a.alioth.debian.org/"

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"po4a (PO documentation format converter)"
"po4a (PO for anything) eases translations and their maintenance,"
"allowing gettext's usage on unexpected areas like documentation."
"In po4a each documentation format is handled by a module, that"
"converts this format to/from PO. Formats included in po4a-0.45 are:"
"BibTex, Dia, Halibut, Kernelhelp, LaTeX, Man, POD, SGML, TeX,"
"Texinfo, Text, WML, XHTML, XML."
)

build() {
  cd ${pkgname}-${pkgver}
  perl Build.PL \
  prefix=/usr \
  installdirs=vendor \
  destdir=$PKG
./Build
./Build test
./Build install \
  --install_path bindoc=/usr/man/man1 \
  --install_path libdoc=/usr/man/man3
  
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# All man pages are already gzipped.
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true

find $PKG -depth -type d -empty -delete || true

}
