# $Id$ PNAME="ghostscript-gpl" PVER="8.70" PBUILD="r1" PCATEGORIE="app-text" STATE="unstable" DESCRIPTION="GPL Ghostscript - the most current Ghostscript, AFPL, relicensed." HOMEPAGE="http://ghostscript.com/" DEPEND=">= media-libs/libjpeg-7 >= media-libs/libpng-1.2 >= media-libs/libtiff-3.9 >= sys-libs/zlib-1.2 >= x11-libs/gtk2+-2.18 >= x11-libs/libXt-1 >= x11-libs/libXext-1 >= media-libs/fontconfig-2 >= app-text/libpaper-1.1.23 >= x11-libs/cairo-1.8" SDEPEND=">= net-print/cups-1.4 >= dev-util/pkgconfig-0.23" SRCFILE="${PNAME/-gpl/}-${PVER}.tar.bz2" EXTRA_SRCFILE="ghostscript-fonts-std-8.11.tar.gz" SRCDIR="${BUILDDIR}/${PNAME/-gpl/}-${PVER}" sminclude mtools SRC_URI=( sourceforge://${PNAME/-gpl/}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${EXTRA_SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-multilib.patch mirror://${PNAME}/${PNAME}-${PVER}-scripts.patch mirror://${PNAME}/${PNAME}-${PVER}-noopt.patch mirror://${PNAME}/${PNAME}-${PVER}-fpic.patch mirror://${PNAME}/${PNAME}-${PVER}-runlibfileifexists.patch mirror://${PNAME}/${PNAME}-${PVER}-system-jasper.patch mirror://${PNAME}/${PNAME}-${PVER}-pksmraw.patch mirror://${PNAME}/${PNAME}-${PVER}-jbig2dec-nullderef.patch mirror://${PNAME}/${PNAME}-${PVER}-respect-gsc-ldflags.patch ) UP2DATE="updatecmd_sourceforge ${PNAME/-gpl/}" src_prepare() { munpack ${SRCFILE} || die munpack ${EXTRA_SRCFILE} || die cd ${SRCDIR} # remove internal copies of expat, jasper, jpeg, libpng and zlib rm -r expat || die rm -r jasper || die rm -r jpeg || die rm -r libpng || die rm -r zlib || die # remove internal urw-fonts rm -r Resource/Font || die # apply several fedora patches mpatch ${PNAME}-${PVER}-multilib.patch || die mpatch ${PNAME}-${PVER}-scripts.patch || die mpatch ${PNAME}-${PVER}-noopt.patch || die mpatch ${PNAME}-${PVER}-fpic.patch || die mpatch ${PNAME}-${PVER}-runlibfileifexists.patch || die mpatch ${PNAME}-${PVER}-system-jasper.patch || die mpatch ${PNAME}-${PVER}-pksmraw.patch || die mpatch ${PNAME}-${PVER}-jbig2dec-nullderef.patch || die # respect LDFLAGS patch from gentoo mpatch ${PNAME}-${PVER}-respect-gsc-ldflags.patch || die # search path fix sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/${PVER%.*}/$(mlibdir):" \ -e 's:$(gsdir)/fonts:/usr/share/ghostscript/fonts:' \ base/Makefile.in base/*.mak || die # fix doc pathes sed -i -e "s:exdir=.*:exdir=/usr/share/doc/${PNAME}-${PVER}/examples:" \ -e "s:docdir=.*:docdir=/usr/share/doc/${PNAME}-${PVER}/html:" \ -e "s:GS_DOCDIR=.*:GS_DOCDIR=/usr/share/doc/${PNAME}-${PVER}/html:" \ base/Makefile.in base/*.mak || die # fix libtool issues mlibtoolize || die # regen makefiles autoreconf --install --force --verbose || die cd ${SRCDIR}/ijs # fix libtool issues mlibtoolize || die autoreconf --install --force --verbose || die } src_compile() { cd ${SRCDIR} mconfigure \ --with-ijs \ --with-jbig2dec \ --with-omni \ --without-gimp-print \ --with-x \ --with-drivers=ALL \ --with-libpaper \ --enable-fontconfig \ --enable-cups \ --enable-dynamic \ --enable-gtk \ --enable-cairo \ --disable-jasper \ --disable-compile-inits \ || die # does not like optimations mmake -j1 so all || die # compile ijs cd ${SRCDIR}/ijs mconfigure || die mmake -j1 || die } src_install() { cd ${SRCDIR} # needed directories minstalldir /usr/bin || die minstalldir /usr/include || die minstalldir /usr/$(mlibdir) || die mmake -j1 DESTDIR=${BINDIR} install || die mmake -j1 DESTDIR=${BINDIR} soinstall || die # install extra_fonts minstalldir /usr/share/ghostscript || die cp -a ${BUILDDIR}/fonts ${BINDIR}/usr/share/ghostscript || die # install ijs cd ${SRCDIR}/ijs mmake DESTDIR=${BINDIR} install || die # docs cd ${SRCDIR} minstalldocs LICENSE doc/{AUTHORS,COPYING,README} || die # cleanup rm -r ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/html/README || die }