NAME="cdrtools"
DESC="CD recording utilities, useful for reading, creating or writing (burning) CDs, DVDs, and Blu-ray discs"
VERSION="3.02a09"
FILES=("https://downloads.sourceforge.net/cdrtools/cdrtools-$VERSION.tar.bz2")
HASHES=("1e224a6adbbe4ad40047b9fddbb0e60c")
DEPENDS=()

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

  sed -i 's|/opt/schily|/usr|g' DEFAULTS/Defaults.linux
  sed -i 's|DEFINSGRP=.*|DEFINSGRP=root|' DEFAULTS/Defaults.linux
  sed -i 's|INSDIR=.*|INSDIR=bin|' rscsi/Makefile
	rm -rfv cdda2wav # this is broken

  export GMAKE_NOWARN=true
  make INS_BASE=/usr INS_RBASE=/ LDOPTX="$LDFLAGS"
	make INS_BASE=/usr INS_RBASE=/ DESTDIR="$ROOTDIR" install

	install -v -m755 -d $ROOTDIR/usr/share/doc/cdrtools-$VERSION
	install -v -m644 README.* READMEs/* ABOUT doc/*.ps \
                    $ROOTDIR/usr/share/doc/cdrtools-$VERSION

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