diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 9f12886..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# itstool - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index b048a21..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# itstool - -#### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/fix-segfaults.patch b/fix-segfaults.patch new file mode 100644 index 0000000..e76dd2e --- /dev/null +++ b/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/itstool-2.0.4.tar.bz2 b/itstool-2.0.4.tar.bz2 new file mode 100644 index 0000000..7fdc09c Binary files /dev/null and b/itstool-2.0.4.tar.bz2 differ diff --git a/itstool.spec b/itstool.spec new file mode 100644 index 0000000..4db5811 --- /dev/null +++ b/itstool.spec @@ -0,0 +1,46 @@ +Name: itstool +Version: 2.0.4 +Release: 5 +Summary: ITS-based XML translation tool +License: GPLv3+ +URL: http://itstool.org/ +Source0: http://files.itstool.org/itstool/%{name}-%{version}.tar.bz2 +Patch0: fix-segfaults.patch +BuildArch: noarch + +BuildRequires: python3-libxml2 python3-devel git +Requires: python3-libxml2 + +%description +ITS Tool allows you to translate your 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 + +%package help +Summary: Help manual for %{name} + +%description help +The %{name}-help package conatins man manual etc + +%prep +%autosetup -n %{name}-%{version} -p1 -Sgit + +%build +export PYTHON=%{__python3} +%configure +%make_build + +%install +%make_install + +%files +%license COPYING COPYING.GPL3 +%{_bindir}/itstool +%{_datadir}/itstool + +%files help +%doc NEWS +%doc %{_mandir}/man1/itstool.1.gz + +%changelog +* Tue Dec 3 2019 openEuler Buildteam - 2.0.4-5 +- Package init