diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 07:49:34 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 07:49:34 +0000 |
| commit | abd3a61039edbd72017da10a655cfe1379603b90 (patch) | |
| tree | 7cd9e7bd1250a57f31c730809d4a6d6700824b80 /python-pretextbook.spec | |
| parent | 891bd850c20597433e16e9c61bffc803019704f8 (diff) | |
automatic import of python-pretextbook
Diffstat (limited to 'python-pretextbook.spec')
| -rw-r--r-- | python-pretextbook.spec | 345 |
1 files changed, 345 insertions, 0 deletions
diff --git a/python-pretextbook.spec b/python-pretextbook.spec new file mode 100644 index 0000000..3b30920 --- /dev/null +++ b/python-pretextbook.spec @@ -0,0 +1,345 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pretextbook +Version: 0.8.3 +Release: 1 +Summary: A package to author, build, and deploy PreTeXt projects. +License: GPL-3.0-or-later +URL: https://pypi.org/project/pretextbook/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/61/60/0b594990c1fcbf9a90408207a711b345508b0d3ae813a4813b0ea02a1d8f/pretextbook-0.8.3.tar.gz +BuildArch: noarch + +Requires: python3-lxml +Requires: python3-requests +Requires: python3-watchdog +Requires: python3-GitPython +Requires: python3-click +Requires: python3-pdfCropMargins +Requires: python3-PyPDF2 +Requires: python3-click-log +Requires: python3-ghp-import +Requires: python3-single-version +Requires: python3-CodeChat-Server +Requires: python3-pyppeteer + +%description +# PreTeXt-CLI +A package for authoring and building [PreTeXt](https://pretextbook.org) documents. +- GitHub: <https://github.com/PreTeXtBook/pretext-cli/> +## Documentation and examples for authors/publishers +Most documentation for PreTeXt authors and publishers is available at: +- <https://pretextbook.org/doc/guide/html/> +Authors and publishers may also find the examples catalog useful as well: +- <https://pretextbook.org/examples.html> +We have a few notes below (TODO: publish these in the Guide). +### Installation +#### Installing Python +PreTeXt-CLI requires the Python version specified in `pyproject.toml`. +To check your version, type this into your terminal or command prompt: +``` +python -V +``` +If your version is 2.x, try this instead +(and if so, either replace all future references to `python` +in these instructions with `python3`). +``` +python3 -V +``` +If you don't have a compatible Python available, try one of these: +- https://www.python.org/downloads/ + - Windows warning: Be sure to select the option adding Python to your Path. +- https://github.com/pyenv/pyenv#installation (Mac/Linux) +- https://github.com/pyenv-win/pyenv-win#installation (Windows) +#### Installing PreTeXt-CLI +Once you've confirmed that you're using a valid version of Python, just +run (replacing `python` with `python3` if necessary): +``` +python -m pip install --user pretextbook +``` +(It's also possible you may get an error like +`error: invalid command 'bdist_wheel'` +— good news, you can ignore it!) +After installation, try to run: +``` +pretext --help +``` +If that works, great! Otherwise, it likely means that Python packages +aren't available on your “PATH”. In that case, replace all `pretext` +commands with `python -m pretext` instead: +``` +python -m pretext --help +``` +Either way, you're now ready to use the CLI, the `--help` option will explain how to use all the different +subcommands like `pretext new` and `pretext build`. +#### External dependencies +We install as much as we can with the `pip install` command, but depending on your machine +you may require some extra software: +- [TeXLive](https://www.tug.org/texlive/) +- [pdftoppm/Ghostscript](https://github.com/abarker/pdfCropMargins/blob/master/doc/installing_pdftoppm_and_ghostscript.rst) +#### Upgrading PreTeXt-CLI +If you have an existing installation and you want to upgrade to a more recent version, you can run: +``` +python -m pip install --upgrade pretextbook +``` +#### Custom XSL +Custom XSL is not encouraged for most authors, but (for example) developers working +bleeding-edge XSL from core PreTeXt may want to call XSL different from that +which is shipped with a fixed version of the CLI. This may be accomplished by +adding an `<xsl/>` element to your target with a relative (to `project.ptx`) or +absolute path to the desired XSL. *(Note: this XSL must only import +other XSL files in the same directory or within subdirectories.)* +For example: +``` +<target name="html"> + <format>html</format> + <source>source/main.ptx</source> + <publication>publication/publication.ptx</publication> + <output-dir>output/html</output-dir> + <xsl>../pretext/xsl/pretext-html.xsl</xsl> +</target> +``` +If your custom XSL file needs to import the XSL +shipped with the CLI (e.g. `pretext-common.xsl`), then use a `./core/` +prefix in your custom XSL's `xsl:import@href` as follows: +``` +<xsl:import href="./core/pretext-common.xsl"/> +``` +Similarly, `entities.ent` may be used: +``` +<!DOCTYPE xsl:stylesheet [ + <!ENTITY % entities SYSTEM "./core/entities.ent"> + %entities; +]> +``` + +%package -n python3-pretextbook +Summary: A package to author, build, and deploy PreTeXt projects. +Provides: python-pretextbook +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pretextbook +# PreTeXt-CLI +A package for authoring and building [PreTeXt](https://pretextbook.org) documents. +- GitHub: <https://github.com/PreTeXtBook/pretext-cli/> +## Documentation and examples for authors/publishers +Most documentation for PreTeXt authors and publishers is available at: +- <https://pretextbook.org/doc/guide/html/> +Authors and publishers may also find the examples catalog useful as well: +- <https://pretextbook.org/examples.html> +We have a few notes below (TODO: publish these in the Guide). +### Installation +#### Installing Python +PreTeXt-CLI requires the Python version specified in `pyproject.toml`. +To check your version, type this into your terminal or command prompt: +``` +python -V +``` +If your version is 2.x, try this instead +(and if so, either replace all future references to `python` +in these instructions with `python3`). +``` +python3 -V +``` +If you don't have a compatible Python available, try one of these: +- https://www.python.org/downloads/ + - Windows warning: Be sure to select the option adding Python to your Path. +- https://github.com/pyenv/pyenv#installation (Mac/Linux) +- https://github.com/pyenv-win/pyenv-win#installation (Windows) +#### Installing PreTeXt-CLI +Once you've confirmed that you're using a valid version of Python, just +run (replacing `python` with `python3` if necessary): +``` +python -m pip install --user pretextbook +``` +(It's also possible you may get an error like +`error: invalid command 'bdist_wheel'` +— good news, you can ignore it!) +After installation, try to run: +``` +pretext --help +``` +If that works, great! Otherwise, it likely means that Python packages +aren't available on your “PATH”. In that case, replace all `pretext` +commands with `python -m pretext` instead: +``` +python -m pretext --help +``` +Either way, you're now ready to use the CLI, the `--help` option will explain how to use all the different +subcommands like `pretext new` and `pretext build`. +#### External dependencies +We install as much as we can with the `pip install` command, but depending on your machine +you may require some extra software: +- [TeXLive](https://www.tug.org/texlive/) +- [pdftoppm/Ghostscript](https://github.com/abarker/pdfCropMargins/blob/master/doc/installing_pdftoppm_and_ghostscript.rst) +#### Upgrading PreTeXt-CLI +If you have an existing installation and you want to upgrade to a more recent version, you can run: +``` +python -m pip install --upgrade pretextbook +``` +#### Custom XSL +Custom XSL is not encouraged for most authors, but (for example) developers working +bleeding-edge XSL from core PreTeXt may want to call XSL different from that +which is shipped with a fixed version of the CLI. This may be accomplished by +adding an `<xsl/>` element to your target with a relative (to `project.ptx`) or +absolute path to the desired XSL. *(Note: this XSL must only import +other XSL files in the same directory or within subdirectories.)* +For example: +``` +<target name="html"> + <format>html</format> + <source>source/main.ptx</source> + <publication>publication/publication.ptx</publication> + <output-dir>output/html</output-dir> + <xsl>../pretext/xsl/pretext-html.xsl</xsl> +</target> +``` +If your custom XSL file needs to import the XSL +shipped with the CLI (e.g. `pretext-common.xsl`), then use a `./core/` +prefix in your custom XSL's `xsl:import@href` as follows: +``` +<xsl:import href="./core/pretext-common.xsl"/> +``` +Similarly, `entities.ent` may be used: +``` +<!DOCTYPE xsl:stylesheet [ + <!ENTITY % entities SYSTEM "./core/entities.ent"> + %entities; +]> +``` + +%package help +Summary: Development documents and examples for pretextbook +Provides: python3-pretextbook-doc +%description help +# PreTeXt-CLI +A package for authoring and building [PreTeXt](https://pretextbook.org) documents. +- GitHub: <https://github.com/PreTeXtBook/pretext-cli/> +## Documentation and examples for authors/publishers +Most documentation for PreTeXt authors and publishers is available at: +- <https://pretextbook.org/doc/guide/html/> +Authors and publishers may also find the examples catalog useful as well: +- <https://pretextbook.org/examples.html> +We have a few notes below (TODO: publish these in the Guide). +### Installation +#### Installing Python +PreTeXt-CLI requires the Python version specified in `pyproject.toml`. +To check your version, type this into your terminal or command prompt: +``` +python -V +``` +If your version is 2.x, try this instead +(and if so, either replace all future references to `python` +in these instructions with `python3`). +``` +python3 -V +``` +If you don't have a compatible Python available, try one of these: +- https://www.python.org/downloads/ + - Windows warning: Be sure to select the option adding Python to your Path. +- https://github.com/pyenv/pyenv#installation (Mac/Linux) +- https://github.com/pyenv-win/pyenv-win#installation (Windows) +#### Installing PreTeXt-CLI +Once you've confirmed that you're using a valid version of Python, just +run (replacing `python` with `python3` if necessary): +``` +python -m pip install --user pretextbook +``` +(It's also possible you may get an error like +`error: invalid command 'bdist_wheel'` +— good news, you can ignore it!) +After installation, try to run: +``` +pretext --help +``` +If that works, great! Otherwise, it likely means that Python packages +aren't available on your “PATH”. In that case, replace all `pretext` +commands with `python -m pretext` instead: +``` +python -m pretext --help +``` +Either way, you're now ready to use the CLI, the `--help` option will explain how to use all the different +subcommands like `pretext new` and `pretext build`. +#### External dependencies +We install as much as we can with the `pip install` command, but depending on your machine +you may require some extra software: +- [TeXLive](https://www.tug.org/texlive/) +- [pdftoppm/Ghostscript](https://github.com/abarker/pdfCropMargins/blob/master/doc/installing_pdftoppm_and_ghostscript.rst) +#### Upgrading PreTeXt-CLI +If you have an existing installation and you want to upgrade to a more recent version, you can run: +``` +python -m pip install --upgrade pretextbook +``` +#### Custom XSL +Custom XSL is not encouraged for most authors, but (for example) developers working +bleeding-edge XSL from core PreTeXt may want to call XSL different from that +which is shipped with a fixed version of the CLI. This may be accomplished by +adding an `<xsl/>` element to your target with a relative (to `project.ptx`) or +absolute path to the desired XSL. *(Note: this XSL must only import +other XSL files in the same directory or within subdirectories.)* +For example: +``` +<target name="html"> + <format>html</format> + <source>source/main.ptx</source> + <publication>publication/publication.ptx</publication> + <output-dir>output/html</output-dir> + <xsl>../pretext/xsl/pretext-html.xsl</xsl> +</target> +``` +If your custom XSL file needs to import the XSL +shipped with the CLI (e.g. `pretext-common.xsl`), then use a `./core/` +prefix in your custom XSL's `xsl:import@href` as follows: +``` +<xsl:import href="./core/pretext-common.xsl"/> +``` +Similarly, `entities.ent` may be used: +``` +<!DOCTYPE xsl:stylesheet [ + <!ENTITY % entities SYSTEM "./core/entities.ent"> + %entities; +]> +``` + +%prep +%autosetup -n pretextbook-0.8.3 + +%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-pretextbook -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.8.3-1 +- Package Spec generated |
