# Con://github.com/saltstack/salttributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=xmltv
pkgver=0.5.69
pkgrel=0
pkgdesc="Set of utilities to download tv listings and format them in xml"
url="http://xmltv.org/wiki"
arch="noarch"
license="GPL2"
depends="perl-libwww perl-xml-parser perl-xml-twig perl-date-manip perl-xml-writer
	perl-timedate perl-unicode-string perl-term-readkey perl-file-slurp perl-xml-libxml
	perl-lingua-en-numbers-ordinate perl-lingua-preferred perl-compress-raw-zlib perl-io-gzip
	perl-io-compress perl-term-progressbar perl-xml-treepp"
depends_dev=""
makedepends="$depends_dev perl-dev"
install=""
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/xmltv/xmltv-$pkgver.tar.bz2"

_builddir="$srcdir"/xmltv-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	PERL_MM_USE_DEFAULT=1 yes | perl Makefile.PL INSTALLDIRS=vendor || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="b76991bdcf2803f67c0c24b52d44b62ebfc37f177dbfb31a781fefe420ee5a575b522ed6a6669fa9f0462ac866abd382a1b3fe2cf91d3bfab1758f95facd333c  xmltv-0.5.69.tar.bz2"