diff --git a/cups-genppdupdate.py.in b/cups-genppdupdate.py.in old mode 100644 new mode 100755 index d65e618..22d4f82 --- a/cups-genppdupdate.py.in +++ b/cups-genppdupdate.py.in @@ -255,6 +255,23 @@ def parse_options(): return args +def check_encoding(filename): + import charset_normalizer + + with open(filename, 'rb') as f: + charenc = charset_normalizer.detect(f.read())['encoding'] + + if debug & 1: + print("File encoding: {}".format(charenc)) + + if charenc in ['ascii', 'utf-8']: + return 'utf-8' + else: + if debug & 1: + print("Trying to use latin1 for decoding {}".format(charenc)) + + return 'latin1' + def update_ppd (ppd_source_filename): global ppd_dest_filename global ppd_out_dir @@ -271,7 +288,8 @@ def update_ppd (ppd_source_filename): ppd_dest_filename = "%s/%s" % (ppd_out_dir, os.path.basename (ppd_dest_filename)) - orig = open (ppd_source_filename, encoding="utf-8") + fenc = check_encoding(ppd_source_filename) + orig = open(ppd_source_filename, encoding=fenc) orig_metadata = os.fstat (orig.fileno ()) if debug & 1: print ("Source Filename: %s" % ppd_source_filename) @@ -284,7 +302,17 @@ def update_ppd (ppd_source_filename): region = "" valid = 0 orig_locale = "" - for line in orig.readlines (): + + try: + orig_lines = orig.readlines() + except UnicodeDecodeError: + if debug & 1: + print('PPD {} has an unexpected enconding, ' + 'skipping.'.format(ppd_source_filename)) + + return -1 + + for line in orig_lines: line.rstrip () if line.find ("*StpLocale:") != -1: match = re.search ("\*StpLocale:\s*\"(.*)\"$", line) diff --git a/gutenprint-5.2.14.tar.bz2 b/gutenprint-5.2.14.tar.bz2 deleted file mode 100644 index ac4517e..0000000 Binary files a/gutenprint-5.2.14.tar.bz2 and /dev/null differ diff --git a/gutenprint-5.3.4.tar.bz2 b/gutenprint-5.3.4.tar.bz2 new file mode 100644 index 0000000..552a087 Binary files /dev/null and b/gutenprint-5.3.4.tar.bz2 differ diff --git a/gutenprint-Add-Epson-Expression-ET-2600-EcoTank.patch b/gutenprint-Add-Epson-Expression-ET-2600-EcoTank.patch deleted file mode 100644 index 2dde934..0000000 --- a/gutenprint-Add-Epson-Expression-ET-2600-EcoTank.patch +++ /dev/null @@ -1,42 +0,0 @@ -From b154b16431712017ea69d2dd7fda25efb487c86d Mon Sep 17 00:00:00 2001 -From: Robert Krawitz -Date: Tue, 24 Jul 2018 08:06:49 -0400 -Subject: [PATCH] Add Epson Expression ET-2600 EcoTank - ---- - NEWS | 6 ++++++ - src/xml/printers.xml | 1 + - 2 files changed, 7 insertions(+) - -diff --git a/NEWS b/NEWS -index 13b793ca..aeb63ed0 100644 ---- a/NEWS -+++ b/NEWS -@@ -248,6 +248,12 @@ device. We have determined that the data is in fact written by the - - III) MAJOR CHANGES FROM PREVIOUS RELEASES - -+* Changes from 5.2.14 -+ -+ 1) The following Epson inkjet printer has been added: -+ -+ Epson Expression ET-2600 EcoTank ET -+ - * Changes from 5.2.13 - - 1) The PCL driver now supports color laser printers that use PCL 5c -diff --git a/src/xml/printers.xml b/src/xml/printers.xml -index 32573ea7..9d15b2f4 100644 ---- a/src/xml/printers.xml -+++ b/src/xml/printers.xml -@@ -1534,6 +1534,7 @@ - - - -+ - - - --- -2.27.0 - diff --git a/gutenprint-Minor-doc-issues.patch b/gutenprint-Minor-doc-issues.patch deleted file mode 100644 index 69a51fe..0000000 --- a/gutenprint-Minor-doc-issues.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 907f862a4e838207b7e2a673e18b4fbd998b8529 Mon Sep 17 00:00:00 2001 -From: Robert Krawitz -Date: Sun, 29 Jul 2018 10:33:24 -0400 -Subject: [PATCH] Minor doc issues - ---- - scripts/autogen.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/autogen.sh b/scripts/autogen.sh -index c510dfcc..a5c580c0 100644 ---- a/scripts/autogen.sh -+++ b/scripts/autogen.sh -@@ -298,7 +298,7 @@ if test -d /usr/share/sgml/docbook ; then - fi - - { -- test -d "/usr/share/sgml/docbook_4" || test -d "/usr/share/sgml/docbook/dtd/4.0" || test -d "/usr/share/sgml/docbook_4.1" || test -n "$fedora_docbook" -+ test -d "/usr/share/sgml/docbook_4" || test -d "/usr/share/sgml/docbook/dtd/4.0" || test -d "/usr/share/sgml/docbook/dtd/4.1" || test -d "/usr/share/sgml/docbook_4.1" || test -n "$fedora_docbook" - } || { - echo " " - echo "***Warning***: You must have Docbook v4 installed to" --- -2.39.0.windows.2 - diff --git a/gutenprint-O6.patch b/gutenprint-O6.patch deleted file mode 100644 index fbdb356..0000000 --- a/gutenprint-O6.patch +++ /dev/null @@ -1,281 +0,0 @@ -diff -up gutenprint-5.2.12-pre3/configure.ac.O6 gutenprint-5.2.12-pre3/configure.ac ---- gutenprint-5.2.12-pre3/configure.ac.O6 2016-10-14 10:41:54.290398824 +0200 -+++ gutenprint-5.2.12-pre3/configure.ac 2016-10-14 10:44:04.921328215 +0200 -@@ -638,27 +638,6 @@ AH_TEMPLATE(PKGMODULEDIR,, [Package modu - PKGMODULEDIR="${PACKAGE_LIB_DIR}/${GUTENPRINT_RELEASE_VERSION}/modules" - AC_DEFINE_UNQUOTED(PKGMODULEDIR, ["$PKGMODULEDIR"]) - --dnl Compiler flags --if test x$ac_compiler_gnu = "xyes"; then -- STP_ADD_COMPILER_ARGS([-Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=131072],, [GNUCFLAGS]) -- if test x${USE_MAINTAINER_MODE} = xyes ; then -- STP_ADD_COMPILER_ARGS([-D_POSIX_C_SOURCE=200809L -std=c99 -pedantic -Waggregate-return -Wcast-qual -Wshadow -Wredundant-decls],, [GNUCFLAGS]) -- fi -- if test x$ENABLE_DEBUG = xyes ; then -- STP_ADD_COMPILER_ARG([-g]) -- else -- STP_ADD_FIRST_COMPILER_ARG([-O6 -O3 -O2 -O1 -O]) -- fi --else -- if test x$ENABLE_DEBUG = xyes ; then -- STP_ADD_COMPILER_ARG([-g]) -- else -- STP_ADD_FIRST_COMPILER_ARG([-O]) -- fi --fi --if test x$ENABLE_PROFILE = xyes ; then -- STP_ADD_COMPILER_ARG([-pg]) --fi - AC_SUBST(GNUCFLAGS) - - AH_TEMPLATE([HAVE_GCC_ATTRIBUTES], -diff -up gutenprint-5.2.12-pre3/configure.O6 gutenprint-5.2.12-pre3/configure ---- gutenprint-5.2.12-pre3/configure.O6 2016-10-14 10:41:54.293398800 +0200 -+++ gutenprint-5.2.12-pre3/configure 2016-10-14 10:53:25.392709079 +0200 -@@ -17651,246 +17651,6 @@ cat >>confdefs.h <<_ACEOF - #define PKGMODULEDIR "$PKGMODULEDIR" - _ACEOF - -- --if test x$ac_compiler_gnu = "xyes"; then -- -- for stp_ac_arg in -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=131072 ; do -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports ${stp_ac_arg}" >&5 --$as_echo_n "checking if ${CC} supports ${stp_ac_arg}... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${GNUCFLAGS} ${stp_ac_arg}" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- GNUCFLAGS="${stp_newCFLAGS}" -- -- done -- -- if test x${USE_MAINTAINER_MODE} = xyes ; then -- -- for stp_ac_arg in -D_POSIX_C_SOURCE=200809L -std=c99 -pedantic -Waggregate-return -Wcast-qual -Wshadow -Wredundant-decls ; do -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports ${stp_ac_arg}" >&5 --$as_echo_n "checking if ${CC} supports ${stp_ac_arg}... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${GNUCFLAGS} ${stp_ac_arg}" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- GNUCFLAGS="${stp_newCFLAGS}" -- -- done -- -- fi -- if test x$ENABLE_DEBUG = xyes ; then -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports -g" >&5 --$as_echo_n "checking if ${CC} supports -g... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} -g" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- CFLAGS="${stp_newCFLAGS}" -- -- else -- -- for stp_ac_arg in -O6 -O3 -O2 -O1 -O ; do -- stp_ac_save_CFLAGS="${CFLAGS}" -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports ${stp_ac_arg}" >&5 --$as_echo_n "checking if ${CC} supports ${stp_ac_arg}... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} ${stp_ac_arg}" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- CFLAGS="${stp_newCFLAGS}" -- -- test "${stp_ac_save_CFLAGS}" != "${CFLAGS}" && break -- done -- -- fi --else -- if test x$ENABLE_DEBUG = xyes ; then -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports -g" >&5 --$as_echo_n "checking if ${CC} supports -g... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} -g" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- CFLAGS="${stp_newCFLAGS}" -- -- else -- -- for stp_ac_arg in -O ; do -- stp_ac_save_CFLAGS="${CFLAGS}" -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports ${stp_ac_arg}" >&5 --$as_echo_n "checking if ${CC} supports ${stp_ac_arg}... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} ${stp_ac_arg}" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- CFLAGS="${stp_newCFLAGS}" -- -- test "${stp_ac_save_CFLAGS}" != "${CFLAGS}" && break -- done -- -- fi --fi --if test x$ENABLE_PROFILE = xyes ; then -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${CC} supports -pg" >&5 --$as_echo_n "checking if ${CC} supports -pg... " >&6; } -- stp_acOLDCFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} -pg" -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_compile "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; -- stp_newCFLAGS="$CFLAGS" --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; -- stp_newCFLAGS="$stp_acOLDCFLAGS" --fi --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- CFLAGS="$stp_acOLDCFLAGS" -- CFLAGS="${stp_newCFLAGS}" -- --fi -- -- -- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports __attribute__ syntax" >&5 - $as_echo_n "checking if $CC supports __attribute__ syntax... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff --git a/gutenprint-libusb-crash.patch b/gutenprint-libusb-crash.patch new file mode 100644 index 0000000..05853b2 --- /dev/null +++ b/gutenprint-libusb-crash.patch @@ -0,0 +1,75 @@ +diff --git a/src/cups/backend_common.c b/src/cups/backend_common.c +index 6333408..b19668d 100644 +--- a/src/cups/backend_common.c ++++ b/src/cups/backend_common.c +@@ -753,8 +753,7 @@ static struct dyesub_backend *backends[] = { + NULL, + }; + +-static int find_and_enumerate(struct libusb_context *ctx, +- struct libusb_device ***list, ++static int find_and_enumerate(struct libusb_device ***list, + const struct dyesub_backend *backend, + const char *match_serno, + const char *make, +@@ -777,7 +776,7 @@ static int find_and_enumerate(struct libusb_context *ctx, + STATE("+org.gutenprint.searching-for-device\n"); + + /* Enumerate and find suitable device */ +- num = libusb_get_device_list(ctx, list); ++ num = libusb_get_device_list(NULL, list); + + /* See if we can actually match on the supplied make! */ + if (backend && make) { +@@ -1010,7 +1009,6 @@ along with this program; if not, see .\n\n"; + + void print_help(const char *argv0, const struct dyesub_backend *backend) + { +- struct libusb_context *ctx = NULL; + struct libusb_device **list = NULL; + + const char *ptr = getenv("BACKEND"); +@@ -1072,7 +1070,7 @@ void print_help(const char *argv0, const struct dyesub_backend *backend) + } + + /* Scan for all printers for the specified backend */ +- find_and_enumerate(ctx, &list, backend, NULL, ptr, 1, 1, NULL); ++ find_and_enumerate(&list, backend, NULL, ptr, 1, 1, NULL); + libusb_free_device_list(list, 1); + } + +@@ -1251,7 +1249,6 @@ done: + + int main (int argc, char **argv) + { +- struct libusb_context *ctx = NULL; + struct libusb_device **list = NULL; + + struct dyesub_backend *backend = NULL; +@@ -1414,7 +1411,7 @@ int main (int argc, char **argv) + #endif + + /* Libusb setup */ +- ret = libusb_init(&ctx); ++ ret = libusb_init(NULL); + if (ret) { + ERROR("Failed to initialize libusb (%d)\n", ret); + ret = CUPS_BACKEND_RETRY_CURRENT; +@@ -1438,7 +1435,7 @@ int main (int argc, char **argv) + } + + /* Enumerate devices */ +- found = find_and_enumerate(ctx, &list, backend, use_serno, backend_str, 0, NUM_CLAIM_ATTEMPTS, &conn); ++ found = find_and_enumerate(&list, backend, use_serno, backend_str, 0, NUM_CLAIM_ATTEMPTS, &conn); + + if (found == -1) { + ERROR("Printer open failure (No matching printers found!)\n"); +@@ -1572,7 +1569,7 @@ done: + if (list) + libusb_free_device_list(list, 1); + +- libusb_exit(ctx); ++ libusb_exit(NULL); + + return ret; + } diff --git a/gutenprint-postscriptdriver.patch b/gutenprint-postscriptdriver.patch index ac7f920..d4b5ff7 100644 --- a/gutenprint-postscriptdriver.patch +++ b/gutenprint-postscriptdriver.patch @@ -1,7 +1,7 @@ -diff -up gutenprint-5.2.6/src/main/gutenprint-internal.h.postscriptdriver gutenprint-5.2.6/src/main/gutenprint-internal.h ---- gutenprint-5.2.6/src/main/gutenprint-internal.h.postscriptdriver 2010-08-04 02:33:56.000000000 +0200 -+++ gutenprint-5.2.6/src/main/gutenprint-internal.h 2010-08-11 16:11:19.000000000 +0200 -@@ -56,6 +56,8 @@ extern void stpi_init_printer(void); +diff -up gutenprint-5.3.3/src/main/gutenprint-internal.h.postscriptdriver gutenprint-5.3.3/src/main/gutenprint-internal.h +--- gutenprint-5.3.3/src/main/gutenprint-internal.h.postscriptdriver 2018-01-28 03:32:45.000000000 +0100 ++++ gutenprint-5.3.3/src/main/gutenprint-internal.h 2019-11-06 12:13:29.936061606 +0100 +@@ -54,6 +54,8 @@ extern void stpi_init_printer(void); #define BUFFER_FLAG_FLIP_X 0x1 #define BUFFER_FLAG_FLIP_Y 0x2 extern stp_image_t* stpi_buffer_image(stp_image_t* image, unsigned int flags); @@ -10,10 +10,10 @@ diff -up gutenprint-5.2.6/src/main/gutenprint-internal.h.postscriptdriver gutenp #define STPI_ASSERT(x,v) \ do \ -diff -up gutenprint-5.2.6/src/main/module.c.postscriptdriver gutenprint-5.2.6/src/main/module.c ---- gutenprint-5.2.6/src/main/module.c.postscriptdriver 2006-09-30 17:02:59.000000000 +0200 -+++ gutenprint-5.2.6/src/main/module.c 2010-08-11 16:13:43.000000000 +0200 -@@ -151,12 +151,20 @@ int stp_module_load(void) +diff -up gutenprint-5.3.3/src/main/module.c.postscriptdriver gutenprint-5.3.3/src/main/module.c +--- gutenprint-5.3.3/src/main/module.c.postscriptdriver 2019-05-25 16:34:21.000000000 +0200 ++++ gutenprint-5.3.3/src/main/module.c 2019-11-06 12:13:29.936061606 +0100 +@@ -159,12 +159,20 @@ int stp_module_load(void) } else { @@ -34,29 +34,28 @@ diff -up gutenprint-5.2.6/src/main/module.c.postscriptdriver gutenprint-5.2.6/sr } #ifdef USE_LTDL file_list = stp_path_search(dir_list, ".la"); -diff -up gutenprint-5.2.6/src/main/path.c.postscriptdriver gutenprint-5.2.6/src/main/path.c ---- gutenprint-5.2.6/src/main/path.c.postscriptdriver 2008-06-01 16:41:18.000000000 +0200 -+++ gutenprint-5.2.6/src/main/path.c 2010-08-11 16:13:43.000000000 +0200 -@@ -158,7 +158,17 @@ stpi_data_path(void) - if (getenv("STP_DATA_PATH")) - stp_path_split(dir_list, getenv("STP_DATA_PATH")); - else -- stp_path_split(dir_list, PKGXMLDATADIR); +diff -up gutenprint-5.3.3/src/main/path.c.postscriptdriver gutenprint-5.3.3/src/main/path.c +--- gutenprint-5.3.3/src/main/path.c.postscriptdriver 2019-05-25 16:34:21.000000000 +0200 ++++ gutenprint-5.3.3/src/main/path.c 2019-11-06 12:29:30.709190171 +0100 +@@ -154,6 +154,17 @@ stp_generate_path(const char *path) + return NULL; + stp_list_set_freefunc(dir_list, stp_list_node_free_data); + stp_path_split(dir_list, path); ++ if (!strncmp(PKGXMLDATADIR, path, strlen(path))) ++ { ++ const char *prefix = getenv("DESTDIR"); ++ if (prefix) + { -+ const char *prefix = getenv("DESTDIR"); -+ stp_path_split(dir_list, PKGXMLDATADIR); -+ if (prefix) -+ { -+ stp_list_t *prefix_list; -+ prefix_list = stp_paths_copy_with_prefix(dir_list, prefix); -+ stp_list_destroy(dir_list); -+ dir_list = prefix_list; -+ } ++ stp_list_t *prefix_list; ++ prefix_list = stp_paths_copy_with_prefix(dir_list, prefix); ++ stp_list_destroy(dir_list); ++ dir_list = prefix_list; + } ++ } return dir_list; } -@@ -226,6 +236,40 @@ stp_path_split(stp_list_t *list, /* List +@@ -262,6 +273,40 @@ stp_path_split(stp_list_t *list, /* List } } @@ -72,7 +71,7 @@ diff -up gutenprint-5.2.6/src/main/path.c.postscriptdriver gutenprint-5.2.6/src/ + stp_list_item_t *item; + int prefixlen = strlen (prefix); + if (!(new_list = stp_list_create())) -+ return; ++ return NULL; + + item = stp_list_get_start (list); + while (item) diff --git a/gutenprint-python36syntax.patch b/gutenprint-python36syntax.patch index 5b28195..cd7e258 100644 --- a/gutenprint-python36syntax.patch +++ b/gutenprint-python36syntax.patch @@ -1,7 +1,7 @@ --- gutenprint-5.2.12/src/cups/cups-genppdupdate.in.python36syntax +++ gutenprint-5.2.12/src/cups/cups-genppdupdate.in @@ -287,7 +287,7 @@ def update_ppd (ppd_source_filename): - for line in orig.readlines (): + for line in orig_lines: line.rstrip () if line.find ("*StpLocale:") != -1: - match = re.search ("\*StpLocale:\s*\"(.*)\"$", line) diff --git a/gutenprint-xmlfixes.patch b/gutenprint-xmlfixes.patch new file mode 100644 index 0000000..edd6f74 --- /dev/null +++ b/gutenprint-xmlfixes.patch @@ -0,0 +1,107 @@ +diff --git a/src/xml/escp2/inks/claria_xp.xml b/src/xml/escp2/inks/claria_xp.xml +index 44d38b5..693c2b1 100644 +--- a/src/xml/escp2/inks/claria_xp.xml ++++ b/src/xml/escp2/inks/claria_xp.xml +@@ -78,7 +78,7 @@ xsi:schemaLocation="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0 gutenprint. + + + +- ++ + + + +diff --git a/src/xml/escp2/inputslots/standard_roll_feed.xml b/src/xml/escp2/inputslots/standard_roll_feed.xml +index 1422d39..16316c8 100644 +--- a/src/xml/escp2/inputslots/standard_roll_feed.xml ++++ b/src/xml/escp2/inputslots/standard_roll_feed.xml +@@ -1,4 +1,4 @@ +- ++ + + ++ + 19 + 0x41 + +diff --git a/src/xml/escp2/media/claria.xml b/src/xml/escp2/media/claria.xml +index ce894f5..5b6be23 100644 +--- a/src/xml/escp2/media/claria.xml ++++ b/src/xml/escp2/media/claria.xml +@@ -1933,7 +1933,7 @@ xsi:schemaLocation="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0 gutenprint. + + + +- ++ + 19 + 0x54 + +diff --git a/src/xml/escp2/media/claria1400.xml b/src/xml/escp2/media/claria1400.xml +index a9b36e5..6a5deb7 100644 +--- a/src/xml/escp2/media/claria1400.xml ++++ b/src/xml/escp2/media/claria1400.xml +@@ -1933,7 +1933,7 @@ xsi:schemaLocation="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0 gutenprint. + + + +- ++ + 19 + 0x54 + +diff --git a/src/xml/escp2/media/claria_xp.xml b/src/xml/escp2/media/claria_xp.xml +index 32759b5..79f43c3 100644 +--- a/src/xml/escp2/media/claria_xp.xml ++++ b/src/xml/escp2/media/claria_xp.xml +@@ -2037,7 +2037,7 @@ xsi:schemaLocation="http://gimp-print.sourceforge.net/xsd/gp.xsd-1.0 gutenprint. + + + +- ++ + 19 + 0x54 + +diff --git a/src/xml/escp2/weaves/standard.xml b/src/xml/escp2/weaves/standard.xml +index d9176db..efc89de 100644 +--- a/src/xml/escp2/weaves/standard.xml ++++ b/src/xml/escp2/weaves/standard.xml +@@ -1,4 +1,4 @@ +- ++ + + + + +- ++ + + + +@@ -127,7 +127,7 @@ + + + +- EXPERIMENTAL ++ EXPERIMENTAL + + EXPERIMENTAL + EXPERIMENTAL diff --git a/gutenprint.spec b/gutenprint.spec index 5cf2418..1d852c1 100644 --- a/gutenprint.spec +++ b/gutenprint.spec @@ -1,21 +1,21 @@ %bcond_with gimp Name: gutenprint -Version: 5.2.14 -Release: 8 +Version: 5.3.4 +Release: 1 Summary: A suite of printer drivers License: GPLv2+ and MIT URL: http://gimp-print.sourceforge.net/ Source0: http://downloads.sourceforge.net/gimp-print/%{name}-%{version}.tar.bz2 Source1: cups-genppdupdate.py.in Patch0: gutenprint-menu.patch -Patch1: gutenprint-O6.patch -Patch2: gutenprint-postscriptdriver.patch -Patch3: gutenprint-yyin.patch -Patch4: gutenprint-manpage.patch -Patch5: gutenprint-python36syntax.patch -Patch6: gutenprint-Add-Epson-Expression-ET-2600-EcoTank.patch -Patch7: gutenprint-Minor-doc-issues.patch +Patch1: gutenprint-postscriptdriver.patch +Patch2: gutenprint-yyin.patch +Patch3: gutenprint-manpage.patch +Patch4: gutenprint-python36syntax.patch +Patch5: gutenprint-xmlfixes.patch +Patch6: gutenprint-libusb-crash.patch + %if %{with gimp} BuildRequires: pkgconfig(gimpui-2.0), gimp @@ -73,16 +73,15 @@ This package includes man files for %{name}. %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +%patch -P 0 -p1 -b .menu +%patch -P 1 -p1 -b .postscriptdriver +%patch -P 2 -p1 -b .yyin +%patch -P 3 -p1 -b .manpage cp %{SOURCE1} src/cups/cups-genppdupdate.in sed -i -e 's,^#!/usr/bin/python3,#!%{__python3},' src/cups/cups-genppdupdate.in -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 +%patch -P 4 -p1 -b .python36syntax +%patch -P 5 -p1 -b .xmlfixes +%patch -P 6 -p1 -b .crash %build sed -i -e 's,^\(TESTS *=.*\) run-weavetest,\1,' test/Makefile.in @@ -110,7 +109,7 @@ cat %{name}-po.lang >>%{name}.lang echo .so man8/cups-genppd.8 > $RPM_BUILD_ROOT%{_mandir}/man8/cups-genppd.5.2.8 -chrpath -d $RPM_BUILD_ROOT%{_sbindir}/cups-genppd.5.2 +chrpath -d $RPM_BUILD_ROOT%{_sbindir}/cups-genppd.5.3 %if %{with gimp} chrpath -d $RPM_BUILD_ROOT%{_libdir}/gimp/*/plug-ins/* %endif @@ -158,6 +157,9 @@ exit 0 %{_mandir}/man*/* %changelog +* Mon Oct 09 2023 Ge Wang - 5.3.4-1 +- Update to version 5.3.4 + * Mon Jan 9 2023 yaoguangzhong - 5.2.14-8 - backport Minor doc issues