SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "ghostscript"

# SliTaz package receipt.

PACKAGE="ghostscript"
VERSION="9.55.0"
CATEGORY="office"
SHORT_DESC="Ghostscript tools and utilities."
MAINTAINER="jozee@slitaz.org"
LICENSE="AGPL"
WEB_SITE="https://www.ghostscript.com/"

TARBALL="$PACKAGE-$VERSION.tar.xz"
WGET_URL="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${VERSION//./}/$TARBALL"

DEPENDS="cups expat fontconfig freetype gnutls gtk+ jasper 
    jbig2dec jpeg libgcrypt libgpg-error libpng tiff xorg-libICE 
    xorg-libSM xorg-libX11 xorg-libXau xorg-libXdmcp xorg-libXext 
    xorg-libXt zlib" 
# build depends are optional ; ghostscripts still build but does not compile in cups support
BUILD_DEPENDS="cairo-dev cups-dev expat-dev fontconfig-dev freetype-dev 
    gnutls-dev gtk+-dev jasper-dev jbig2dec jpeg-dev libgcrypt-dev 
    libgpg-error-dev libpng-dev tiff-dev zlib-dev"

# What is the latest version available today?
current_version()
{
    wget -O - https://www.ghostscript.com/releases/index.html 2>/dev/null | \
    sed '/latest release/!d;s|.*script ||;s| .*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    # force it to use system-libs
    rm -rf jpeg libpng zlib jasper expat

    # Patch for CVE-2023-36664
    patch -p1 < $stuff/CVE-2023-36664-1.patch
    patch -p1 < $stuff/CVE-2023-36664-2.patch

    # --disable-compile-inits is needed for linking with system-zlib
    ./configure                                \
        --prefix=/usr                            \
        --infodir=/usr/share/info                    \
        --mandir=/usr/share/man                        \
        --disable-compile-inits                        \
         --enable-cups                            \
         --enable-dynamic                        \
         --enable-gtk                            \
        --with-fontpath="/usr/share/fonts/truetype/:/usr/share/fonts"    \
        --with-system-libtiff                        \
        $CONFIGURE_ARGS &&
    make $MAKEFLAGS &&
    make install soinstall DESTDIR=$DESTDIR
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/share
    mkdir -p $fs/usr/lib

    cp -a $install/usr/bin            $fs/usr
    cp -a $install/usr/lib            $fs/usr
    cp -a $install/usr/share/$PACKAGE    $fs/usr/share

    # if cups-dev installed
    # 9.55.0: not created
#    cp -a $install/usr/share/cups        $fs/usr/share
#    cp -a $install/etc            $fs

    # Remove documentation and examples
    rm -rf                    $fs/usr/share/$PACKAGE/$VERSION/doc
    rm -rf                    $fs/usr/share/$PACKAGE/$VERSION/examples

    # Remove CMAPs (Non-free : not covered under GPL) :
    # moved to non-free package get-ghostscript-CMAP
    rm -rf                    $fs/usr/share/$PACKAGE/$VERSION/Resource/CMap/*

    # already compiled as a shared lib; gsc is same as gs
    rm -rf                    $fs/usr/bin/gs
}

post_install()
{
    ln -sf /usr/bin/gsc            "$1/usr/bin/gs"
}
6047 packages and 209931 files in current database (Wed Jun 26 15:35:30 2024)