diff --git a/groff.spec b/groff.spec index 18e5ea7..c4fd981 100644 --- a/groff.spec +++ b/groff.spec @@ -3,7 +3,7 @@ Summary: A document formatting system Name: groff Version: 1.18.1.4 -Release: 11%{?dist} +Release: 12%{?dist} License: GPLv2 and GFDL Group: Applications/Publishing URL: http://groff.ffii.org @@ -35,6 +35,7 @@ Patch23: groff-1.18.1.1-spacefix.patch Patch24: groff-1.18.1.4-sectmp.patch Patch25: groff-1.18.1.4-grofferpath.patch Patch26: groff-1.18.1.4-gcc4.3.0.patch +Patch27: nroff.patch Requires: mktemp Requires: /sbin/install-info @@ -103,6 +104,7 @@ System display. %patch24 -p1 -b .sectmp %patch25 -p1 -b .grofferpath %patch26 -p1 -b .gcc43 +%patch27 for i in contrib/mm/{groff_mm,groff_mmse,mmroff}.man \ src/devices/grolbp/grolbp.man; do @@ -241,6 +243,10 @@ exit 0 %endif %changelog +* Wed Jan 23 2008 Marcela Maslanova - 1.18.1.4-12 +- rewrite nroff for using -Tencoding with main support of utf8 +- Resolves: rhbz#251064 + * Thu Jan 3 2008 Marcela Maslanova - 1.18.1.4-11 - fix for gcc4.3.0 diff --git a/nroff b/nroff index 49a71bc..c65653e 100644 --- a/nroff +++ b/nroff @@ -6,51 +6,6 @@ charset_in=iso-8859-1 charset_out=`locale charmap 2>/dev/null` opts="-mtty-char -Tutf8" -# Default device. -# First try the "locale charmap" command, because it's most reliable. -# On systems where it doesn't exist, look at the environment variables. -case "`locale charmap 2>/dev/null`" in - UTF-8) - T=-Tutf8 ;; - ISO-8859-1) - T=-Tlatin1 ;; - IBM-1047) - T=-Tcp1047 ;; - EUC-JP) - T=-Tnippon ;; - EUC-KR) - T=-Tkorean ;; - *) - case "${LC_ALL-${LC_CTYPE-${LANG}}}" in - *.UTF-8) - T=-Tutf8 ;; - iso_8859_1 | *.ISO-8859-1) - T=-Tlatin1 ;; - *.IBM-1047) - T=-Tcp1047 ;; - ja_JP.ujis | ja_JP.eucJP) - T=-Tnippon ;; - ko_KR.eucKR) - T=-Tkorean ;; - *) - case "$LESSCHARSET" in - utf-8) - T=-Tutf8 ;; - latin1) - T=-Tlatin1 ;; - cp1047) - T=-Tcp1047 ;; - japanese) - T=-Tnippon ;; - ko) - T=-Tkorean ;; - *) - T=-Tascii8 ;; - esac ;; - esac ;; -esac - - for i do case $1 in @@ -58,19 +13,16 @@ do opts="$opts -P-c" ;; -h) opts="$opts -P-h" ;; - -[eq] | -s*) - # ignore these options - ;; -[mrnoT]) echo $"option $1 requires an argument" >&2 exit 1 ;; -[iptSUC] | -[mrno]*) opts="$opts $1" ;; - -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean) - opts= - T=$1 ;; - -T*) - # ignore other devices + -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean) + T=$1 ; + opts="-mtty-char $T";; + -[eq] | -s* | -u* | -T*) + # ignore other devices ;; -v | --version) echo $"GNU nroff (groff) with Red Hat i18n/l10n support" @@ -120,7 +72,6 @@ export LC_ALL=en_US.UTF-8 # This shell script is intended for use with man, so warnings are # probably not wanted. Also load nroff-style character definitions. - if [ $charset_in = utf-8 -a $charset_out = UTF-8 ]; then if [ $TMPFILE = buf ]; then echo -n "$buf" | /usr/bin/groff $opts 2>/dev/null @@ -140,7 +91,7 @@ else /usr/bin/groff $opts 2>/dev/null | \ /usr/bin/iconv -f utf-8 -t ${charset_out}//translit - rm -f $TMPFILE + rm -f $TMPFILE fi fi diff --git a/nroff.patch b/nroff.patch new file mode 100644 index 0000000..8b36ead --- /dev/null +++ b/nroff.patch @@ -0,0 +1,97 @@ +diff -up ./nroff.old ./nroff +--- ./nroff.old 2007-08-16 16:11:35.000000000 +0200 ++++ ./nroff 2008-01-23 14:22:19.000000000 +0100 +@@ -6,51 +6,6 @@ charset_in=iso-8859-1 + charset_out=`locale charmap 2>/dev/null` + opts="-mtty-char -Tutf8" + +-# Default device. +-# First try the "locale charmap" command, because it's most reliable. +-# On systems where it doesn't exist, look at the environment variables. +-case "`locale charmap 2>/dev/null`" in +- UTF-8) +- T=-Tutf8 ;; +- ISO-8859-1) +- T=-Tlatin1 ;; +- IBM-1047) +- T=-Tcp1047 ;; +- EUC-JP) +- T=-Tnippon ;; +- EUC-KR) +- T=-Tkorean ;; +- *) +- case "${LC_ALL-${LC_CTYPE-${LANG}}}" in +- *.UTF-8) +- T=-Tutf8 ;; +- iso_8859_1 | *.ISO-8859-1) +- T=-Tlatin1 ;; +- *.IBM-1047) +- T=-Tcp1047 ;; +- ja_JP.ujis | ja_JP.eucJP) +- T=-Tnippon ;; +- ko_KR.eucKR) +- T=-Tkorean ;; +- *) +- case "$LESSCHARSET" in +- utf-8) +- T=-Tutf8 ;; +- latin1) +- T=-Tlatin1 ;; +- cp1047) +- T=-Tcp1047 ;; +- japanese) +- T=-Tnippon ;; +- ko) +- T=-Tkorean ;; +- *) +- T=-Tascii8 ;; +- esac ;; +- esac ;; +-esac +- +- + for i + do + case $1 in +@@ -58,19 +13,16 @@ do + opts="$opts -P-c" ;; + -h) + opts="$opts -P-h" ;; +- -[eq] | -s*) +- # ignore these options +- ;; + -[mrnoT]) + echo $"option $1 requires an argument" >&2 + exit 1 ;; + -[iptSUC] | -[mrno]*) + opts="$opts $1" ;; +- -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean) +- opts= +- T=$1 ;; +- -T*) +- # ignore other devices ++ -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean) ++ T=$1 ; ++ opts="-mtty-char $T";; ++ -[eq] | -s* | -u* | -T*) ++ # ignore other devices + ;; + -v | --version) + echo $"GNU nroff (groff) with Red Hat i18n/l10n support" +@@ -120,7 +72,6 @@ export LC_ALL=en_US.UTF-8 + + # This shell script is intended for use with man, so warnings are + # probably not wanted. Also load nroff-style character definitions. +- + if [ $charset_in = utf-8 -a $charset_out = UTF-8 ]; then + if [ $TMPFILE = buf ]; then + echo -n "$buf" | /usr/bin/groff $opts 2>/dev/null +@@ -140,7 +91,7 @@ else + /usr/bin/groff $opts 2>/dev/null | \ + /usr/bin/iconv -f utf-8 -t ${charset_out}//translit + +- rm -f $TMPFILE ++ rm -f $TMPFILE + fi + fi +