NAME="libpng"
DESC="Libraries for Reading and writing PNG files"
VERSION="1.6.40"
FILES=(
  "https://downloads.sourceforge.net/libpng/libpng-$VERSION.tar.xz"
  "https://downloads.sourceforge.net/sourceforge/libpng-apng/libpng-1.6.39-apng.patch.gz"
)
HASHES=(
  "6c7fe9dbb80c89c3579bedad9722e559"
  "cd63b667723d6cc75e95eca3224f33f7"
)
DEPENDS=()

PACKAGE() {
  tar xf $NAME-$VERSION.tar.xz
  cd $NAME-$VERSION

  gzip -cd ../libpng-1.6.39-apng.patch.gz | patch -p1
  ./configure --prefix=/usr --disable-static
  make && make DESTDIR=$ROOTDIR install

  mkdir -pv $ROOTDIR/usr/share/doc/libpng-$VERSION
  cp -v README libpng-manual.txt $ROOTDIR/usr/share/doc/libpng-$VERSION

  cd .. && rm -rf $NAME-$VERSION
}
