# Recipe (MakeRecipe) for Foomatic-Filters by Lucas C. Villa Real, on Fri Feb 23 17:22:56 GMT 2007
# Recipe for version 3.0_Devel by Lucas C. Villa Real, on Fri Feb 23 17:22:56 GMT 2007
compile_version=1.8.2
url="http://www.linuxprinting.org/download/foomatic/foomatic-filters-3.0-current.tar.gz"
uncompress=no
dir='foomatic-filters-3.0-current'
recipe_type=configure
part_of=Foomatic

configure_options=(
    --with-execpath=$goboExecutables:$goboShared/cups/filter:$goboLibraries/cups/filter
)

install_variables=(
    LIBDIR=$target/share/foomatic
    PPR_INTERFACES=$target/lib/ppr/interfaces
    PPR_LIB=$target/lib/ppr/lib
    CUPS_BACKENDS=$target/share/cups/backend
    CUPS_FILTERS=$target/share/cups/filter
)

pre_build() {
    # this is the only way to handle tarballs with unstable dirnames after uncompressed
    tar zxf foomatic-filters-3.0-current.tar.gz
    mv foomatic-filters-*/* .
    rmdir * 2> /dev/null
    rm -f foomatic-filters-3.0-current.tar.gz
    
    # let configure find the expected filters
    GrepReplace "LIBSEARCHPATH=.*" \
                "LIBSEARCHPATH=$goboExecutables:$goboShared:$goboLibraries" \
                configure
}

pre_link() {
    mkdir -p $target/Shared/cups/filter
    Quiet pushd $target/Shared/cups/filter
    ln -s $target/bin/foomatic-rip .
    Quiet popd
}
