From 89669d7759a986759da115537c48150bb30b54c3 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 17 Aug 2006 11:40:04 +0000 Subject: [PATCH] - Map CUPS charset names to real ones (bug #197577). --- paps-cups.patch | 75 +++++++++++++++++++++++++------------------------ paps.spec | 5 +++- 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/paps-cups.patch b/paps-cups.patch index ca6347e..35a7715 100644 --- a/paps-cups.patch +++ b/paps-cups.patch @@ -1,27 +1,5 @@ -diff -ruN paps-0.6.6.orig/configure.in paps-0.6.6/configure.in ---- paps-0.6.6.orig/configure.in 2006-04-28 04:41:36.000000000 +0900 -+++ paps-0.6.6/configure.in 2006-07-17 13:38:30.000000000 +0900 -@@ -7,4 +7,17 @@ - AC_PROG_CC - AM_PROG_LIBTOOL - -+dnl ====================================================== -+dnl check for CUPS -+dnl ====================================================== -+AC_PATH_PROG(CUPS_CONFIG, cups-config, no) -+if test "$CUPS_CONFIG" = "no"; then -+ AC_MSG_ERROR([Please install cups development packages]) -+fi -+CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'` -+CUPS_LIBS=`$CUPS_CONFIG --libs` -+ -+AC_SUBST(CUPS_CFLAGS) -+AC_SUBST(CUPS_LIBS) -+ - AC_OUTPUT(Makefile src/Makefile doc/Makefile) -diff -ruN paps-0.6.6.orig/src/Makefile.am paps-0.6.6/src/Makefile.am ---- paps-0.6.6.orig/src/Makefile.am 2006-07-17 13:35:07.000000000 +0900 -+++ paps-0.6.6/src/Makefile.am 2006-07-17 13:38:30.000000000 +0900 +--- paps-0.6.6/src/Makefile.am.cups 2006-08-17 12:12:43.000000000 +0100 ++++ paps-0.6.6/src/Makefile.am 2006-08-17 12:12:43.000000000 +0100 @@ -5,10 +5,10 @@ libpaps_a_incdir = $(includedir) @@ -35,9 +13,8 @@ diff -ruN paps-0.6.6.orig/src/Makefile.am paps-0.6.6/src/Makefile.am paps_DEPENDENCIES = $(noinst_LIBRARIES) EXTRA_DIST = test_libpaps.c paps.1 -diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c ---- paps-0.6.6.orig/src/paps.c 2006-07-17 13:35:07.000000000 +0900 -+++ paps-0.6.6/src/paps.c 2006-07-17 13:45:45.000000000 +0900 +--- paps-0.6.6/src/paps.c.cups 2006-08-17 12:12:43.000000000 +0100 ++++ paps-0.6.6/src/paps.c 2006-08-17 12:35:56.000000000 +0100 @@ -31,6 +31,7 @@ #include #include @@ -65,7 +42,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c int do_tumble = -1; /* -1 means not initialized */ int do_duplex = -1; gchar *paps_header = NULL; -@@ -323,12 +325,115 @@ +@@ -323,12 +325,121 @@ int header_sep = 20; int max_width = 0, w; GIConv cvh = NULL; @@ -171,8 +148,14 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c + if ((val = cupsGetOption("lpi", num_options, options)) != NULL) { + lpi = atof(val); + } -+ if (getenv("CHARSET") != NULL) -+ encoding = g_strdup(getenv("CHARSET")); ++ if (getenv("CHARSET") != NULL) { ++ char *charset = getenv("CHARSET"); ++ // Map CUPS charset names to real ones. ++ // http://cups.org/newsgroups.php?s9797+gcups.general+v9797+T1 ++ if (!g_ascii_strcasecmp(charset, "windows-932")) ++ charset = "WINDOWS-31J"; ++ encoding = g_strdup(charset); ++ } + } + } G_STMT_END; + @@ -181,7 +164,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c /* Parse command line */ if (!g_option_context_parse(ctxt, &argc, &argv, &error)) { -@@ -355,6 +460,8 @@ +@@ -355,6 +466,8 @@ IN = stdin; } title = filename_in; @@ -190,7 +173,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c paps = paps_new(); pango_context = paps_get_pango_context (paps); -@@ -373,8 +480,10 @@ +@@ -373,8 +486,10 @@ pango_context_set_font_description (pango_context, font_description); /* Page layout */ @@ -203,7 +186,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c if (num_columns == 1) total_gutter_width = 0; -@@ -435,6 +544,7 @@ +@@ -435,6 +550,7 @@ page_layout.pango_dir = pango_dir; page_layout.filename = filename_in; page_layout.header_font_desc = header_font_desc; @@ -211,7 +194,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c /* calculate x-coordinate scale */ if (cpi > 0.0L) -@@ -781,6 +891,7 @@ +@@ -781,6 +897,7 @@ int orientation = page_layout->page_width > page_layout->page_height; int bb_page_width = page_layout->page_width; int bb_page_height = page_layout->page_height; @@ -219,7 +202,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c /* Keep bounding box non-rotated to make ggv happy */ if (orientation) -@@ -790,12 +901,20 @@ +@@ -790,12 +907,20 @@ bb_page_height = tmp; } @@ -241,7 +224,7 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c "%%%%BeginProlog\n" "%%%%Orientation: %s\n" "/papsdict 1 dict def\n" -@@ -845,8 +964,10 @@ +@@ -845,8 +970,10 @@ title, bb_page_width, bb_page_height, @@ -252,3 +235,23 @@ diff -ruN paps-0.6.6.orig/src/paps.c paps-0.6.6/src/paps.c fprintf(OUT, "%% User settings\n" +--- paps-0.6.6/configure.in.cups 2006-04-27 20:41:36.000000000 +0100 ++++ paps-0.6.6/configure.in 2006-08-17 12:12:43.000000000 +0100 +@@ -7,4 +7,17 @@ + AC_PROG_CC + AM_PROG_LIBTOOL + ++dnl ====================================================== ++dnl check for CUPS ++dnl ====================================================== ++AC_PATH_PROG(CUPS_CONFIG, cups-config, no) ++if test "$CUPS_CONFIG" = "no"; then ++ AC_MSG_ERROR([Please install cups development packages]) ++fi ++CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'` ++CUPS_LIBS=`$CUPS_CONFIG --libs` ++ ++AC_SUBST(CUPS_CFLAGS) ++AC_SUBST(CUPS_LIBS) ++ + AC_OUTPUT(Makefile src/Makefile doc/Makefile) diff --git a/paps.spec b/paps.spec index e274e8f..810878e 100644 --- a/paps.spec +++ b/paps.spec @@ -1,6 +1,6 @@ Name: paps Version: 0.6.6 -Release: 11%{?dist} +Release: 12%{?dist} License: LGPL URL: http://paps.sourceforge.net/ @@ -76,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Aug 17 2006 Tim Waugh - 0.6.6-12 +- Map CUPS charset names to real ones (bug #197577). + * Mon Jul 17 2006 Akira TAGOH - 0.6.6-11 - add an owner info to PS.