# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Anton Bazhenov <anton.bazhenov at gmail>
# Contributor: HuntXu <huntxu@live.cn>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=pngcrush
pkgver=1.7.87
pkgrel=1
pkgdesc="A tool for optimizing the compression of PNG files"
url="http://pmt.sourceforge.net/pngcrush"
arch=('i686' 'x86_64')
license=('custom')
depends=('libpng')
source=(http://downloads.sourceforge.net/pmt/${pkgname}-${pkgver}-nolib.tar.xz
        LICENSE)
sha512sums=('573224d787daebc1fbd2ab0ee64d46bd96a15f02a32fd21b64de4acf791a145f7fb88e23e99e729fa564869976ae7412fc7bb9549760b56c2aa5bb9714db2ed5'
            'f18613b9da9b4f31a317411e726def5122246087ff57887fba6b46f0a7a7fae7109388ecb2ce049bbe992cc6ef0a3fbbe0f5c5bc816705efd7583836cbd4e69d')

prepare() {
  cd ${pkgname}-${pkgver}-nolib
  sed -r "s/^(CFLAGS = .*)$/\\1 ${CFLAGS}/" -i Makefile
  sed -r "s/^(LDFLAGS =*)$/\\1 ${LDFLAGS}/" -i Makefile
}

build() {
  cd ${pkgname}-${pkgver}-nolib
  make
}

package() {
  cd ${pkgname}-${pkgver}-nolib
  make DESTDIR="${pkgdir}" install
  install -Dm 644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set ts=2 sw=2 et:
