diff options
Diffstat (limited to 'python-bibleorgsys.spec')
-rw-r--r-- | python-bibleorgsys.spec | 456 |
1 files changed, 456 insertions, 0 deletions
diff --git a/python-bibleorgsys.spec b/python-bibleorgsys.spec new file mode 100644 index 0000000..0d9c703 --- /dev/null +++ b/python-bibleorgsys.spec @@ -0,0 +1,456 @@ +%global _empty_manifest_terminate_build 0 +Name: python-BibleOrgSys +Version: 0.0.20 +Release: 1 +Summary: Bible Organisational System — load, check, and/or export Bible files/folders +License: GPLv3 +URL: http://Freely-Given.org/Software/BibleOrganisationalSystem/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e2/22/aa1830a94d3736d407bb7300e5f524b9b8ca5615711866f394ddc7e2c1e6/BibleOrgSys-0.0.20.tar.gz +BuildArch: noarch + + +%description + +**Bible Organisational System** / **BibleOrgSys** / **BOS** + +A library of modules for importing and processing various book/chapter/verse (BCV) texts, +including Bibles of course, but also other related BCV materials like Bible commentaries. +Multiprocessing is used by default to load Bibles that have separate books in separate files. + +On most systems, BibleOrgSys can be installed (as shown above) with: + + pip install BibleOrgSys + +or if you only want the library, and don't care about the included app: + + python3 -m pip install --user BibleOrgSys + +This library also includes one app (similar to the demo app below) named **Bible2USX** +which can be run with: + + Bible2USX path/to/BibleFileOrFolder + +or to view all the available options: + + Bible2USX --help + +You can discover the version with: + + Bible2USX --version + +The BibleOrgSys reads or creates a `BibleOrgSysData` folder in your home folder. +(The folder is not hidden like many typical settings folders so that it's easier for non-expert users to find.) +Log files are stored in a subfolder there, and may be useful for reporting errors. +Output files will also be written by default into a subfolder there. + +NOTE: This packaging is still being tested following massive restructuring, +and is not necessarily fully functional until it is marked as v0.1.0 or higher. +We also have hopes to improve documentation before v0.2.0. + +A future package of apps that use the BOS is also planned for release. +After that point, we also hope to release some prepackaged versions— +probably including Docker and Snap. + +This software has been developed in very small chunks of spare time since 2010 +(so it's not necessarily well structured, and definitely not polished). +However, it has been tested on hundreds of Bible filesets, +including USFM, OSIS, USX, USFX, and many other import formats. + +This library forms the basis of the online Bible Drop Box service +hosted at http://Freely-Given.org/Software/BibleDropBox/. + +This package will not reach v1.0.0 until versification mapping is added. +The API will not become fixed/stable until the v1.0.0 release. + +Other than the multiprocessing mentioned above, +no attempt at all has been made at memory or speed optimisations +and this is not planned until after the release of v1.0.0. + +Here is the code for a simple **Bible (e.g., USFM) to USX converter** using BibleOrgSys: + +``` +#!/usr/bin/env python3 +# +# myBible2USX.py (minimal version) +# +# Command-line app to export a USX (XML) Bible. +# +# Copyright (C) 2019-2020 Robert Hunt +# Author: Robert Hunt <Freely.Given.org+BOS@gmail.com> +# License: See gpl-3.0.txt +# +''' +A short command-line app as part of BOS (Bible Organisational System) demos. +This app inputs any known type of Bible file(s) from disk + and then exports a USX version in the (default) BOSOutputFiles folder + (inside the BibleOrgSys folder in your home folder). + +Note that this app can be run from using the command: + myBible2USX.py path/to/BibleFileOrFolder + +You can discover the version with + myBible2USX.py --version + +You can discover the available command line parameters with + myBible2USX.py --help + + e.g., for verbose mode + myBible2USX.py --verbose path/to/BibleFileOrFolder + or using the abbreviated option + myBible2USX.py -v path/to/BibleFileOrFolder + +This app also demonstrates how little code is required to use the BOS + to load a Bible (in any of a large range of formats — see UnknownBible.py) + and then to export it in your desired format (see options in BibleWriter.py). +''' +from BibleOrgSys import BibleOrgSysGlobals +from BibleOrgSys.BibleOrgSysGlobals import fnPrint, vPrint, dPrint +from BibleOrgSys.UnknownBible import UnknownBible + +PROGRAM_NAME = "Bible to USX (minimal)" +PROGRAM_VERSION = '0.09' + +# Configure basic Bible Organisational System (BOS) set-up +parser = BibleOrgSysGlobals.setup( PROGRAM_NAME, PROGRAM_VERSION ) +parser.add_argument( "inputBibleFileOrFolder", help="path/to/BibleFileOrFolder" ) +BibleOrgSysGlobals.addStandardOptionsAndProcess( parser ) + +# Search for a Bible and attempt to load it +unknownBible = UnknownBible( BibleOrgSysGlobals.commandLineArguments.inputBibleFileOrFolder ) +loadedBible = unknownBible.search( autoLoadAlways=True, autoLoadBooks=True ) # Load all the books if we find any + +# See if we were successful at loading one (and only one), and if so, do the export +if not isinstance( loadedBible, str ): # i.e., not an error message + loadedBible.toUSXXML() # Export as USX files (USFM inside XML) + vPrint( 'Quiet', False, f"\nOutput should be in {BibleOrgSysGlobals.DEFAULT_WRITEABLE_OUTPUT_FOLDERPATH.joinpath( 'BOS_USX2_Export/' )}/ folder." ) + +# Do the BOS close-down stuff +BibleOrgSysGlobals.closedown( PROGRAM_NAME, PROGRAM_VERSION ) +``` + +The BOS is developed and well-tested on Linux (Ubuntu) but should also run on Windows and OS X (although not so well tested). + +See https://ubsicap.github.io/usfm/ for more information about USFM. + +See https://ubsicap.github.io/usx/ for more information about USX. + +This library forms the basis of the experimental +[Biblelator](https://pypi.org/project/Biblelator/) Bible translation editor. + + + + +%package -n python3-BibleOrgSys +Summary: Bible Organisational System — load, check, and/or export Bible files/folders +Provides: python-BibleOrgSys +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-BibleOrgSys + +**Bible Organisational System** / **BibleOrgSys** / **BOS** + +A library of modules for importing and processing various book/chapter/verse (BCV) texts, +including Bibles of course, but also other related BCV materials like Bible commentaries. +Multiprocessing is used by default to load Bibles that have separate books in separate files. + +On most systems, BibleOrgSys can be installed (as shown above) with: + + pip install BibleOrgSys + +or if you only want the library, and don't care about the included app: + + python3 -m pip install --user BibleOrgSys + +This library also includes one app (similar to the demo app below) named **Bible2USX** +which can be run with: + + Bible2USX path/to/BibleFileOrFolder + +or to view all the available options: + + Bible2USX --help + +You can discover the version with: + + Bible2USX --version + +The BibleOrgSys reads or creates a `BibleOrgSysData` folder in your home folder. +(The folder is not hidden like many typical settings folders so that it's easier for non-expert users to find.) +Log files are stored in a subfolder there, and may be useful for reporting errors. +Output files will also be written by default into a subfolder there. + +NOTE: This packaging is still being tested following massive restructuring, +and is not necessarily fully functional until it is marked as v0.1.0 or higher. +We also have hopes to improve documentation before v0.2.0. + +A future package of apps that use the BOS is also planned for release. +After that point, we also hope to release some prepackaged versions— +probably including Docker and Snap. + +This software has been developed in very small chunks of spare time since 2010 +(so it's not necessarily well structured, and definitely not polished). +However, it has been tested on hundreds of Bible filesets, +including USFM, OSIS, USX, USFX, and many other import formats. + +This library forms the basis of the online Bible Drop Box service +hosted at http://Freely-Given.org/Software/BibleDropBox/. + +This package will not reach v1.0.0 until versification mapping is added. +The API will not become fixed/stable until the v1.0.0 release. + +Other than the multiprocessing mentioned above, +no attempt at all has been made at memory or speed optimisations +and this is not planned until after the release of v1.0.0. + +Here is the code for a simple **Bible (e.g., USFM) to USX converter** using BibleOrgSys: + +``` +#!/usr/bin/env python3 +# +# myBible2USX.py (minimal version) +# +# Command-line app to export a USX (XML) Bible. +# +# Copyright (C) 2019-2020 Robert Hunt +# Author: Robert Hunt <Freely.Given.org+BOS@gmail.com> +# License: See gpl-3.0.txt +# +''' +A short command-line app as part of BOS (Bible Organisational System) demos. +This app inputs any known type of Bible file(s) from disk + and then exports a USX version in the (default) BOSOutputFiles folder + (inside the BibleOrgSys folder in your home folder). + +Note that this app can be run from using the command: + myBible2USX.py path/to/BibleFileOrFolder + +You can discover the version with + myBible2USX.py --version + +You can discover the available command line parameters with + myBible2USX.py --help + + e.g., for verbose mode + myBible2USX.py --verbose path/to/BibleFileOrFolder + or using the abbreviated option + myBible2USX.py -v path/to/BibleFileOrFolder + +This app also demonstrates how little code is required to use the BOS + to load a Bible (in any of a large range of formats — see UnknownBible.py) + and then to export it in your desired format (see options in BibleWriter.py). +''' +from BibleOrgSys import BibleOrgSysGlobals +from BibleOrgSys.BibleOrgSysGlobals import fnPrint, vPrint, dPrint +from BibleOrgSys.UnknownBible import UnknownBible + +PROGRAM_NAME = "Bible to USX (minimal)" +PROGRAM_VERSION = '0.09' + +# Configure basic Bible Organisational System (BOS) set-up +parser = BibleOrgSysGlobals.setup( PROGRAM_NAME, PROGRAM_VERSION ) +parser.add_argument( "inputBibleFileOrFolder", help="path/to/BibleFileOrFolder" ) +BibleOrgSysGlobals.addStandardOptionsAndProcess( parser ) + +# Search for a Bible and attempt to load it +unknownBible = UnknownBible( BibleOrgSysGlobals.commandLineArguments.inputBibleFileOrFolder ) +loadedBible = unknownBible.search( autoLoadAlways=True, autoLoadBooks=True ) # Load all the books if we find any + +# See if we were successful at loading one (and only one), and if so, do the export +if not isinstance( loadedBible, str ): # i.e., not an error message + loadedBible.toUSXXML() # Export as USX files (USFM inside XML) + vPrint( 'Quiet', False, f"\nOutput should be in {BibleOrgSysGlobals.DEFAULT_WRITEABLE_OUTPUT_FOLDERPATH.joinpath( 'BOS_USX2_Export/' )}/ folder." ) + +# Do the BOS close-down stuff +BibleOrgSysGlobals.closedown( PROGRAM_NAME, PROGRAM_VERSION ) +``` + +The BOS is developed and well-tested on Linux (Ubuntu) but should also run on Windows and OS X (although not so well tested). + +See https://ubsicap.github.io/usfm/ for more information about USFM. + +See https://ubsicap.github.io/usx/ for more information about USX. + +This library forms the basis of the experimental +[Biblelator](https://pypi.org/project/Biblelator/) Bible translation editor. + + + + +%package help +Summary: Development documents and examples for BibleOrgSys +Provides: python3-BibleOrgSys-doc +%description help + +**Bible Organisational System** / **BibleOrgSys** / **BOS** + +A library of modules for importing and processing various book/chapter/verse (BCV) texts, +including Bibles of course, but also other related BCV materials like Bible commentaries. +Multiprocessing is used by default to load Bibles that have separate books in separate files. + +On most systems, BibleOrgSys can be installed (as shown above) with: + + pip install BibleOrgSys + +or if you only want the library, and don't care about the included app: + + python3 -m pip install --user BibleOrgSys + +This library also includes one app (similar to the demo app below) named **Bible2USX** +which can be run with: + + Bible2USX path/to/BibleFileOrFolder + +or to view all the available options: + + Bible2USX --help + +You can discover the version with: + + Bible2USX --version + +The BibleOrgSys reads or creates a `BibleOrgSysData` folder in your home folder. +(The folder is not hidden like many typical settings folders so that it's easier for non-expert users to find.) +Log files are stored in a subfolder there, and may be useful for reporting errors. +Output files will also be written by default into a subfolder there. + +NOTE: This packaging is still being tested following massive restructuring, +and is not necessarily fully functional until it is marked as v0.1.0 or higher. +We also have hopes to improve documentation before v0.2.0. + +A future package of apps that use the BOS is also planned for release. +After that point, we also hope to release some prepackaged versions— +probably including Docker and Snap. + +This software has been developed in very small chunks of spare time since 2010 +(so it's not necessarily well structured, and definitely not polished). +However, it has been tested on hundreds of Bible filesets, +including USFM, OSIS, USX, USFX, and many other import formats. + +This library forms the basis of the online Bible Drop Box service +hosted at http://Freely-Given.org/Software/BibleDropBox/. + +This package will not reach v1.0.0 until versification mapping is added. +The API will not become fixed/stable until the v1.0.0 release. + +Other than the multiprocessing mentioned above, +no attempt at all has been made at memory or speed optimisations +and this is not planned until after the release of v1.0.0. + +Here is the code for a simple **Bible (e.g., USFM) to USX converter** using BibleOrgSys: + +``` +#!/usr/bin/env python3 +# +# myBible2USX.py (minimal version) +# +# Command-line app to export a USX (XML) Bible. +# +# Copyright (C) 2019-2020 Robert Hunt +# Author: Robert Hunt <Freely.Given.org+BOS@gmail.com> +# License: See gpl-3.0.txt +# +''' +A short command-line app as part of BOS (Bible Organisational System) demos. +This app inputs any known type of Bible file(s) from disk + and then exports a USX version in the (default) BOSOutputFiles folder + (inside the BibleOrgSys folder in your home folder). + +Note that this app can be run from using the command: + myBible2USX.py path/to/BibleFileOrFolder + +You can discover the version with + myBible2USX.py --version + +You can discover the available command line parameters with + myBible2USX.py --help + + e.g., for verbose mode + myBible2USX.py --verbose path/to/BibleFileOrFolder + or using the abbreviated option + myBible2USX.py -v path/to/BibleFileOrFolder + +This app also demonstrates how little code is required to use the BOS + to load a Bible (in any of a large range of formats — see UnknownBible.py) + and then to export it in your desired format (see options in BibleWriter.py). +''' +from BibleOrgSys import BibleOrgSysGlobals +from BibleOrgSys.BibleOrgSysGlobals import fnPrint, vPrint, dPrint +from BibleOrgSys.UnknownBible import UnknownBible + +PROGRAM_NAME = "Bible to USX (minimal)" +PROGRAM_VERSION = '0.09' + +# Configure basic Bible Organisational System (BOS) set-up +parser = BibleOrgSysGlobals.setup( PROGRAM_NAME, PROGRAM_VERSION ) +parser.add_argument( "inputBibleFileOrFolder", help="path/to/BibleFileOrFolder" ) +BibleOrgSysGlobals.addStandardOptionsAndProcess( parser ) + +# Search for a Bible and attempt to load it +unknownBible = UnknownBible( BibleOrgSysGlobals.commandLineArguments.inputBibleFileOrFolder ) +loadedBible = unknownBible.search( autoLoadAlways=True, autoLoadBooks=True ) # Load all the books if we find any + +# See if we were successful at loading one (and only one), and if so, do the export +if not isinstance( loadedBible, str ): # i.e., not an error message + loadedBible.toUSXXML() # Export as USX files (USFM inside XML) + vPrint( 'Quiet', False, f"\nOutput should be in {BibleOrgSysGlobals.DEFAULT_WRITEABLE_OUTPUT_FOLDERPATH.joinpath( 'BOS_USX2_Export/' )}/ folder." ) + +# Do the BOS close-down stuff +BibleOrgSysGlobals.closedown( PROGRAM_NAME, PROGRAM_VERSION ) +``` + +The BOS is developed and well-tested on Linux (Ubuntu) but should also run on Windows and OS X (although not so well tested). + +See https://ubsicap.github.io/usfm/ for more information about USFM. + +See https://ubsicap.github.io/usx/ for more information about USX. + +This library forms the basis of the experimental +[Biblelator](https://pypi.org/project/Biblelator/) Bible translation editor. + + + + +%prep +%autosetup -n BibleOrgSys-0.0.20 + +%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-BibleOrgSys -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.20-1 +- Package Spec generated |