# $Id: PKGBUILD 138775 2015-08-26 07:05:31Z spupykin $
# Maintainer (Arch): Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor (Arch): solsTiCe d'Hiver <solstice.dhiver@gmail.com>
# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=lesspipe
pkgver=1.83
pkgrel=2
pkgrel+=.par1
pkgdesc='an input filter for the pager less'
pkgdesc+=', with libarchive recommendation'
depends=('less')
arch=('any')
license=('GPL')
replaces=(${pkgname}-libre)
conflicts=(${pkgname}-libre)
optdepends=('perl'
	    'rpmextract: support for rpm files'
	    'fastjar: support for jar files'
	    'unzip: support for zip files'
	    'libarchive: support for rar files'
	    'p7zip: support for 7za files'
	    'cabextract: support for cab files'
	    'cdrkit: support for iso files'
	    'html2text: support for html files'
	    'antiword: support for word file'
	    'unrtf: support for rtf file'
	    'imagemagick: support for some image file')
url="http://www-zeuthen.desy.de/~friebel/unix/lesspipe.html"
source=("http://downloads.sourceforge.net/project/lesspipe/lesspipe/$pkgver/lesspipe-$pkgver.tar.gz"
	lesspipe.sh)
sha256sums=('d616f0d51852e60fb0d0801eec9c31b10e0acc6fdfdc62ec46ef7bfd60ce675e'
            '522a4893b640ed95e39fd4ca83a5d5ec79207542fec03710fa5e73fe201ed057')

build() {
  cd "$srcdir"/$pkgname-$pkgver
  ./configure --prefix=/usr --yes
  make
}

package() {
  cd "$srcdir"/$pkgname-$pkgver
  mkdir -p "$pkgdir"/usr/share/man/man1
  make install PREFIX="$pkgdir"/usr
  install -D "$srcdir"/lesspipe.sh "$pkgdir"/etc/profile.d/lesspipe.sh
}
