#Packager: Dimitris Tzemos <dijemos~at~gmail~dot~com>

pkgname=perl-text-wrapi18n
_realname=Text-WrapI18N
pkgver=0.06
pkgrel=1dj
source=("http://search.cpan.org/CPAN/authors/id/K/KU/KUBOTA/${_realname}-${pkgver}.tar.gz")
docs=("ARTISTIC" "Changes" "Changes.REL1" "GPL" "README" "Todo.REL1")
url="http://search.cpan.org/dist/${_realname}/"

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"perl-Text-WrapI18N (line wrapping module)"
"Text::WrapI18N - Line wrapping module with support for multibyte,"
"fullwidth, and combining characters and languages without whitespaces"
"between words."
"This module intends to be a better Text::Wrap module. It is needed to"
"support multibyte character encodings such as UTF-8, EUC-JP, EUC-KR,"
"GB2312, and Big5."
"The text is to be given in locale encoding, not always in UTF-8."
"(Of course locale encoding is UTF-8 in UTF-8 locales.)"
)


build() {
	cd $SRC/${_realname}-$pkgver
   perl Makefile.PL \
  PREFIX=/usr \
  INSTALLDIRS=vendor \
  INSTALLVENDORMAN3DIR=/usr/man/man3
make
make test
make install DESTDIR=$PKG

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

find $PKG/usr/man -type f -exec gzip -9 {} \;
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


} 
