diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pydsdl.spec | 150 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 152 insertions, 0 deletions
@@ -0,0 +1 @@ +/pydsdl-1.20.0.tar.gz diff --git a/python-pydsdl.spec b/python-pydsdl.spec new file mode 100644 index 0000000..9b2dd8d --- /dev/null +++ b/python-pydsdl.spec @@ -0,0 +1,150 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pydsdl +Version: 1.20.0 +Release: 1 +Summary: Cyphal DSDL processing frontend +License: MIT +URL: https://opencyphal.org +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0a/9e/16ed1f36e8c086c9963e579b26691d20dce230856f9abe756f35a79d9392/pydsdl-1.20.0.tar.gz +BuildArch: noarch + + +%description +# PyDSDL + +[](https://ci.appveyor.com/project/Zubax/pydsdl/branch/master) +[](https://pydsdl.readthedocs.io/en/latest/?badge=latest) +[](https://pypi.org/project/pydsdl/) +[](https://forum.opencyphal.org) + +PyDSDL is a [Cyphal](https://opencyphal.org) DSDL compiler front-end implemented in Python. +It accepts a DSDL namespace at the input and produces a well-annotated abstract syntax tree (AST) at the output, +evaluating all constant expressions in the process. +All DSDL features defined in the Cyphal Specification are supported. +The library should, in theory, work on any platform and with any Python implementation. + +**Read the docs at [pydsdl.readthedocs.io](https://pydsdl.readthedocs.io/).** + +```python +import pydsdl +try: + types = pydsdl.read_namespace(target_directory, lookup_directories) +except pydsdl.InvalidDefinitionError as ex: + print(f'{ex.path}:{ex.line}: Invalid DSDL: {ex.text}', file=sys.stderr) + exit(1) +else: + for t in types: + print(t) # Process the type -- generate code, analyze, etc. +``` + + +%package -n python3-pydsdl +Summary: Cyphal DSDL processing frontend +Provides: python-pydsdl +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pydsdl +# PyDSDL + +[](https://ci.appveyor.com/project/Zubax/pydsdl/branch/master) +[](https://pydsdl.readthedocs.io/en/latest/?badge=latest) +[](https://pypi.org/project/pydsdl/) +[](https://forum.opencyphal.org) + +PyDSDL is a [Cyphal](https://opencyphal.org) DSDL compiler front-end implemented in Python. +It accepts a DSDL namespace at the input and produces a well-annotated abstract syntax tree (AST) at the output, +evaluating all constant expressions in the process. +All DSDL features defined in the Cyphal Specification are supported. +The library should, in theory, work on any platform and with any Python implementation. + +**Read the docs at [pydsdl.readthedocs.io](https://pydsdl.readthedocs.io/).** + +```python +import pydsdl +try: + types = pydsdl.read_namespace(target_directory, lookup_directories) +except pydsdl.InvalidDefinitionError as ex: + print(f'{ex.path}:{ex.line}: Invalid DSDL: {ex.text}', file=sys.stderr) + exit(1) +else: + for t in types: + print(t) # Process the type -- generate code, analyze, etc. +``` + + +%package help +Summary: Development documents and examples for pydsdl +Provides: python3-pydsdl-doc +%description help +# PyDSDL + +[](https://ci.appveyor.com/project/Zubax/pydsdl/branch/master) +[](https://pydsdl.readthedocs.io/en/latest/?badge=latest) +[](https://pypi.org/project/pydsdl/) +[](https://forum.opencyphal.org) + +PyDSDL is a [Cyphal](https://opencyphal.org) DSDL compiler front-end implemented in Python. +It accepts a DSDL namespace at the input and produces a well-annotated abstract syntax tree (AST) at the output, +evaluating all constant expressions in the process. +All DSDL features defined in the Cyphal Specification are supported. +The library should, in theory, work on any platform and with any Python implementation. + +**Read the docs at [pydsdl.readthedocs.io](https://pydsdl.readthedocs.io/).** + +```python +import pydsdl +try: + types = pydsdl.read_namespace(target_directory, lookup_directories) +except pydsdl.InvalidDefinitionError as ex: + print(f'{ex.path}:{ex.line}: Invalid DSDL: {ex.text}', file=sys.stderr) + exit(1) +else: + for t in types: + print(t) # Process the type -- generate code, analyze, etc. +``` + + +%prep +%autosetup -n pydsdl-1.20.0 + +%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-pydsdl -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.20.0-1 +- Package Spec generated @@ -0,0 +1 @@ +0f51b544540362f1c2288d302886d160 pydsdl-1.20.0.tar.gz |