Skip to content

Commit 6841783

Browse files
committed
alvistack/1.16.0
git clean -xdf tar zcvf ../python-cffi_1.16.0.orig.tar.gz --exclude=.git . debuild -uc -us cp python-cffi.spec ../python-cffi_1.16.0-1.spec cp ../python*-cffi*1.16.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/python-cffi-cffi-1.16.0/ rm -rf ../python*-cffi*1.16.0*.* ../python*-cffi-backend*1.16.0*.* See python-cffi#86 Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
1 parent ba44abd commit 6841783

16 files changed

+275
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ build/
44
__pycache__/
55
*.egg-info/
66
*.so
7+
.pybuild
8+
build

debian/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.pydist
2+
*.substvars
3+
*debhelper*
4+
.debhelper
5+
files
6+
python3-cffi
7+
python3-cffi-backend
8+
tmp

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python-cffi (100:1.16.0-1) UNRELEASED; urgency=medium
2+
3+
* https://github.com/python-cffi/cffi/releases/tag/v1.16.0
4+
5+
-- Wong Hoi Sing Edison <hswong3i@pantarei-design.com> Mon, 01 Jan 2024 20:00:32 +0800

debian/control

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Source: python-cffi
2+
Section: python
3+
Priority: optional
4+
Standards-Version: 4.5.0
5+
Maintainer: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
6+
Homepage: https://github.com/python-cffi/cffi/tags
7+
Vcs-Browser: https://github.com/alvistack/python-cffi-cffi
8+
Vcs-Git: https://github.com/alvistack/python-cffi-cffi.git
9+
Build-Depends:
10+
debhelper,
11+
debhelper-compat (= 10),
12+
dh-python,
13+
fdupes,
14+
cython3,
15+
libffi-dev,
16+
python3-dev,
17+
python3-setuptools,
18+
19+
Package: python3-cffi
20+
Architecture: amd64
21+
Description: Foreign Function Interface for Python to call C code
22+
Foreign Function Interface for Python, providing a convenient and
23+
reliable way of calling existing C code from Python. The interface is
24+
based on LuaJIT’s FFI.
25+
Depends:
26+
${misc:Depends},
27+
${shlibs:Depends},
28+
${python3:Depends},
29+
python3,
30+
python3-cffi-backend (<< ${source:Version}+c),
31+
python3-cffi-backend (>= ${source:Version}),
32+
python3-pycparser,
33+
34+
Package: python3-cffi-backend
35+
Architecture: amd64
36+
Description: Foreign Function Interface for Python to call C code - runtime
37+
This package contains the runtime support for pre-built cffi modules.
38+
Depends:
39+
${misc:Depends},
40+
${shlibs:Depends},
41+
${python3:Depends},
42+
Replaces:
43+
python3-cffi (<< 1),
44+
Breaks:
45+
python3-cffi (<< 1),
46+
Provides:
47+
${cffi:Provides},

debian/copyright

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
3+
Files: debian/*
4+
Copyright: 2024 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
5+
License: Apache-2.0
6+
7+
License: Apache-2.0
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
.
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
.
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
.
20+
The complete text of the Apache version 2.0 license
21+
can be found in "/usr/share/common-licenses/Apache-2.0".

debian/gen-backend-versions.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/python3
2+
3+
import re
4+
5+
6+
def target_version():
7+
with open('src/cffi/recompiler.py', encoding='UTF-8') as f:
8+
for line in f:
9+
m = re.match(r'^VERSION_BASE = (0x[0-9A-F]+)$', line)
10+
if m:
11+
return int(m.group(1), 16)
12+
raise Exception('Version not found')
13+
14+
15+
def backend_supported_versions():
16+
versions = {}
17+
with open('src/c/cffi1_module.c', encoding='UTF-8') as f:
18+
for line in f:
19+
m = re.match(r'^#define CFFI_VERSION_(MIN|MAX) *(0x[0-9A-F]+)$',
20+
line)
21+
if m:
22+
versions[m.group(1)] = int(m.group(2), 16)
23+
if len(versions) == 2:
24+
return versions['MIN'], versions['MAX']
25+
raise Exception('Versions not found')
26+
27+
28+
versions = backend_supported_versions()
29+
target = target_version()
30+
for pkg in ('python-cffi', 'python3-cffi'):
31+
subst = {
32+
'pkg': pkg,
33+
'min': versions[0],
34+
'max': versions[1],
35+
'target': target,
36+
}
37+
with open('debian/{0}-backend.substvars'.format(pkg), 'a',
38+
encoding='UTF-8') as f:
39+
f.write('cffi:Provides={pkg}-backend-api-min (= {min}), '
40+
'{pkg}-backend-api-max (= {max}), '
41+
'{pkg}-backend-api-{target}\n'.format(**subst))
42+
with open('debian/{0}.pydist'.format(pkg), 'w', encoding='UTF-8') as f:
43+
f.write('cffi {pkg}-backend-api-min (<= {target}), '
44+
'{pkg}-backend-api-max (>= {target})\n'
45+
.format(**subst))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/python*/*-packages/_cffi_backend.*.so
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
python3-cffi-backend: copyright-without-copyright-notice
2+
python3-cffi-backend: initial-upload-closes-no-bugs
3+
python3-cffi-backend: zero-byte-file-in-doc-directory

debian/python3-cffi.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/python*/*-packages/cffi*
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python3-cffi: copyright-without-copyright-notice
2+
python3-cffi: initial-upload-closes-no-bugs
3+
python3-cffi: no-manual-page
4+
python3-cffi: zero-byte-file-in-doc-directory

0 commit comments

Comments
 (0)