-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-tibs.spec
More file actions
53 lines (44 loc) · 1.28 KB
/
python-tibs.spec
File metadata and controls
53 lines (44 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Rust sucks
%undefine _debugsource_template
%define module tibs
Name: python-tibs
Version: 0.8.0
Release: 1
Summary: A sleek Python library for binary data
License: MIT
Group: Development/Python
URL: https://github.com/scott-griffiths/tibs
Source0: https://github.com/scott-griffiths/tibs/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-%{version}-vendor.tar.xz
BuildSystem: python
BuildRequires: cargo
BuildRequires: pkgconfig(python3)
BuildRequires: python%{pyver}dist(pip)
BuildRequires: python%{pyver}dist(maturin)
BuildRequires: python%{pyver}dist(wheel)
BuildRequires: rust-packaging
%description
A sleek Python library for binary data.
%prep -a
tar xf %{S:1}
%cargo_prep -v vendor
cat >>.cargo/config <<EOF
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
%build -p
# Rust doesnt accept LDFLAGS, instead we need to use RUSTFLAGS to ensure it
# links properly during compile to fix undefined symbols being reported
# during packaging.
export RUSTFLAGS="-lpython%{pyver}"
export CARGO_HOME=$PWD/.cargo
%build -a
# sort out crate licenses
%cargo_license_summary
%{cargo_license} > LICENSES.dependencies
%files
%license LICENSE LICENSES.dependencies
%{python_sitearch}/%{module}
%{python_sitearch}/%{module}-%{version}.dist-info