summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-ModulemdTranslationHelpers.spec297
-rw-r--r--sources1
3 files changed, 299 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..431b7cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ModulemdTranslationHelpers-0.6.tar.gz
diff --git a/python-ModulemdTranslationHelpers.spec b/python-ModulemdTranslationHelpers.spec
new file mode 100644
index 0000000..a744157
--- /dev/null
+++ b/python-ModulemdTranslationHelpers.spec
@@ -0,0 +1,297 @@
+%global _empty_manifest_terminate_build 0
+Name: python-ModulemdTranslationHelpers
+Version: 0.6
+Release: 1
+Summary: Tools for working with translations of modulemd
+License: MIT
+URL: https://github.com/fedora-modularity/ModulemdTranslationHelpers
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d6/2b/ba3a7cff487ecc3156b25e712fc475db0f78d7d540aac5c877961a2df736/ModulemdTranslationHelpers-0.6.tar.gz
+BuildArch: noarch
+
+Requires: python3-click
+Requires: python3-requests
+Requires: python3-babel
+
+%description
+# ModulemdTranslationHelpers
+## Prerequisites
+* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
+* [koji](https://pagure.io/koji)
+
+To install on Fedora 28+, run:
+```
+dnf install libmodulemd koji
+```
+
+## Installation
+With the prerequisites installed, the latest version can be installed with
+`pip install ModulemdTranslationHelpers` or on Fedora 28+ with `dnf install
+python3-ModulemdTranslationHelpers` (recommended).
+
+## CLI Usage
+
+### Extract Translatable Strings
+To extract translatable strings from modules for a particular Fedora
+release (e.g. f29):
+```
+ModulemdTranslationHelpers --branch f29 extract [--pot-file <path>]
+```
+This will read all of the module metadata from the Koji build-system and
+convert the translatable strings to a portable object template (`.pot`)
+document.
+
+Specify the destination for the output file with `--pot-file`.
+
+ ### Produce modulemd-translations YAML
+ To convert portable object (`.po`) files into
+ modulemd-translations YAML documents that can be included in repodata:
+ ```
+ ModulemdTranslationHelpers --branch f29 generate_metadata \
+ [--pofile-dir <path>] \
+ [--yaml-file <path>]
+
+ ```
+
+ This will read all files with a `.po` suffix in the `pofile-dir` path and
+ write the modulemd YAML to `yaml-file`.
+
+## API
+### ModulemdTranslationHelpers
+The ModulemdTranslationHelpers package has two primary functions:
+* get_module_catalog_from_tags()
+* get_modulemd_translations()
+
+#### ModulemdTranslationHelpers.get_module_catalog_from_tags()
+This returns a `babel.message.Catalog` object containing all of the
+translatable strings from any module tagged with one of the passed tags. It
+can be passed to `babel.messages.pofile.write_po()` to create a portable
+object template (`.pot`) file.
+
+#### ModulemdTranslationHelpers.get_modulemd_translations()
+This returns an iterable of modulemd-translation objects generated from a
+set of paths to portable object (`.po`) files containing translation
+information.
+
+### ModulemdTranslationHelpers.Fedora
+This package provides helper routines for dealing with translations in Fedora
+Modules.
+
+#### ModulemdTranslationHelpers.Fedora.KOJI_URL
+The URL to the standard Fedora Koji instance.
+
+#### ModulemdTranslationHelpers.Fedora.get_fedora_rawhide_version()
+Looks up which Fedora version the current Rawhide branch will become.
+
+#### ModulemdTranslationHelpers.Fedora.get_tags_for_fedora_branch()
+Gets the list of tags for modules in a given Fedora branch. (For rawhide,
+make sure to use the value returned from get_fedora_rawhide_version.)
+
+
+
+
+%package -n python3-ModulemdTranslationHelpers
+Summary: Tools for working with translations of modulemd
+Provides: python-ModulemdTranslationHelpers
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-ModulemdTranslationHelpers
+# ModulemdTranslationHelpers
+## Prerequisites
+* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
+* [koji](https://pagure.io/koji)
+
+To install on Fedora 28+, run:
+```
+dnf install libmodulemd koji
+```
+
+## Installation
+With the prerequisites installed, the latest version can be installed with
+`pip install ModulemdTranslationHelpers` or on Fedora 28+ with `dnf install
+python3-ModulemdTranslationHelpers` (recommended).
+
+## CLI Usage
+
+### Extract Translatable Strings
+To extract translatable strings from modules for a particular Fedora
+release (e.g. f29):
+```
+ModulemdTranslationHelpers --branch f29 extract [--pot-file <path>]
+```
+This will read all of the module metadata from the Koji build-system and
+convert the translatable strings to a portable object template (`.pot`)
+document.
+
+Specify the destination for the output file with `--pot-file`.
+
+ ### Produce modulemd-translations YAML
+ To convert portable object (`.po`) files into
+ modulemd-translations YAML documents that can be included in repodata:
+ ```
+ ModulemdTranslationHelpers --branch f29 generate_metadata \
+ [--pofile-dir <path>] \
+ [--yaml-file <path>]
+
+ ```
+
+ This will read all files with a `.po` suffix in the `pofile-dir` path and
+ write the modulemd YAML to `yaml-file`.
+
+## API
+### ModulemdTranslationHelpers
+The ModulemdTranslationHelpers package has two primary functions:
+* get_module_catalog_from_tags()
+* get_modulemd_translations()
+
+#### ModulemdTranslationHelpers.get_module_catalog_from_tags()
+This returns a `babel.message.Catalog` object containing all of the
+translatable strings from any module tagged with one of the passed tags. It
+can be passed to `babel.messages.pofile.write_po()` to create a portable
+object template (`.pot`) file.
+
+#### ModulemdTranslationHelpers.get_modulemd_translations()
+This returns an iterable of modulemd-translation objects generated from a
+set of paths to portable object (`.po`) files containing translation
+information.
+
+### ModulemdTranslationHelpers.Fedora
+This package provides helper routines for dealing with translations in Fedora
+Modules.
+
+#### ModulemdTranslationHelpers.Fedora.KOJI_URL
+The URL to the standard Fedora Koji instance.
+
+#### ModulemdTranslationHelpers.Fedora.get_fedora_rawhide_version()
+Looks up which Fedora version the current Rawhide branch will become.
+
+#### ModulemdTranslationHelpers.Fedora.get_tags_for_fedora_branch()
+Gets the list of tags for modules in a given Fedora branch. (For rawhide,
+make sure to use the value returned from get_fedora_rawhide_version.)
+
+
+
+
+%package help
+Summary: Development documents and examples for ModulemdTranslationHelpers
+Provides: python3-ModulemdTranslationHelpers-doc
+%description help
+# ModulemdTranslationHelpers
+## Prerequisites
+* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
+* [koji](https://pagure.io/koji)
+
+To install on Fedora 28+, run:
+```
+dnf install libmodulemd koji
+```
+
+## Installation
+With the prerequisites installed, the latest version can be installed with
+`pip install ModulemdTranslationHelpers` or on Fedora 28+ with `dnf install
+python3-ModulemdTranslationHelpers` (recommended).
+
+## CLI Usage
+
+### Extract Translatable Strings
+To extract translatable strings from modules for a particular Fedora
+release (e.g. f29):
+```
+ModulemdTranslationHelpers --branch f29 extract [--pot-file <path>]
+```
+This will read all of the module metadata from the Koji build-system and
+convert the translatable strings to a portable object template (`.pot`)
+document.
+
+Specify the destination for the output file with `--pot-file`.
+
+ ### Produce modulemd-translations YAML
+ To convert portable object (`.po`) files into
+ modulemd-translations YAML documents that can be included in repodata:
+ ```
+ ModulemdTranslationHelpers --branch f29 generate_metadata \
+ [--pofile-dir <path>] \
+ [--yaml-file <path>]
+
+ ```
+
+ This will read all files with a `.po` suffix in the `pofile-dir` path and
+ write the modulemd YAML to `yaml-file`.
+
+## API
+### ModulemdTranslationHelpers
+The ModulemdTranslationHelpers package has two primary functions:
+* get_module_catalog_from_tags()
+* get_modulemd_translations()
+
+#### ModulemdTranslationHelpers.get_module_catalog_from_tags()
+This returns a `babel.message.Catalog` object containing all of the
+translatable strings from any module tagged with one of the passed tags. It
+can be passed to `babel.messages.pofile.write_po()` to create a portable
+object template (`.pot`) file.
+
+#### ModulemdTranslationHelpers.get_modulemd_translations()
+This returns an iterable of modulemd-translation objects generated from a
+set of paths to portable object (`.po`) files containing translation
+information.
+
+### ModulemdTranslationHelpers.Fedora
+This package provides helper routines for dealing with translations in Fedora
+Modules.
+
+#### ModulemdTranslationHelpers.Fedora.KOJI_URL
+The URL to the standard Fedora Koji instance.
+
+#### ModulemdTranslationHelpers.Fedora.get_fedora_rawhide_version()
+Looks up which Fedora version the current Rawhide branch will become.
+
+#### ModulemdTranslationHelpers.Fedora.get_tags_for_fedora_branch()
+Gets the list of tags for modules in a given Fedora branch. (For rawhide,
+make sure to use the value returned from get_fedora_rawhide_version.)
+
+
+
+
+%prep
+%autosetup -n ModulemdTranslationHelpers-0.6
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-ModulemdTranslationHelpers -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Mar 06 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..d99513f
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+cebfc3cfe0b615f3e2f091fe72821e5a ModulemdTranslationHelpers-0.6.tar.gz