commit 2577177d568fba00c7311b6b91ff443b9a9aa306 Author: CentOS Sources Date: Fri Aug 2 01:34:00 2019 -0400 import liblouis-2.6.2-16.el8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..673ef74 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/liblouis-2.6.2.tar.gz diff --git a/.liblouis.metadata b/.liblouis.metadata new file mode 100644 index 0000000..21aa57d --- /dev/null +++ b/.liblouis.metadata @@ -0,0 +1 @@ +490437e79e648ef55c17f3e599eb1fc57ca781d0 SOURCES/liblouis-2.6.2.tar.gz diff --git a/SOURCES/0001-Update-configure.ac-to-reconize-texi2any.patch b/SOURCES/0001-Update-configure.ac-to-reconize-texi2any.patch new file mode 100644 index 0000000..f5646f0 --- /dev/null +++ b/SOURCES/0001-Update-configure.ac-to-reconize-texi2any.patch @@ -0,0 +1,27 @@ +From e2fa19ed1a1463cbea37bbdd27481aeb80d5d7a0 Mon Sep 17 00:00:00 2001 +From: Martin Michlmayr +Date: Tue, 30 Jun 2015 12:40:49 -0400 +Subject: [PATCH] Update configure.ac to reconize texi2any + +makeinfo, which is nowadays provided by texi2any, reports texi2any as +of version 6.0. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 10a5efe..13041bd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -89,7 +89,7 @@ if test x"${MAKEINFO_FOUND}" = xyes + then + MAKEINFO_VERSION_REQ=5 + AC_MSG_CHECKING([for makeinfo version >= $MAKEINFO_VERSION_REQ]) +- MAKEINFO_VERSION=`makeinfo --version | sed -ne 's/^makeinfo .* \([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*$/\1/p'` ++ MAKEINFO_VERSION=`makeinfo --version | sed -ne 's/^\(makeinfo\|texi2any\) .* \([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*$/\2/p'` + if test x$MAKEINFO_VERSION = x -o 0$MAKEINFO_VERSION -lt $MAKEINFO_VERSION_REQ + then + AC_MSG_RESULT([no]) +-- +2.5.0 + diff --git a/SOURCES/liblouis-security-fixes.patch b/SOURCES/liblouis-security-fixes.patch new file mode 100644 index 0000000..2c8491b --- /dev/null +++ b/SOURCES/liblouis-security-fixes.patch @@ -0,0 +1,635 @@ +diff --git a/liblouis/compileTranslationTable.c b/liblouis/compileTranslationTable.c +--- a/liblouis/compileTranslationTable.c ++++ b/liblouis/compileTranslationTable.c +@@ -365,12 +365,13 @@ + char * + showString (widechar const *chars, int length) + { +-/*Translate a string of characters to the encoding used in character +-* operands */ ++ /*Translate a string of characters to the encoding used in character ++ * operands */ + int charPos; + int bufPos = 0; ++ static char scratchBuf[MAXSTRING]; + scratchBuf[bufPos++] = '\''; +- for (charPos = 0; charPos < length; charPos++) ++ for (charPos = 0; charPos < length && bufPos < (MAXSTRING-2); charPos++) + { + if (chars[charPos] >= 32 && chars[charPos] < 127) + scratchBuf[bufPos++] = (char) chars[charPos]; +@@ -407,7 +408,7 @@ + leadingZeros = 0; + break; + } +- if ((bufPos + leadingZeros + hexLength + 4) >= sizeof (scratchBuf)) ++ if ((bufPos + leadingZeros + hexLength + 4) >= (MAXSTRING-2)) + break; + scratchBuf[bufPos++] = '\\'; + scratchBuf[bufPos++] = escapeLetter; +@@ -422,87 +423,88 @@ + return scratchBuf; + } + ++typedef struct intCharTupple { ++ int key; ++ char value; ++} intCharTupple; ++ ++/** ++ * Mapping between braille dot and textual representation as used in dots operands ++ */ ++const static intCharTupple dotMapping[] = { ++ {B1, '1'}, ++ {B2, '2'}, ++ {B3, '3'}, ++ {B4, '4'}, ++ {B5, '5'}, ++ {B6, '6'}, ++ {B7, '7'}, ++ {B8, '8'}, ++ {B9, '9'}, ++ {B10, 'A'}, ++ {B11, 'B'}, ++ {B12, 'C'}, ++ {B13, 'D'}, ++ {B14, 'E'}, ++ {B15, 'F'}, ++ 0 ++}; ++ ++/** ++ * Translate a sequence of dots to the encoding used in dots operands. ++ */ + char * + showDots (widechar const *dots, int length) + { +-/* Translate a sequence of dots to the encoding used in dots operands. +-*/ + int bufPos = 0; +- int dotsPos; +- for (dotsPos = 0; bufPos < sizeof (scratchBuf) && dotsPos < length; +- dotsPos++) +- { +- if ((dots[dotsPos] & B1)) +- scratchBuf[bufPos++] = '1'; +- if ((dots[dotsPos] & B2)) +- scratchBuf[bufPos++] = '2'; +- if ((dots[dotsPos] & B3)) +- scratchBuf[bufPos++] = '3'; +- if ((dots[dotsPos] & B4)) +- scratchBuf[bufPos++] = '4'; +- if ((dots[dotsPos] & B5)) +- scratchBuf[bufPos++] = '5'; +- if ((dots[dotsPos] & B6)) +- scratchBuf[bufPos++] = '6'; +- if ((dots[dotsPos] & B7)) +- scratchBuf[bufPos++] = '7'; +- if ((dots[dotsPos] & B8)) +- scratchBuf[bufPos++] = '8'; +- if ((dots[dotsPos] & B9)) +- scratchBuf[bufPos++] = '9'; +- if ((dots[dotsPos] & B10)) +- scratchBuf[bufPos++] = 'A'; +- if ((dots[dotsPos] & B11)) +- scratchBuf[bufPos++] = 'B'; +- if ((dots[dotsPos] & B12)) +- scratchBuf[bufPos++] = 'C'; +- if ((dots[dotsPos] & B13)) +- scratchBuf[bufPos++] = 'D'; +- if ((dots[dotsPos] & B14)) +- scratchBuf[bufPos++] = 'E'; +- if ((dots[dotsPos] & B15)) +- scratchBuf[bufPos++] = 'F'; +- if ((dots[dotsPos] == B16)) +- scratchBuf[bufPos++] = '0'; +- if (dotsPos != length - 1) +- scratchBuf[bufPos++] = '-'; ++ static char scratchBuf[MAXSTRING]; ++ for (int dotsPos = 0; dotsPos < length && bufPos < (MAXSTRING-1); dotsPos++) { ++ for (int mappingPos = 0; dotMapping[mappingPos].key; mappingPos++) { ++ if ((dots[dotsPos] & dotMapping[mappingPos].key) && (bufPos < (MAXSTRING-1))) ++ scratchBuf[bufPos++] = dotMapping[mappingPos].value; + } ++ if ((dots[dotsPos] == B16) && (bufPos < (MAXSTRING-1))) ++ scratchBuf[bufPos++] = '0'; ++ if ((dotsPos != length - 1) && (bufPos < (MAXSTRING-1))) ++ scratchBuf[bufPos++] = '-'; ++ } + scratchBuf[bufPos] = 0; +- return &scratchBuf[0]; ++ return scratchBuf; + } + ++/** ++ * Mapping between character attribute and textual representation ++ */ ++const static intCharTupple attributeMapping[] = { ++ {CTC_Space, 's'}, ++ {CTC_Letter, 'l'}, ++ {CTC_Digit, 'd'}, ++ {CTC_Punctuation, 'p'}, ++ {CTC_UpperCase, 'U'}, ++ {CTC_LowerCase, 'u'}, ++ {CTC_Math, 'm'}, ++ {CTC_Sign, 'S'}, ++ {CTC_LitDigit, 'D'}, ++ {CTC_Class1, 'w'}, ++ {CTC_Class2, 'x'}, ++ {CTC_Class3, 'y'}, ++ {CTC_Class4, 'z'}, ++ 0 ++}; ++ ++/** ++ * Show attributes using the letters used after the $ in multipass ++ * opcodes. ++ */ + char * + showAttributes (TranslationTableCharacterAttributes a) + { +-/* Show attributes using the letters used after the $ in multipass +-* opcodes. */ + int bufPos = 0; +- if ((a & CTC_Space)) +- scratchBuf[bufPos++] = 's'; +- if ((a & CTC_Letter)) +- scratchBuf[bufPos++] = 'l'; +- if ((a & CTC_Digit)) +- scratchBuf[bufPos++] = 'd'; +- if ((a & CTC_Punctuation)) +- scratchBuf[bufPos++] = 'p'; +- if ((a & CTC_UpperCase)) +- scratchBuf[bufPos++] = 'U'; +- if ((a & CTC_LowerCase)) +- scratchBuf[bufPos++] = 'u'; +- if ((a & CTC_Math)) +- scratchBuf[bufPos++] = 'm'; +- if ((a & CTC_Sign)) +- scratchBuf[bufPos++] = 'S'; +- if ((a & CTC_LitDigit)) +- scratchBuf[bufPos++] = 'D'; +- if ((a & CTC_Class1)) +- scratchBuf[bufPos++] = 'w'; +- if ((a & CTC_Class2)) +- scratchBuf[bufPos++] = 'x'; +- if ((a & CTC_Class3)) +- scratchBuf[bufPos++] = 'y'; +- if ((a & CTC_Class4)) +- scratchBuf[bufPos++] = 'z'; ++ static char scratchBuf[MAXSTRING]; ++ for (int mappingPos = 0; attributeMapping[mappingPos].key; mappingPos++) { ++ if ((a & attributeMapping[mappingPos].key) && bufPos < (MAXSTRING - 1)) ++ scratchBuf[bufPos++] = attributeMapping[mappingPos].value; ++ } + scratchBuf[bufPos] = 0; + return scratchBuf; + } +@@ -592,9 +594,10 @@ + if (pch == '\\' && ch == 10) + { + nested->linelen--; ++ pch = ch; + continue; + } +- if (ch == 10 || nested->linelen >= MAXSTRING) ++ if (ch == 10 || nested->linelen >= MAXSTRING-1) + break; + nested->line[nested->linelen++] = (widechar) ch; + pch = ch; +@@ -957,43 +960,22 @@ + return 1; + } + ++/** ++ * Print out dot numbers ++ * ++ * @return a string containing the dot numbers. The longest possible ++ * output is "\123456789ABCDEF0/" ++ */ + static char * + unknownDots (widechar dots) + { +-/*Print out dot numbers */ + static char buffer[20]; + int k = 1; + buffer[0] = '\\'; +- if ((dots & B1)) +- buffer[k++] = '1'; +- if ((dots & B2)) +- buffer[k++] = '2'; +- if ((dots & B3)) +- buffer[k++] = '3'; +- if ((dots & B4)) +- buffer[k++] = '4'; +- if ((dots & B5)) +- buffer[k++] = '5'; +- if ((dots & B6)) +- buffer[k++] = '6'; +- if ((dots & B7)) +- buffer[k++] = '7'; +- if ((dots & B8)) +- buffer[k++] = '8'; +- if ((dots & B9)) +- buffer[k++] = '9'; +- if ((dots & B10)) +- buffer[k++] = 'A'; +- if ((dots & B11)) +- buffer[k++] = 'B'; +- if ((dots & B12)) +- buffer[k++] = 'C'; +- if ((dots & B13)) +- buffer[k++] = 'D'; +- if ((dots & B14)) +- buffer[k++] = 'E'; +- if ((dots & B15)) +- buffer[k++] = 'F'; ++ for (int mappingPos = 0; dotMapping[mappingPos].key; mappingPos++) { ++ if (dots & dotMapping[mappingPos].key) ++ buffer[k++] = dotMapping[mappingPos].value; ++ } + buffer[k++] = '/'; + buffer[k] = 0; + return buffer; +@@ -1557,6 +1539,11 @@ + { + compileWarning (nested, "invalid UTF-8. Assuming Latin-1."); + result->chars[out++] = token->chars[lastIn]; ++ if (out >= MAXSTRING) ++ { ++ result->length = out; ++ return 1; ++ } + in = lastIn + 1; + continue; + } +@@ -1582,7 +1569,7 @@ + CharsString wideIn; + CharsString result; + int k; +- for (k = 0; inString[k] && k < MAXSTRING; k++) ++ for (k = 0; inString[k] && k < MAXSTRING-1; k++) + wideIn.chars[k] = inString[k]; + wideIn.chars[k] = 0; + wideIn.length = k; +@@ -1713,7 +1700,7 @@ + CharsString wideIn; + CharsString result; + int k; +- for (k = 0; inString[k] && k < MAXSTRING; k++) ++ for (k = 0; inString[k] && k < MAXSTRING-1; k++) + wideIn.chars[k] = inString[k]; + wideIn.chars[k] = 0; + wideIn.length = k; +@@ -3244,8 +3231,7 @@ + + static int + compileBrailleIndicator (FileInfo * nested, char *ermsg, +- TranslationTableOpcode opcode, +- TranslationTableOffset * rule) ++ TranslationTableOpcode opcode) + { + CharsString token; + CharsString cells; +@@ -3253,7 +3239,6 @@ + if (parseDots (nested, &cells, &token)) + if (!addRule (nested, opcode, NULL, &cells, 0, 0)) + return 0; +- *rule = newRuleOffset; + return 1; + } + +@@ -3869,18 +3854,22 @@ + case CTO_Undefined: + ok = + compileBrailleIndicator (nested, "undefined character opcode", +- CTO_Undefined, &table->undefined); ++ CTO_Undefined); ++ if (ok) ++ table->undefined = newRuleOffset; + break; + case CTO_CapitalSign: + ok = +- compileBrailleIndicator (nested, "capital sign", CTO_CapitalRule, +- &table->capitalSign); ++ compileBrailleIndicator (nested, "capital sign", CTO_CapitalRule); ++ if (ok) ++ table->capitalSign = newRuleOffset; + break; + case CTO_BeginCapitalSign: + ok = + compileBrailleIndicator (nested, "begin capital sign", +- CTO_BeginCapitalRule, +- &table->beginCapitalSign); ++ CTO_BeginCapitalRule); ++ if (ok) ++ table->beginCapitalSign = newRuleOffset; + break; + case CTO_LenBegcaps: + ok = table->lenBeginCaps = compileNumber (nested); +@@ -3888,33 +3877,39 @@ + case CTO_EndCapitalSign: + ok = + compileBrailleIndicator (nested, "end capitals sign", +- CTO_EndCapitalRule, &table->endCapitalSign); ++ CTO_EndCapitalRule); ++ if (ok) ++ table->endCapitalSign = newRuleOffset; + break; + case CTO_FirstWordCaps: + ok = + compileBrailleIndicator (nested, "first word capital sign", +- CTO_FirstWordCapsRule, +- &table->firstWordCaps); ++ CTO_FirstWordCapsRule); ++ if (ok) ++ table->firstWordCaps = newRuleOffset; + break; + case CTO_LastWordCapsBefore: + ok = + compileBrailleIndicator (nested, "capital sign before last word", +- CTO_LastWordCapsBeforeRule, +- &table->lastWordCapsBefore); ++ CTO_LastWordCapsBeforeRule); ++ if (ok) ++ table->lastWordCapsBefore = newRuleOffset; + break; + case CTO_LastWordCapsAfter: + ok = + compileBrailleIndicator (nested, "capital sign after last word", +- CTO_LastWordCapsAfterRule, +- &table->lastWordCapsAfter); ++ CTO_LastWordCapsAfterRule); ++ if (ok) ++ table->lastWordCapsAfter = newRuleOffset; + break; + case CTO_LenCapsPhrase: + ok = table->lenCapsPhrase = compileNumber (nested); + break; + case CTO_LetterSign: + ok = +- compileBrailleIndicator (nested, "letter sign", CTO_LetterRule, +- &table->letterSign); ++ compileBrailleIndicator (nested, "letter sign", CTO_LetterRule); ++ if (ok) ++ table->letterSign = newRuleOffset; + break; + case CTO_NoLetsignBefore: + if (getRuleCharsText (nested, &ruleChars)) +@@ -3959,52 +3954,60 @@ + break; + case CTO_NumberSign: + ok = +- compileBrailleIndicator (nested, "number sign", CTO_NumberRule, +- &table->numberSign); ++ compileBrailleIndicator (nested, "number sign", CTO_NumberRule); ++ if (ok) ++ table->numberSign = newRuleOffset; + break; + case CTO_FirstWordItal: + ok = + compileBrailleIndicator (nested, "first word italic", +- CTO_FirstWordItalRule, +- &table->firstWordItal); ++ CTO_FirstWordItalRule); ++ if (ok) ++ table->firstWordItal = newRuleOffset; + break; + case CTO_ItalSign: + case CTO_LastWordItalBefore: + ok = + compileBrailleIndicator (nested, "first word italic before", +- CTO_LastWordItalBeforeRule, +- &table->lastWordItalBefore); ++ CTO_LastWordItalBeforeRule); ++ if (ok) ++ table->lastWordItalBefore = newRuleOffset; + break; + case CTO_LastWordItalAfter: + ok = + compileBrailleIndicator (nested, "last word italic after", +- CTO_LastWordItalAfterRule, +- &table->lastWordItalAfter); ++ CTO_LastWordItalAfterRule); ++ if (ok) ++ table->lastWordItalAfter = newRuleOffset; + break; + case CTO_BegItal: + case CTO_FirstLetterItal: + ok = + compileBrailleIndicator (nested, "first letter italic", +- CTO_FirstLetterItalRule, +- &table->firstLetterItal); ++ CTO_FirstLetterItalRule); ++ if (ok) ++ table->firstLetterItal = newRuleOffset; + break; + case CTO_EndItal: + case CTO_LastLetterItal: + ok = + compileBrailleIndicator (nested, "last letter italic", +- CTO_LastLetterItalRule, +- &table->lastLetterItal); ++ CTO_LastLetterItalRule); ++ if (ok) ++ table->lastLetterItal = newRuleOffset; + break; + case CTO_SingleLetterItal: + ok = + compileBrailleIndicator (nested, "single letter italic", +- CTO_SingleLetterItalRule, +- &table->singleLetterItal); ++ CTO_SingleLetterItalRule); ++ if (ok) ++ table->singleLetterItal = newRuleOffset; + break; + case CTO_ItalWord: + ok = +- compileBrailleIndicator (nested, "italic word", CTO_ItalWordRule, +- &table->italWord); ++ compileBrailleIndicator (nested, "italic word", CTO_ItalWordRule); ++ if (ok) ++ table->italWord = newRuleOffset; + break; + case CTO_LenItalPhrase: + ok = table->lenItalPhrase = compileNumber (nested); +@@ -4012,46 +4015,53 @@ + case CTO_FirstWordBold: + ok = + compileBrailleIndicator (nested, "first word bold", +- CTO_FirstWordBoldRule, +- &table->firstWordBold); ++ CTO_FirstWordBoldRule); ++ if (ok) ++ table->firstWordBold = newRuleOffset; + break; + case CTO_BoldSign: + case CTO_LastWordBoldBefore: + ok = + compileBrailleIndicator (nested, "last word bold before", +- CTO_LastWordBoldBeforeRule, +- &table->lastWordBoldBefore); ++ CTO_LastWordBoldBeforeRule); ++ if (ok) ++ table->lastWordBoldBefore = newRuleOffset; + break; + case CTO_LastWordBoldAfter: + ok = + compileBrailleIndicator (nested, "last word bold after", +- CTO_LastWordBoldAfterRule, +- &table->lastWordBoldAfter); ++ CTO_LastWordBoldAfterRule); ++ if (ok) ++ table->lastWordBoldAfter = newRuleOffset; + break; + case CTO_BegBold: + case CTO_FirstLetterBold: + ok = + compileBrailleIndicator (nested, "first letter bold", +- CTO_FirstLetterBoldRule, +- &table->firstLetterBold); ++ CTO_FirstLetterBoldRule); ++ if (ok) ++ table->firstLetterBold = newRuleOffset; + break; + case CTO_EndBold: + case CTO_LastLetterBold: + ok = + compileBrailleIndicator (nested, "last letter bold", +- CTO_LastLetterBoldRule, +- &table->lastLetterBold); ++ CTO_LastLetterBoldRule); ++ if (ok) ++ table->lastLetterBold = newRuleOffset; + break; + case CTO_SingleLetterBold: + ok = + compileBrailleIndicator (nested, "single letter bold", +- CTO_SingleLetterBoldRule, +- &table->singleLetterBold); ++ CTO_SingleLetterBoldRule); ++ if (ok) ++ table->singleLetterBold = newRuleOffset; + break; + case CTO_BoldWord: + ok = +- compileBrailleIndicator (nested, "bold word", CTO_BoldWordRule, +- &table->boldWord); ++ compileBrailleIndicator (nested, "bold word", CTO_BoldWordRule); ++ if (ok) ++ table->boldWord = newRuleOffset; + break; + case CTO_LenBoldPhrase: + ok = table->lenBoldPhrase = compileNumber (nested); +@@ -4059,46 +4069,53 @@ + case CTO_FirstWordUnder: + ok = + compileBrailleIndicator (nested, "first word underline", +- CTO_FirstWordUnderRule, +- &table->firstWordUnder); ++ CTO_FirstWordUnderRule); ++ if (ok) ++ table->firstWordUnder = newRuleOffset; + break; + case CTO_UnderSign: + case CTO_LastWordUnderBefore: + ok = + compileBrailleIndicator (nested, "last word underline before", +- CTO_LastWordUnderBeforeRule, +- &table->lastWordUnderBefore); ++ CTO_LastWordUnderBeforeRule); ++ if (ok) ++ table->lastWordUnderBefore = newRuleOffset; + break; + case CTO_LastWordUnderAfter: + ok = + compileBrailleIndicator (nested, "last word underline after", +- CTO_LastWordUnderAfterRule, +- &table->lastWordUnderAfter); ++ CTO_LastWordUnderAfterRule); ++ if (ok) ++ table->lastWordUnderAfter = newRuleOffset; + break; + case CTO_BegUnder: + case CTO_FirstLetterUnder: + ok = + compileBrailleIndicator (nested, "first letter underline", +- CTO_FirstLetterUnderRule, +- &table->firstLetterUnder); ++ CTO_FirstLetterUnderRule); ++ if (ok) ++ table->firstLetterUnder = newRuleOffset; + break; + case CTO_EndUnder: + case CTO_LastLetterUnder: + ok = + compileBrailleIndicator (nested, "last letter underline", +- CTO_LastLetterUnderRule, +- &table->lastLetterUnder); ++ CTO_LastLetterUnderRule); ++ if (ok) ++ table->lastLetterUnder = newRuleOffset; + break; + case CTO_SingleLetterUnder: + ok = + compileBrailleIndicator (nested, "single letter underline", +- CTO_SingleLetterUnderRule, +- &table->singleLetterUnder); ++ CTO_SingleLetterUnderRule); ++ if (ok) ++ table->singleLetterUnder = newRuleOffset; + break; + case CTO_UnderWord: + ok = +- compileBrailleIndicator (nested, "underlined word", CTO_UnderWordRule, +- &table->underWord); ++ compileBrailleIndicator (nested, "underlined word", CTO_UnderWordRule); ++ if (ok) ++ table->underWord = newRuleOffset; + break; + case CTO_LenUnderPhrase: + ok = table->lenUnderPhrase = compileNumber (nested); +@@ -4106,12 +4123,16 @@ + case CTO_BegComp: + ok = + compileBrailleIndicator (nested, "begin computer braille", +- CTO_BegCompRule, &table->begComp); ++ CTO_BegCompRule); ++ if (ok) ++ table->begComp = newRuleOffset; + break; + case CTO_EndComp: + ok = + compileBrailleIndicator (nested, "end computer braslle", +- CTO_EndCompRule, &table->endComp); ++ CTO_EndCompRule); ++ if (ok) ++ table->endComp = newRuleOffset; + break; + case CTO_Syllable: + table->syllables = 1; +@@ -4748,10 +4769,10 @@ + includeFile (FileInfo * nested, CharsString * includedFile) + { + int k; +- char includeThis[MAXSTRING]; ++ char includeThis[MAXSTRING+1]; + char **tableFiles; + int rv; +- for (k = 0; k < includedFile->length; k++) ++ for (k = 0; k < includedFile->length && k < MAXSTRING; k++) + includeThis[k] = (char) includedFile->chars[k]; + includeThis[k] = 0; + tableFiles = resolveTable (includeThis, nested->fileName); +diff --git a/tools/lou_translate.c b/tools/lou_translate.c +--- a/tools/lou_translate.c ++++ b/tools/lou_translate.c +@@ -71,7 +71,7 @@ + { + translen = BUFSIZE; + k = 0; +- while ((ch = getchar ()) != '\n' && ch != EOF && k < BUFSIZE) ++ while ((ch = getchar ()) != '\n' && ch != EOF && k < BUFSIZE-1) + charbuf[k++] = ch; + if (ch == EOF && k == 0) + break; diff --git a/SPECS/liblouis.spec b/SPECS/liblouis.spec new file mode 100644 index 0000000..574b238 --- /dev/null +++ b/SPECS/liblouis.spec @@ -0,0 +1,359 @@ +%if !( 0%{?rhel} > 0 && 0%{?rhel} <= 7) +# Turn off the brp-python-bytecompile script +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +%endif + +%if 0%{?rhel} > 7 +# Disable python2 build by default +%bcond_with python2 +%else +%bcond_without python2 +%endif + +Name: liblouis +Version: 2.6.2 +Release: 16%{?dist} +Summary: Braille translation and back-translation library + +Group: System Environment/Libraries +License: LGPLv3+ +URL: http://liblouis.org +Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz +# Backported upstream patch to fix the build with texinfo 6.0 +Patch0: 0001-Update-configure.ac-to-reconize-texi2any.patch +# security patch taken from +# https://git.centos.org/raw/rpms/liblouis.git/9f94aa24d3308691c575e2659e42321f4aff1cf3/SOURCES!security-fixes.patch +# fixes CVE-2014-8184, CVE-2017-13738, CVE-2017-13740, CVE-2017-13741, CVE-2017-13742, CVE-2017-13743, CVE-2017-13744 +Patch1: %{name}-security-fixes.patch + +BuildRequires: chrpath +BuildRequires: help2man +BuildRequires: texinfo +BuildRequires: texinfo-tex +%if %{with python2} +BuildRequires: python2-devel +%endif # with python2 +BuildRequires: python3-devel + +# For patch0 +BuildRequires: autoconf automake libtool + +Requires(post): info +Requires(preun): info + +# gnulib is a copylib that has been granted an exception from the no-bundled-libraries policy +# http://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Copylibs +Provides: bundled(gnulib) = 20130621 + +%description +Liblouis is an open-source braille translator and back-translator named in +honor of Louis Braille. It features support for computer and literary braille, +supports contracted and uncontracted translation for many languages and has +support for hyphenation. New languages can easily be added through tables that +support a rule- or dictionary based approach. Liblouis also supports math +braille (Nemeth and Marburg). + +Liblouis has features to support screen-reading programs. This has led to its +use in two open-source screen readers, NVDA and Orca. It is also used in some +commercial assistive technology applications for example by ViewPlus. + +Liblouis is based on the translation routines in the BRLTTY screen reader for +Linux. It has, however, gone far beyond these routines. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package utils +Summary: Command-line utilities to test %{name} +Group: Applications/Text +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-louis = %{version}-%{release} +License: GPLv3+ + +%description utils +Six test programs are provided as part of the liblouis package. They +are intended for testing liblouis and for debugging tables. None of +them is suitable for braille transcription. + +%if %{with python2} +%package -n python2-louis +Summary: Python 2 language bindings for %{name} +Group: Development/Languages +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +Obsoletes: %{name}-python < 2.6.2-3 +Provides: %{name}-python = %{version}-%{release} +%{?python_provide:%python_provide python2-louis} + +%description -n python2-louis +This package provides Python 2 language bindings for %{name}. +%endif # with python2 + +%package -n python3-louis +Summary: Python 3 language bindings for %{name} +Group: Development/Languages +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +Obsoletes: %{name}-python3 < 2.6.2-3 +Provides: %{name}-python3 = %{version}-%{release} +%{?python_provide:%python_provide python3-louis} + +%description -n python3-louis +This package provides Python 3 language bindings for %{name}. + + +%package doc +Summary: Documentation for %{name} +Group: Documentation +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +This package provides the documentation for liblouis. + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 + +# For patch0 +autoreconf -fi + +# Change the shebang of check_doctests to point to python3 +pathfix.py -i "%{__python3}" -pn \ +tests/check_doctests.py + +%build +%configure --disable-static --enable-ucs4 +make %{?_smp_mflags} +make -C doc %{name}.pdf + + +%check +make check + + +%install +make install DESTDIR=%{buildroot} +rm -f %{buildroot}/%{_infodir}/dir +rm -f %{buildroot}/%{_libdir}/%{name}.la +rm -rf %{buildroot}/%{_defaultdocdir}/%{name}/ +cd python/louis + +%if %{with python2} +install -d %{buildroot}%{python2_sitelib}/louis +install -pm 0644 __init__.py %{buildroot}%{python2_sitelib}/louis/ +%endif # with python2 + +%if !( 0%{?rhel} > 0 && 0%{?rhel} <= 7) +%if %{with python2} +%py_byte_compile %{__python} %{buildroot}%{python2_sitelib}/louis/ +%endif # with python2 + +install -d %{buildroot}%{python3_sitelib}/louis +install -pm 0644 __init__.py %{buildroot}%{python3_sitelib}/louis/ +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/louis/ +%endif + +# Remove Rpaths from the executables. We must do that in the %%install section +# because, otherwise, the test suite wouldn't build. +for f in `find %{buildroot}%{_bindir} -exec file {} \; | grep 'ELF.*executable' | cut -d: -f1`; do + chrpath --delete $f +done + + +%post +/sbin/ldconfig +/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || : + + +%postun -p /sbin/ldconfig + + +%preun +if [ $1 = 0 ] ; then + /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || : +fi + + +%files +%doc README COPYING.LESSER AUTHORS NEWS ChangeLog TODO +%{_libdir}/%{name}.so.* +%{_datadir}/%{name}/ +%{_infodir}/%{name}.info* + +%files devel +%doc HACKING +%{_includedir}/%{name}/ +%{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/%{name}.so + +%files utils +%doc COPYING +%{_bindir}/lou_* +%{_mandir}/man1/lou_*.1* + +%if %{with python2} +%files -n python2-louis +%doc python/README +%{python2_sitelib}/louis/ +%endif # with python2 + +%if !( 0%{?rhel} > 0 && 0%{?rhel} <= 7) +%files -n python3-louis +%{python3_sitelib}/louis/ +%endif + +%files doc +%doc doc/%{name}.{html,txt,pdf} + + +%changelog +* Thu Jun 07 2018 Charalampos Stratakis - 2.6.2-16 +- Conditionalize the python2 subpackage + +* Wed Feb 07 2018 Fedora Release Engineering - 2.6.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 09 2018 Iryna Shcherbina - 2.6.2-14 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek - 2.6.2-13 +- Python 2 binary package renamed to python2-louis + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Fri Nov 03 2017 Martin Gieseking - 2.6.2-12 +- Applied security fixes from EL 7.4 (CVE-2014-8184, CVE-2017-13738, CVE-2017-13740, CVE-2017-13741, CVE-2017-13742, CVE-2017-13743, CVE-2017-13744) +- Dropped redundant parts of the spec file. +- Updated URL. + +* Thu Aug 03 2017 Fedora Release Engineering - 2.6.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.6.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Feb 15 2017 Igor Gnatenko - 2.6.2-9 +- Rebuild for brp-python-bytecompile + +* Fri Feb 10 2017 Fedora Release Engineering - 2.6.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 2.6.2-7 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 2.6.2-6 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 2.6.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Nov 10 2015 Fedora Release Engineering - 2.6.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Sun Aug 23 2015 Kalev Lember - 2.6.2-3 +- Rename liblouis-python3 to python3-louis, as per latest packaging guidelines +- Fix the build with texinfo 6.0 + +* Wed Jun 17 2015 Fedora Release Engineering - 2.6.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Apr 08 2015 Martin Gieseking 2.6.2-1 +- Updated to new upstream release. + +* Tue Sep 16 2014 Martin Gieseking 2.6.0-1 +- Updated to new upstream release. + +* Mon Aug 18 2014 Martin Gieseking 2.5.4-5 +- Fixed check for ELF binaries to prevent chrpath from failing. + +* Sun Aug 17 2014 Fedora Release Engineering - 2.5.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 2.5.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 27 2014 Kalev Lember - 2.5.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Tue May 13 2014 Martin Gieseking 2.5.4-1 +- Updated to new upstream release. +- Activated the bundled test suite which has been adapted to work correctly with the recent release. +- Remove Rpaths from the utility programs. +- Updated the description according to the upstream website. + +* Sat Aug 03 2013 Fedora Release Engineering - 2.5.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jul 22 2013 Martin Gieseking - 2.5.3-1 +- Update to new upstream release. + +* Thu Jul 18 2013 Matthias Clasen - 2.5.2-7 +- Tighten dependencies between subpackages (pointed out by rpmdiff) + +* Tue Apr 16 2013 Martin Gieseking 2.5.2-6 +- Restrict exclusion of Python 3 packages to RHEL <= 7. + +* Mon Apr 15 2013 Martin Gieseking 2.5.2-5 +- Restrict exclusion of Python 3 packages to RHEL < 7. + +* Mon Apr 15 2013 Rui Matos - 2.5.2-4 +- Don't depend on python3 in RHEL. + +* Tue Feb 26 2013 Martin Gieseking 2.5.2-3 +- Added Python 3 language bindings. + +* Fri Feb 22 2013 Martin Gieseking 2.5.2-2 +- Moved documentation to doc subpackage. + +* Wed Feb 06 2013 Martin Gieseking 2.5.2-1 +- Updated to new upstream release. + +* Thu Jul 19 2012 Fedora Release Engineering - 2.4.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Mar 10 2012 Martin Gieseking 2.4.1-1 +- Updated to upstream release 2.4.1. +- Made the devel package's dependency on the base package arch specific. + +* Fri Jan 13 2012 Fedora Release Engineering - 2.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Dec 12 2011 Martin Gieseking 2.4.0-1 +- Updated to upstream release 2.4.0. + +* Fri May 20 2011 Martin Gieseking 2.3.0-1 +- Updated to upstream release 2.3.0. + +* Mon Feb 28 2011 Martin Gieseking - 2.2.0-2 +- Added release date of bundled gnulib to Provides. +- Use %%{name} macro consistently. + +* Tue Feb 15 2011 Martin Gieseking - 2.2.0-1 +- Updated to upstream release 2.2.0. +- Added Python bindings. + +* Mon Jul 5 2010 Lars Bjørndal - 1.9.0-2 +- In advice from Martin Gieseking: Removed some garbage from the file section, and added a PDF version of the liblouis documentation. See . + +* Wed Jun 30 2010 Lars Bjørndal - 1.9.0-1 +- A new version was up to day. At the same time, fixed a minor spec issue according to a comment from Martin Gieseking, see . + +* Sun Jun 20 2010 Lars Bjørndal - 1.8.0-3 +- Fixed some small problems, among them wrong destination directory for documentation. See for further details. + +* Thu Jun 17 2010 Lars Bjørndal 1.8.0-2 +- Created the tools sub package and did a lot of clean ups, see . + +* Sat May 29 2010 Lars Bjørndal 1.8.0-1 +- Create the RPM for Fedora.