Username: Password: Remember me
# Maintainer: Michael Haesel <michael[dot]haesel[at]gmail[dot]com>
# Contributor: Neo Kolokotronis <tetris4@gmail.com>
 
pkgname=a2ps
pkgver=4.14
pkgrel=4
pkgdesc="a2ps is an Any to PostScript filter"
arch=('x86_64')
url="http://www.gnu.org/software/a2ps/"
license=('GPL3')
depends=('ghostscript' 'psutils' 'imagemagick')
makedepends=('gperf')
backup=('etc/a2ps/a2ps.cfg' 'etc/a2ps/a2ps-site.cfg')
options=('!libtool')
install=${pkgname}.install
source=("ftp://ftp.gnu.org/gnu/a2ps/${pkgname}-${pkgver}.tar.gz"
        "a2ps-4.13c-fnmatch-replacement.patch"
        "a2ps-4.13c-emacs.patch"
        "a2ps-4.13-manpage-chmod.patch"
        "a2ps-4.14-check-mempcpy.patch"
        "a2ps-4.14-fix-stpcpy-proto.patch"
        "a2ps-texinfo5.patch")
sha256sums=('f3ae8d3d4564a41b6e2a21f237d2f2b104f48108591e8b83497500182a3ab3a4'
            'fe5fab61eb3897d05208cadd627d65f65cf5910266a6770f5dbec898740b512d'
            '52b2775e6d15165c365faa1e92d85c2926e4df724f6101bc0973d2b07a31d5b9'
            'abc519cf6f39ca7740e235935ec66ef2f346948d14a80ceee8651890ab2c6e5a'
            'cc3859e486d381c31fee6ef44d98c3e1c6b7179232b745bb1bfe38a155fd6ca3'
            'c5b8498ca548a1ca3409d29594b43aeedfa690700043e726d787aefefcbf2886'
            '0c8e9307f59e1b69f6d77ee184ba4e797e93aee16ed3a482d5f80716f8d7fc54')
 
prepare() {
  cd ${pkgname}-${pkgver}
 
  sed -i -e '/^AM_C_PROTOTYPES/d' -e '/^AUTOMAKE_OPTIONS.*ansi2knr/d' \
    -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
    configure.in {contrib/sample,lib,src}/Makefile.am m4/protos.m4
  sed -i "s:^countdictstack: \0:" contrib/psset.in
  patch -p1 -i "${srcdir}/a2ps-4.13c-fnmatch-replacement.patch"
  patch -p1 -i "${srcdir}/a2ps-4.13c-emacs.patch"
  patch -p1 -i "${srcdir}/a2ps-4.13-manpage-chmod.patch"
  patch -p1 -i "${srcdir}/a2ps-4.14-check-mempcpy.patch"
  patch -p0 -i "${srcdir}/a2ps-4.14-fix-stpcpy-proto.patch"
  patch -p1 -i "${srcdir}/a2ps-texinfo5.patch"
}
 
build() {
  cd ${pkgname}-${pkgver}
 
  libtoolize --force --copy
  autoreconf --force --install -I m4
  ./configure --prefix=/usr \
              --sysconfdir=/etc/a2ps \
              --includedir=/usr/include \
              --enable-nls
  make
}
 
package() {
  cd ${pkgname}-${pkgver}
 
  make DESTDIR=${pkgdir} install
}