From d84568c3ea3c7d78d3ab034159988dd898722091 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 02 2019 12:43:03 +0000 Subject: import itstool-2.0.4-2.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a582dc9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/itstool-2.0.4.tar.bz2 diff --git a/.itstool.metadata b/.itstool.metadata new file mode 100644 index 0000000..1dc6b82 --- /dev/null +++ b/.itstool.metadata @@ -0,0 +1 @@ +5345615becb5c463c6e7f2462e387fdc327f3a35 SOURCES/itstool-2.0.4.tar.bz2 diff --git a/SOURCES/fix-segfaults.patch b/SOURCES/fix-segfaults.patch new file mode 100644 index 0000000..e76dd2e --- /dev/null +++ b/SOURCES/fix-segfaults.patch @@ -0,0 +1,48 @@ +diff --git a/itstool.in b/itstool.in +index c1d0585..a16eba9 100755 +--- a/itstool.in ++++ b/itstool.in +@@ -477,6 +477,7 @@ class Document (object): + if load_dtd: + ctxt.loadSubset(1) + if keep_entities: ++ ctxt.loadSubset(1) + ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD) + ctxt.replaceEntities(0) + else: +@@ -1043,6 +1044,7 @@ class Document (object): + if self._load_dtd: + ctxt.loadSubset(1) + if self._keep_entities: ++ ctxt.loadSubset(1) + ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD) + ctxt.replaceEntities(0) + else: +@@ -1069,7 +1071,9 @@ class Document (object): + ph_node = msg.get_placeholder(child.name).node + if self.has_child_elements(ph_node): + self.merge_translations(translations, None, ph_node, strict=strict) +- child.replaceNode(ph_node) ++ newnode = ph_node.copyNode(1) ++ newnode.setTreeDoc(self._doc) ++ child.replaceNode(newnode) + else: + repl = self.get_translated(ph_node, translations, strict=strict, lang=lang) + child.replaceNode(repl) +@@ -1084,10 +1088,15 @@ class Document (object): + (lang + ' ') if lang is not None else '', + msgstr.encode('utf-8'))) + self._xml_err = '' ++ ctxt.doc().freeDoc() + return node + retnode = node.copyNode(2) ++ retnode.setTreeDoc(self._doc) + for child in xml_child_iter(trnode): +- retnode.addChild(child.copyNode(1)) ++ newnode = child.copyNode(1) ++ newnode.setTreeDoc(self._doc) ++ retnode.addChild(newnode) ++ + ctxt.doc().freeDoc() + return retnode + diff --git a/SPECS/itstool.spec b/SPECS/itstool.spec new file mode 100644 index 0000000..d2fca43 --- /dev/null +++ b/SPECS/itstool.spec @@ -0,0 +1,107 @@ +Name: itstool +Version: 2.0.4 +Release: 2%{?dist} +Summary: ITS-based XML translation tool + +Group: Development/Tools +License: GPLv3+ +URL: http://itstool.org/ +Source0: http://files.itstool.org/itstool/%{name}-%{version}.tar.bz2 +# An issue with libxml2 is causing segfaults for packages using +# itstool. Backported the workaround from upstream. +# https://github.com/itstool/itstool/commit/9b84c007a73e8275ca45762f1bfa3ab7c3a852e2 +Patch0: fix-segfaults.patch + +BuildArch: noarch + +BuildRequires: python3-libxml2 +BuildRequires: python3-devel +Requires: python3-libxml2 + +%description +ITS Tool allows you to translate XML documents with PO files, using rules from +the W3C Internationalization Tag Set (ITS) to determine what to translate and +how to separate it into PO file messages. + +%prep +%setup -q +%patch0 -p1 + +%build +export PYTHON=%{__python3} +%configure +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +%files +%doc COPYING COPYING.GPL3 NEWS +%{_bindir}/itstool +%{_datadir}/itstool +%doc %{_mandir}/man1/itstool.1.gz + +%changelog +* Mon Jul 16 2018 Charalampos Stratakis - 2.0.4-2 +- Fix libxml2 related segfaults + +* Sun Jul 08 2018 Charalampos Stratakis - 2.0.4-1 +- Update to 2.0.4 +- Change to python3 + +* Mon Feb 05 2018 Petr Viktorin - 2.0.2-8 +- Be more explicit about Python build dependencies + (Require python2-devel, tell autotools that PYTHON is python2) + +* Wed Jul 26 2017 Fedora Release Engineering - 2.0.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 2.0.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jan 18 2017 Merlin Mathesius - 2.0.2-5 +- Add BuildRequires: python to fix FTBFS (BZ#1414545). + +* Thu Feb 04 2016 Fedora Release Engineering - 2.0.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 2.0.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 2.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat May 17 2014 Kalev Lember - 2.0.2-1 +- Update to 2.0.2 + +* Sat Aug 03 2013 Fedora Release Engineering - 1.2.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 1.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 02 2012 Kalev Lember 1.2.0-1 +- Update to 1.2.0 + +* Wed Mar 21 2012 Kalev Lember 1.1.2-1 +- Update to itstool 1.1.2 + +* Fri Jan 13 2012 Fedora Release Engineering - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Sep 19 2011 Shaun McCance 1.1.1-1 +- Update to itstool 1.1.1 + +* Sun Aug 07 2011 Rahul Sundaram 1.1.0-2 +- Add requires on libxml2-python since itstool uses it +- Drop redundant defattr +- Add NEWS to doc + +* Mon Jun 27 2011 Shaun McCance 1.1.0-1 +- Update to itstool 1.1.0 + +* Sun May 8 2011 Shaun McCance 1.0.1-1 +- Initial packaging