Create a source package for Python 2 module
Sophie Brun
3 years ago
0 | import sys, glob, os;WHEEL_DIR = "/usr/share/cffi-wheels";sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path |
0 | python-cffi-py2 (1.14.0-2kali1) kali-dev; urgency=medium | |
1 | ||
2 | * Build Python 2 package only, for offsec courses | |
3 | We use Python wheels to keep as few Python2 packages as possible in Kali. | |
4 | ||
5 | -- Sophie Brun <[email protected]> Wed, 27 May 2020 16:54:50 +0200 | |
6 | ||
0 | 7 | python-cffi (1.14.0-1) unstable; urgency=medium |
1 | 8 | |
2 | 9 | * New upstream release. |
0 | Source: python-cffi | |
0 | Source: python-cffi-py2 | |
1 | 1 | Section: python |
2 | 2 | Priority: optional |
3 | Maintainer: Debian Python Modules Team <[email protected]> | |
4 | Uploaders: Stefano Rivera <[email protected]> | |
3 | Maintainer: Kali Developers <[email protected]> | |
5 | 4 | Build-Depends: |
6 | 5 | debhelper-compat (= 12), |
7 | 6 | dh-python, |
8 | 7 | libffi-dev, |
9 | 8 | python-all-dbg, |
10 | 9 | python-all-dev, |
11 | python-py, | |
12 | python-pycparser, | |
13 | python-pytest, | |
14 | python-setuptools, | |
15 | python3-all-dbg, | |
16 | python3-all-dev, | |
17 | python3-py, | |
18 | python3-pycparser, | |
19 | python3-pytest, | |
20 | python3-setuptools, | |
21 | python3-sphinx, | |
22 | 10 | virtualenv |
23 | 11 | Standards-Version: 4.5.0 |
24 | 12 | Homepage: http://cffi.readthedocs.org/ |
25 | Vcs-Git: https://salsa.debian.org/python-team/modules/python-cffi.git | |
26 | Vcs-Browser: https://salsa.debian.org/python-team/modules/python-cffi | |
13 | Vcs-Git: https://gitlab.com/kalilinux/packages/python-cffi.git | |
14 | Vcs-Browser: https://gitlab.com/kalilinux/packages/python-cffi | |
27 | 15 | Rules-Requires-Root: no |
28 | 16 | |
29 | 17 | Package: python-cffi |
33 | 21 | python-cffi-backend (>= ${source:Version}), |
34 | 22 | ${misc:Depends}, |
35 | 23 | ${python:Depends} |
36 | Suggests: python-dev | |
37 | 24 | Description: Foreign Function Interface for Python calling C code |
38 | 25 | Convenient and reliable way of calling C code from Python. |
39 | 26 | . |
76 | 63 | other approaches, that only support the ABI level. |
77 | 64 | . |
78 | 65 | This package contains the debug version of the python-cffi backend. |
79 | ||
80 | Package: python3-cffi | |
81 | Architecture: all | |
82 | Depends: | |
83 | python3-cffi-backend (<< ${source:Version}+c), | |
84 | python3-cffi-backend (>= ${source:Version}), | |
85 | ${misc:Depends}, | |
86 | ${python3:Depends} | |
87 | Suggests: python3-dev | |
88 | Description: Foreign Function Interface for Python 3 calling C code | |
89 | Convenient and reliable way of calling C code from Python 3. | |
90 | . | |
91 | The aim of this project is to provide a convenient and reliable way of calling | |
92 | C code from Python. It keeps Python logic in Python, and minimises the C | |
93 | required. It is able to work at either the C API or ABI level, unlike most | |
94 | other approaches, that only support the ABI level. | |
95 | . | |
96 | This package contains the necessary build and runtime support for cffi | |
97 | modules. | |
98 | ||
99 | Package: python3-cffi-backend | |
100 | Architecture: any | |
101 | Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends} | |
102 | Provides: ${cffi:Provides} | |
103 | Description: Foreign Function Interface for Python 3 calling C code - runtime | |
104 | Convenient and reliable way of calling C code from Python 3. | |
105 | . | |
106 | The aim of this project is to provide a convenient and reliable way of calling | |
107 | C code from Python. It keeps Python logic in Python, and minimises the C | |
108 | required. It is able to work at either the C API or ABI level, unlike most | |
109 | other approaches, that only support the ABI level. | |
110 | . | |
111 | This package contains the runtime support for pre-built cffi modules. | |
112 | ||
113 | Package: python3-cffi-backend-dbg | |
114 | Architecture: any | |
115 | Section: debug | |
116 | Depends: | |
117 | python3-cffi-backend (= ${binary:Version}), | |
118 | ${misc:Depends}, | |
119 | ${python3:Depends}, | |
120 | ${shlibs:Depends} | |
121 | Description: Foreign Function Interface for Python 3 calling C code (Debug version) | |
122 | Convenient and reliable way of calling C code from Python 3. | |
123 | . | |
124 | The aim of this project is to provide a convenient and reliable way of calling | |
125 | C code from Python. It keeps Python logic in Python, and minimises the C | |
126 | required. It is able to work at either the C API or ABI level, unlike most | |
127 | other approaches, that only support the ABI level. | |
128 | . | |
129 | This package contains the debug version of the python3-cffi backend. | |
130 | ||
131 | Package: python-cffi-doc | |
132 | Architecture: all | |
133 | Section: doc | |
134 | Depends: ${misc:Depends}, ${sphinxdoc:Depends} | |
135 | Description: Foreign Function Interface for Python calling C code - documentation | |
136 | Convenient and reliable way of calling C code from Python. | |
137 | . | |
138 | The aim of this project is to provide a convenient and reliable way of calling | |
139 | C code from Python. It keeps Python logic in Python, and minimises the C | |
140 | required. It is able to work at either the C API or ABI level, unlike most | |
141 | other approaches, that only support the ABI level. | |
142 | . | |
143 | This package contains the developer documentation for cffi. |
0 | #!/usr/bin/python3 | |
0 | #!/usr/bin/python2 | |
1 | 1 | |
2 | 2 | import re |
3 | 3 | |
26 | 26 | |
27 | 27 | versions = backend_supported_versions() |
28 | 28 | target = target_version() |
29 | for pkg in ('python-cffi', 'python3-cffi'): | |
29 | for pkg in ('python-cffi'): | |
30 | 30 | subst = { |
31 | 31 | 'pkg': pkg, |
32 | 32 | 'min': versions[0], |
0 | Document: python-cffi-doc | |
1 | Title: cffi Foreign Function Interface for Python calling C code | |
2 | Abstract: Convenient and reliable way of calling C code from Python. | |
3 | The aim of this project is to provide a convenient and reliable way of calling | |
4 | C code from Python. It keeps Python logic in Python, and minimises the C | |
5 | required. It is able to work at either the C API or ABI level, unlike most | |
6 | other approaches, that only support the ABI level. | |
7 | Author: Armin Rigo | |
8 | Section: Programming/Python | |
9 | ||
10 | Format: HTML | |
11 | Index: /usr/share/doc/python-cffi-doc/html/index.html | |
12 | Files: /usr/share/doc/python-cffi-doc/html/*.html | |
13 | ||
14 | Format: text | |
15 | Index: /usr/share/doc/python-cffi-doc/rst/index.rst.txt | |
16 | Files: /usr/share/doc/python-cffi-doc/rst/*.txt |
0 | /usr/share/doc/python-cffi-doc/html/ /usr/share/doc/python-cffi/html | |
1 | /usr/share/doc/python-cffi-doc/html/ /usr/share/doc/python3-cffi/html | |
2 | /usr/share/doc/python-cffi-doc/html/_sources /usr/share/doc/python-cffi-doc/rst | |
3 | /usr/share/doc/python-cffi-doc/html/_sources /usr/share/doc/python-cffi/rst | |
4 | /usr/share/doc/python-cffi-doc/html/_sources /usr/share/doc/python3-cffi/rst |
0 | debian/cffi-wheels.pth usr/lib/python2.7/dist-packages |
Binary diff not shown
Binary diff not shown
0 | 0 | #!/usr/bin/make -f |
1 | 1 | |
2 | export PYTHONPATH=$(CURDIR)/debian/python2-wheels/setuptools-44.1.0-py2.py3-none-any.whl:$(CURDIR)/debian/python2-wheels/py-1.8.1-py2.py3-none-any.whl | |
3 | ||
2 | 4 | export PYBUILD_DESTDIR_python2=debian/python-cffi |
3 | export PYBUILD_DESTDIR_python3=debian/python3-cffi | |
4 | 5 | export PYBUILD_EXT_DESTDIR_python2=debian/python-cffi-backend |
5 | export PYBUILD_EXT_DESTDIR_python3=debian/python3-cffi-backend | |
6 | 6 | export PYBUILD_EXT_DESTDIR_python2-dbg=debian/python-cffi-backend-dbg |
7 | export PYBUILD_EXT_DESTDIR_python3-dbg=debian/python3-cffi-backend-dbg | |
8 | 7 | |
9 | 8 | export VIRTUALENV_DOWNLOAD=no |
10 | 9 | |
11 | 10 | %: |
12 | dh $@ --with python2,python3,sphinxdoc --buildsystem pybuild | |
13 | ||
14 | override_dh_auto_build-indep: | |
15 | dh_auto_build --indep | |
16 | python3 -m sphinx -b html -d doc/build/doctrees doc/source doc/build/html | |
11 | dh $@ --with python2 --buildsystem pybuild | |
17 | 12 | |
18 | 13 | override_dh_auto_test: |
19 | PYBUILD_SYSTEM=custom \ | |
20 | PYBUILD_TEST_ARGS="{interpreter} -m pytest c/ testing/" \ | |
21 | dh_auto_test | |
14 | # don't run the tests: it requires too many python modules | |
22 | 15 | |
23 | override_dh_install: | |
24 | debian/gen-backend-versions.py | |
25 | dh_install | |
26 | ||
27 | override_dh_installdocs-indep: | |
28 | dh_installdocs -p python-cffi-doc --doc-main-package python-cffi-doc | |
29 | dh_installdocs --indep -N python-cffi-doc | |
16 | #override_dh_install: | |
17 | # debian/gen-backend-versions.py | |
18 | # dh_install | |
30 | 19 | |
31 | 20 | override_dh_installchangelogs: |
32 | 21 | dh_installchangelogs doc/source/whatsnew.rst |
34 | 23 | override_dh_strip: |
35 | 24 | dh_strip -p python-cffi-backend -p python-cffi-backend-dbg \ |
36 | 25 | --dbg-package=python-cffi-backend-dbg |
37 | dh_strip -p python3-cffi-backend -p python3-cffi-backend-dbg \ | |
38 | --dbg-package=python3-cffi-backend-dbg | |
39 | 26 | dh_strip --remaining-packages |
40 | 27 | |
41 | 28 | override_dh_clean: |
0 | debian/python2-wheels/py-1.8.1-py2.py3-none-any.whl | |
1 | debian/python2-wheels/setuptools-44.1.0-py2.py3-none-any.whl |
0 | #!/bin/sh | |
1 | ||
2 | set -e | |
3 | ||
4 | test_install_python2() { | |
5 | ||
6 | echo "Testing python2 package" | |
7 | for py in $(pyversions -r 2>/dev/null) ; do | |
8 | cd "$AUTOPKGTEST_TMP" ; | |
9 | echo "Testing with $py:" ; | |
10 | $py -c "import cffi; print(cffi)" ; | |
11 | done | |
12 | ||
13 | } | |
14 | ||
15 | ################################### | |
16 | # Main | |
17 | ################################### | |
18 | ||
19 | for function in "$@"; do | |
20 | $function | |
21 | done |
0 | Tests: unittests | |
1 | Depends: | |
2 | build-essential, | |
3 | python-all-dbg, | |
4 | python-all-dev, | |
5 | python-cffi, | |
6 | python-cffi-backend-dbg, | |
7 | python-py, | |
8 | python-pytest, | |
9 | python-setuptools, | |
10 | virtualenv | |
11 | ||
12 | Tests: unittests3 | |
13 | Depends: | |
14 | build-essential, | |
15 | python3-all-dbg, | |
16 | python3-all-dev, | |
17 | python3-cffi, | |
18 | python3-cffi-backend-dbg, | |
19 | python3-py, | |
20 | python3-pytest, | |
21 | python3-setuptools, | |
22 | virtualenv | |
0 | Test-Command: debian/tests/basic-test.sh test_install_python2 | |
1 | Depends: @ | |
2 | Restrictions: allow-stderr, superficial |
0 | #!/bin/sh | |
1 | set -efu | |
2 | ||
3 | pythons="$(pyversions -s)" | |
4 | cp -a c testing "$AUTOPKGTEST_TMP" | |
5 | ||
6 | # Not appropriate: | |
7 | rm "$AUTOPKGTEST_TMP"/testing/cffi0/test_version.py | |
8 | rm "$AUTOPKGTEST_TMP"/testing/cffi1/test_parse_c_type.py | |
9 | ||
10 | # Temporary hack until cffi defaults to calling virtualenv with --never-download | |
11 | export VIRTUALENV_DOWNLOAD=no | |
12 | ||
13 | # Delete any stale __pycache__s | |
14 | find "$AUTOPKGTEST_TMP" -name '__pycache__' -print0 | xargs -0 rm -rf | |
15 | ||
16 | cd "$AUTOPKGTEST_TMP" | |
17 | for py in $pythons; do | |
18 | echo "======= $py =======" | |
19 | $py -m pytest --tb=native c testing | |
20 | echo "======= $py-dbg =======" | |
21 | $py-dbg -m pytest --tb=native c testing 2>&1 | |
22 | done |
0 | #!/bin/sh | |
1 | set -efu | |
2 | ||
3 | pythons="$(py3versions -s)" | |
4 | cp -a c testing "$AUTOPKGTEST_TMP" | |
5 | ||
6 | # Not appropriate: | |
7 | rm "$AUTOPKGTEST_TMP"/testing/cffi0/test_version.py | |
8 | rm "$AUTOPKGTEST_TMP"/testing/cffi1/test_parse_c_type.py | |
9 | ||
10 | # Temporary hack until cffi defaults to calling virtualenv with --never-download | |
11 | export VIRTUALENV_DOWNLOAD=no | |
12 | ||
13 | # Delete any stale __pycache__s | |
14 | find "$AUTOPKGTEST_TMP" -name '__pycache__' -print0 | xargs -0 rm -rf | |
15 | ||
16 | cd "$AUTOPKGTEST_TMP" | |
17 | for py in $pythons; do | |
18 | echo "======= $py =======" | |
19 | $py -m pytest --tb=native c testing | |
20 | echo "======= $py-dbg =======" | |
21 | $py-dbg -m pytest --tb=native c testing 2>&1 | |
22 | done |