]> git.pld-linux.org Git - packages/maturin.git/blob - maturin.spec
rebuild with separate debuginfo build-ids
[packages/maturin.git] / maturin.spec
1 %define         crates_ver      0.10.3
2
3 Summary:        Build and publish rust crates as python packages
4 Name:           maturin
5 Version:        0.10.3
6 Release:        2
7 License:        MIT or Apache v2.0
8 Group:          Applications
9 Source0:        https://github.com/PyO3/maturin/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  b1d821f86a97dc10648f38aa2c6a8540
11 # ./create-crates.sh
12 Source1:        %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5:  1b5a724601e35752b98b5ad8afc2a2b1
14 URL:            https://github.com/PyO3/maturin
15 BuildRequires:  cargo
16 BuildRequires:  rpmbuild(macros) >= 2.004
17 BuildRequires:  rust
18 ExclusiveArch:  %{rust_arches}
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %description
22 Build and publish crates with pyo3, rust-cpython and cffi bindings as
23 well as rust binaries as python packages.
24
25 %prep
26 %setup -q -a1
27
28 %{__mv} maturin-%{crates_ver}/* .
29 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
30
31 # use our offline registry
32 export CARGO_HOME="$(pwd)/.cargo"
33
34 mkdir -p "$CARGO_HOME"
35 cat >.cargo/config <<EOF
36 [source.crates-io]
37 registry = 'https://github.com/rust-lang/crates.io-index'
38 replace-with = 'vendored-sources'
39
40 [source.vendored-sources]
41 directory = '$PWD/vendor'
42 EOF
43
44 %build
45 export CARGO_HOME="$(pwd)/.cargo"
46
47 %cargo_build --frozen
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51 export CARGO_HOME="$(pwd)/.cargo"
52
53 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $(pwd)
54 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
55
56 %clean
57 rm -rf $RPM_BUILD_ROOT
58
59 %files
60 %defattr(644,root,root,755)
61 %doc Changelog.md Readme.md
62 %attr(755,root,root) %{_bindir}/maturin
This page took 0.091427 seconds and 3 git commands to generate.