# $Id: $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=openjpeg
pkgver=1.3
_pkgver=v1_3
pkgrel=3
pkgdesc="An open source JPEG 2000 codec"
arch=(i686 x86_64)
license=('BSD')
url="http://www.openjpeg.org"
depends=('glibc')
source=(http://www.openjpeg.org/openjpeg_${_pkgver}.tar.gz
	30_fix_build_for_debian.dpatch)
md5sums=('f9a3ccfa91ac34b589e9bf7577ce8ff9'
	 '2557f485513e77f6dcea77f4741c4fa1')

build() {
  cd "${srcdir}/OpenJPEG_${_pkgver}"
  patch -Np1 -i "${srcdir}/30_fix_build_for_debian.dpatch" || return 1
  make || return 1
  make DESTDIR="${pkgdir}" install || return 1
  install -m755 -d "${pkgdir}/usr/share/licenses/openjpeg"
  tr '\r' '\n' < license.txt > "${pkgdir}/usr/share/licenses/openjpeg/license.txt" || return 1
  chmod 644 "${pkgdir}/usr/share/licenses/openjpeg/license.txt" || return 1
  ln -s libopenjpeg.so.2 "${pkgdir}/usr/lib/libopenjpeg.so" || return 1
}