# Conditional build:
%bcond_without cups # don't build CUPS plugin
%bcond_without gimp # build GIMP plugin subpackage
-%bcond_with ijs # don't build IJS server for Ghostscript
+%bcond_without ijs # don't build IJS server for Ghostscript
%bcond_without foomatic # don't generate foomatic data
%bcond_without static_libs # don't build static library
#
%define majorver 5.2
Name: gutenprint
Version: %{majorver}.11
-Release: 2
+Release: 3
License: GPL
Group: Applications/Printing
Source0: http://downloads.sourceforge.net/gimp-print/%{name}-%{version}.tar.bz2
Patch0: %{name}-opt.patch
Patch1: %{name}-static.patch
Patch2: %{name}-am.patch
+Patch3: ijs-pkgconfig.patch
URL: http://sourceforge.net/projects/gimp-print/
BuildRequires: autoconf >= 2.53
BuildRequires: automake >= 1:1.9
BuildRequires: docbook-utils
%{?with_foomatic:BuildRequires: foomatic-db-engine >= 3}
BuildRequires: gettext-tools >= 0.16
-%{?with_ijs:BuildRequires: ghostscript-ijs-devel}
+%{?with_ijs:BuildRequires: ghostscript-ijs-devel >= 9.20-2}
%{?with_gimp:BuildRequires: gimp-devel >= 1:2.2.0}
BuildRequires: gtk+2-devel >= 1:2.0.0
BuildRequires: libpng-devel
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
%{__gettextize}
--- /dev/null
+--- gutenprint-5.2.11/configure.ac.orig
++++ gutenprint-5.2.11/configure.ac
+@@ -371,9 +371,9 @@ if test "$BUILD_FOOMATIC_3" = "yes" ; then
+ BUILD_FOOMATIC=yes
+ fi
+
+-AC_PATH_PROG(IJS_CONFIG, ijs-config)
++PKG_CHECK_MODULES([IJS], [ijs], [AC_DEFINE([HAVE_IJS], [1], [Use IJS]) IJS_OK=yes], [IJS_OK=no])
+
+-if test -z "${IJS_CONFIG}" ; then
++if test "x${IJS_OK}" = "xyes"; then
+ BUILD_GHOSTSCRIPT="no"
+ else
+ BUILD_GHOSTSCRIPT="yes"
+@@ -602,11 +602,9 @@ fi
+
+ dnl ijs checks
+ if test x${BUILD_GHOSTSCRIPT} = xyes ; then
+- if test -z "$IJS_CONFIG" ; then
++ if test "$IJS_OK" != yes; then
+ AC_MSG_ERROR(Cannot find ijs-config; please ensure Ghostscript 6.53 or above is installed);
+ fi
+- IJS_CFLAGS=`$IJS_CONFIG --cflags`
+- IJS_LIBS=`$IJS_CONFIG --libs`
+ fi
+
+ GUTENPRINT_RELEASE_VERSION=${GUTENPRINT_MAJOR_VERSION}.${GUTENPRINT_MINOR_VERSION}