summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-11 10:12:14 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-11 10:12:14 +0000
commitb47db2f02ffbcc9e967155174648c9fb8d66eca0 (patch)
treee4e48692663c0ce2a651b5bcc2501e7134e79b77
parente91e95f575392deb3633073f6fe98172280d25c6 (diff)
automatic import of python-ctypesgen
-rw-r--r--.gitignore1
-rw-r--r--python-ctypesgen.spec435
-rw-r--r--sources1
3 files changed, 437 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..9933799 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ctypesgen-1.1.1.tar.gz
diff --git a/python-ctypesgen.spec b/python-ctypesgen.spec
new file mode 100644
index 0000000..e4def20
--- /dev/null
+++ b/python-ctypesgen.spec
@@ -0,0 +1,435 @@
+%global _empty_manifest_terminate_build 0
+Name: python-ctypesgen
+Version: 1.1.1
+Release: 1
+Summary: Python wrapper generator for ctypes
+License: BSD-2-Clause
+URL: https://github.com/ctypesgen/ctypesgen
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/85/a3/048c4b4d4d31e2ff0d5266b467db01c2ea76b8276653268b7a25e7eb72fc/ctypesgen-1.1.1.tar.gz
+BuildArch: noarch
+
+
+%description
+ (c) Ctypesgen developers 2007-2022
+ https://github.com/ctypesgen/ctypesgen
+_ctypesgen_ is a pure-python ctypes wrapper generator. It parses C header files
+and creates a wrapper for libraries based on what it finds.
+Preprocessor macros are handled in a manner consistent with typical C code.
+Preprocessor macro functions are translated into Python functions that are then
+made available to the user of the newly-generated Python wrapper library.
+It can also output JSON, which can be used with Mork, which generates bindings
+for Lua, using the alien module (which binds libffi to Lua).
+## Documentation
+See https://github.com/ctypesgen/ctypesgen/wiki for full documentation.
+Run `ctypesgen --help` for full range of available options.
+## Installation
+_ctypesgen_ can be installed by `pip install ctypesgen`. It requires Python 3.7
+to run.
+## Basic Usage
+This project automatically generates ctypes wrappers for header files written
+in C.
+For example, if you'd like to generate Neon bindings, you can do so using this
+recipe (using a standard pip install):
+```sh
+ctypesgen -lneon /usr/local/include/neon/ne_*.h -o neon.py
+```
+Some libraries, such as APR, need special flags to compile. You can pass these
+flags in on the command line.
+For example:
+```sh
+FLAGS = `apr-1-config --cppflags --includes`
+ctypesgen $FLAGS -llibapr-1.so $HOME/include/apr-1/apr*.h -o apr.py
+```
+Sometimes, libraries will depend on each other. You can specify these
+dependencies using -mmodule, where module is the name of the dependency module.
+Here's an example for apr_util:
+```sh
+ctypesgen $FLAGS -llibaprutil-1.so $HOME/include/apr-1/ap[ru]*.h \
+ -mapr -o apr_util.py
+```
+If you want JSON output (e.g. for generating Lua bindings), use
+```
+--output-language=json
+```
+When outputting JSON, you will probably also want to use
+```
+--all-headers --builtin-symbols --no-stddef-types --no-gnu-types
+--no-python-types
+```
+## Related Software of Interest
+_libffi_ is a portable Foreign Function Interface library:
+http://sources.redhat.com/libffi/
+_Mork_, the friendly alien, can be found at:
+https://github.com/rrthomas/mork
+## License
+_ctypesgen_ is distributed under the New (2-clause) BSD License:
+http://www.opensource.org/licenses/bsd-license.php
+Copyright (c) 2007-2022, Ctypesgen Developers
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+## Change Log
+### v1.1.1
+- Fixed inconsistency in version output in released packages
+### v1.1.0
+This release has a number of bug fixes in addition to a few new features.
+Following a complete transition to Python 3, with dropped Python 2 support,
+major work was made towards code modernization and quality.
+- The code is now Black formatted and Flake8 tested
+- Greatly improved unittest framework
+- Embedded PLY version updated to 3.11
+- New option: `--no-embed-preamble` create separate files for preamble and
+ loader instead of embedding in each output file
+- New option: `--allow-gnu-c` do not undefine `__GNUC__`
+- Fixed library loader search path on macOS
+- Fixed rare bug, processing (legacy) header files with MacRoman encoding
+ on macOS
+- Added full support for floating and integer constants
+- Added support for sized integer types on Windows
+- Added support to handle `restrict` and `_Noreturn` keywords
+- Added name formats to posix library loader
+- Fixed mapping of 'short int' to c_short
+- Git tags are now using `x.y.z` format
+### v1.0.2
+Many issues fixed. Parse gcc attributes more
+Implements automatic calling convention selection based on gcc attributes for
+stdcall/cdecl.
+- Simplify and unify library loader for various platforms. Improve library path
+ searches on Linux (parsed ld.so.conf includes now).
+- First implementaion of #pragma pack
+- First implemenation of #undef
+- Adds several command line options:
+ `-D` `--define`
+ `-U` `--undefine`
+ `--no-undefs`
+ `-P` `--strip-prefix`
+ `--debug-level`
+### v1.0.1
+Fix handling of function prototypes
+Other minor improvments included.
+### v1.0.0
+Py2/Py3 support
+Various development branches merged back
+In addition to the various developments from the different branches, this
+tag also represents a code state that:
+- ties in with Travis CI to watch code developments
+- improves testsuite, including moving all JSON tests to testsuite
+- includes a decent Debian package build configuration
+- automatically creates a man page to be included in the Debian package
+
+%package -n python3-ctypesgen
+Summary: Python wrapper generator for ctypes
+Provides: python-ctypesgen
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-ctypesgen
+ (c) Ctypesgen developers 2007-2022
+ https://github.com/ctypesgen/ctypesgen
+_ctypesgen_ is a pure-python ctypes wrapper generator. It parses C header files
+and creates a wrapper for libraries based on what it finds.
+Preprocessor macros are handled in a manner consistent with typical C code.
+Preprocessor macro functions are translated into Python functions that are then
+made available to the user of the newly-generated Python wrapper library.
+It can also output JSON, which can be used with Mork, which generates bindings
+for Lua, using the alien module (which binds libffi to Lua).
+## Documentation
+See https://github.com/ctypesgen/ctypesgen/wiki for full documentation.
+Run `ctypesgen --help` for full range of available options.
+## Installation
+_ctypesgen_ can be installed by `pip install ctypesgen`. It requires Python 3.7
+to run.
+## Basic Usage
+This project automatically generates ctypes wrappers for header files written
+in C.
+For example, if you'd like to generate Neon bindings, you can do so using this
+recipe (using a standard pip install):
+```sh
+ctypesgen -lneon /usr/local/include/neon/ne_*.h -o neon.py
+```
+Some libraries, such as APR, need special flags to compile. You can pass these
+flags in on the command line.
+For example:
+```sh
+FLAGS = `apr-1-config --cppflags --includes`
+ctypesgen $FLAGS -llibapr-1.so $HOME/include/apr-1/apr*.h -o apr.py
+```
+Sometimes, libraries will depend on each other. You can specify these
+dependencies using -mmodule, where module is the name of the dependency module.
+Here's an example for apr_util:
+```sh
+ctypesgen $FLAGS -llibaprutil-1.so $HOME/include/apr-1/ap[ru]*.h \
+ -mapr -o apr_util.py
+```
+If you want JSON output (e.g. for generating Lua bindings), use
+```
+--output-language=json
+```
+When outputting JSON, you will probably also want to use
+```
+--all-headers --builtin-symbols --no-stddef-types --no-gnu-types
+--no-python-types
+```
+## Related Software of Interest
+_libffi_ is a portable Foreign Function Interface library:
+http://sources.redhat.com/libffi/
+_Mork_, the friendly alien, can be found at:
+https://github.com/rrthomas/mork
+## License
+_ctypesgen_ is distributed under the New (2-clause) BSD License:
+http://www.opensource.org/licenses/bsd-license.php
+Copyright (c) 2007-2022, Ctypesgen Developers
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+## Change Log
+### v1.1.1
+- Fixed inconsistency in version output in released packages
+### v1.1.0
+This release has a number of bug fixes in addition to a few new features.
+Following a complete transition to Python 3, with dropped Python 2 support,
+major work was made towards code modernization and quality.
+- The code is now Black formatted and Flake8 tested
+- Greatly improved unittest framework
+- Embedded PLY version updated to 3.11
+- New option: `--no-embed-preamble` create separate files for preamble and
+ loader instead of embedding in each output file
+- New option: `--allow-gnu-c` do not undefine `__GNUC__`
+- Fixed library loader search path on macOS
+- Fixed rare bug, processing (legacy) header files with MacRoman encoding
+ on macOS
+- Added full support for floating and integer constants
+- Added support for sized integer types on Windows
+- Added support to handle `restrict` and `_Noreturn` keywords
+- Added name formats to posix library loader
+- Fixed mapping of 'short int' to c_short
+- Git tags are now using `x.y.z` format
+### v1.0.2
+Many issues fixed. Parse gcc attributes more
+Implements automatic calling convention selection based on gcc attributes for
+stdcall/cdecl.
+- Simplify and unify library loader for various platforms. Improve library path
+ searches on Linux (parsed ld.so.conf includes now).
+- First implementaion of #pragma pack
+- First implemenation of #undef
+- Adds several command line options:
+ `-D` `--define`
+ `-U` `--undefine`
+ `--no-undefs`
+ `-P` `--strip-prefix`
+ `--debug-level`
+### v1.0.1
+Fix handling of function prototypes
+Other minor improvments included.
+### v1.0.0
+Py2/Py3 support
+Various development branches merged back
+In addition to the various developments from the different branches, this
+tag also represents a code state that:
+- ties in with Travis CI to watch code developments
+- improves testsuite, including moving all JSON tests to testsuite
+- includes a decent Debian package build configuration
+- automatically creates a man page to be included in the Debian package
+
+%package help
+Summary: Development documents and examples for ctypesgen
+Provides: python3-ctypesgen-doc
+%description help
+ (c) Ctypesgen developers 2007-2022
+ https://github.com/ctypesgen/ctypesgen
+_ctypesgen_ is a pure-python ctypes wrapper generator. It parses C header files
+and creates a wrapper for libraries based on what it finds.
+Preprocessor macros are handled in a manner consistent with typical C code.
+Preprocessor macro functions are translated into Python functions that are then
+made available to the user of the newly-generated Python wrapper library.
+It can also output JSON, which can be used with Mork, which generates bindings
+for Lua, using the alien module (which binds libffi to Lua).
+## Documentation
+See https://github.com/ctypesgen/ctypesgen/wiki for full documentation.
+Run `ctypesgen --help` for full range of available options.
+## Installation
+_ctypesgen_ can be installed by `pip install ctypesgen`. It requires Python 3.7
+to run.
+## Basic Usage
+This project automatically generates ctypes wrappers for header files written
+in C.
+For example, if you'd like to generate Neon bindings, you can do so using this
+recipe (using a standard pip install):
+```sh
+ctypesgen -lneon /usr/local/include/neon/ne_*.h -o neon.py
+```
+Some libraries, such as APR, need special flags to compile. You can pass these
+flags in on the command line.
+For example:
+```sh
+FLAGS = `apr-1-config --cppflags --includes`
+ctypesgen $FLAGS -llibapr-1.so $HOME/include/apr-1/apr*.h -o apr.py
+```
+Sometimes, libraries will depend on each other. You can specify these
+dependencies using -mmodule, where module is the name of the dependency module.
+Here's an example for apr_util:
+```sh
+ctypesgen $FLAGS -llibaprutil-1.so $HOME/include/apr-1/ap[ru]*.h \
+ -mapr -o apr_util.py
+```
+If you want JSON output (e.g. for generating Lua bindings), use
+```
+--output-language=json
+```
+When outputting JSON, you will probably also want to use
+```
+--all-headers --builtin-symbols --no-stddef-types --no-gnu-types
+--no-python-types
+```
+## Related Software of Interest
+_libffi_ is a portable Foreign Function Interface library:
+http://sources.redhat.com/libffi/
+_Mork_, the friendly alien, can be found at:
+https://github.com/rrthomas/mork
+## License
+_ctypesgen_ is distributed under the New (2-clause) BSD License:
+http://www.opensource.org/licenses/bsd-license.php
+Copyright (c) 2007-2022, Ctypesgen Developers
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+## Change Log
+### v1.1.1
+- Fixed inconsistency in version output in released packages
+### v1.1.0
+This release has a number of bug fixes in addition to a few new features.
+Following a complete transition to Python 3, with dropped Python 2 support,
+major work was made towards code modernization and quality.
+- The code is now Black formatted and Flake8 tested
+- Greatly improved unittest framework
+- Embedded PLY version updated to 3.11
+- New option: `--no-embed-preamble` create separate files for preamble and
+ loader instead of embedding in each output file
+- New option: `--allow-gnu-c` do not undefine `__GNUC__`
+- Fixed library loader search path on macOS
+- Fixed rare bug, processing (legacy) header files with MacRoman encoding
+ on macOS
+- Added full support for floating and integer constants
+- Added support for sized integer types on Windows
+- Added support to handle `restrict` and `_Noreturn` keywords
+- Added name formats to posix library loader
+- Fixed mapping of 'short int' to c_short
+- Git tags are now using `x.y.z` format
+### v1.0.2
+Many issues fixed. Parse gcc attributes more
+Implements automatic calling convention selection based on gcc attributes for
+stdcall/cdecl.
+- Simplify and unify library loader for various platforms. Improve library path
+ searches on Linux (parsed ld.so.conf includes now).
+- First implementaion of #pragma pack
+- First implemenation of #undef
+- Adds several command line options:
+ `-D` `--define`
+ `-U` `--undefine`
+ `--no-undefs`
+ `-P` `--strip-prefix`
+ `--debug-level`
+### v1.0.1
+Fix handling of function prototypes
+Other minor improvments included.
+### v1.0.0
+Py2/Py3 support
+Various development branches merged back
+In addition to the various developments from the different branches, this
+tag also represents a code state that:
+- ties in with Travis CI to watch code developments
+- improves testsuite, including moving all JSON tests to testsuite
+- includes a decent Debian package build configuration
+- automatically creates a man page to be included in the Debian package
+
+%prep
+%autosetup -n ctypesgen-1.1.1
+
+%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-ctypesgen -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..c1b92c7
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+0533e8850bf754e056ac51f926b8cf94 ctypesgen-1.1.1.tar.gz