NAME="libmpeg2"
DESC="Library for decoding MPEG-2 and MPEG-1 video streams"
VERSION="0.5.1"
FILES=("https://libmpeg2.sourceforge.net/files/libmpeg2-$VERSION.tar.gz")
HASHES=("0f92c7454e58379b4a5a378485bbd8ef")
DEPENDS=("sdl12-compat")

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

  sed -i 's/static const/static/' libmpeg2/idct_mmx.c
  ./configure --prefix=/usr  \
            --enable-shared  \
            --disable-static
  make && make DESTDIR="$ROOTDIR" install
  install -v -m755 -d "$ROOTDIR/usr/share/doc/libmpeg2-$VERSION"
  install -v -m644 README doc/libmpeg2.txt \
                    "$ROOTDIR/usr/share/doc/libmpeg2-$VERSION"

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