# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Patrick McCarty <pnorcks at gmail dot com>
# Contributor: Fernando Munoz <f[at]beford.net>
# Contributor: Alexandre Bique <bique.alexandre[at]gmail.com>

pkgbase=isomd5sum
pkgname=('isomd5sum' 'python2-isomd5sum')
pkgver=1.0.12
pkgrel=2
arch=('i686' 'x86_64')
license=('GPL')
makedepends=('popt' 'python2')
url='https://git.fedorahosted.org/git/isomd5sum.git'
source=("https://git.fedorahosted.org/cgit/isomd5sum.git/snapshot/isomd5sum-$pkgver.tar.xz")
options=('!emptydirs')
sha1sums=('db46d6f6f8b197dfc1712adc4e878cda192be1a2')

prepare() {
  cd "$pkgbase-$pkgver"
  sed -i -e 's/shell python /shell python2 /' Makefile
  sed -i -e 's/-Werror/ /' Makefile
  sed -i -e 's/^\(LIBDIR = \)lib64/\1lib/' Makefile
}

build() {
  cd "$pkgbase-$pkgver"
  make all
}

package_isomd5sum() {
  depends=('popt')
  pkgdesc="Utilities for working with md5sum implanted in ISO images"

  cd "$pkgname-$pkgver"
  make DESTDIR="${pkgdir}" install-bin install-devel
}

package_python2-isomd5sum() {
  depends=('python2')
  pkgdesc="Python2 bindings for isomd5sum"

  cd "$pkgbase-$pkgver"
  make DESTDIR="${pkgdir}" install-python
}
