]>
Commit | Line | Data |
---|---|---|
7f0eaa42 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without system_libgit2 # use system installed libgit2 | |
4 | ||
dc5771bc JB |
5 | Summary: Helper program to build and install C-like libraries |
6 | Summary(pl.UTF-8): Program pomocniczy do budowania i instalowania bibliotek w stylu C | |
7 | Name: cargo-c | |
f0becbaf | 8 | Version: 0.9.31 |
65830b60 | 9 | Release: 1 |
dc5771bc JB |
10 | License: MIT |
11 | Group: Development/Tools | |
12 | #Source0Download: https://github.com/lu-zero/cargo-c/releases | |
13 | Source0: https://github.com/lu-zero/cargo-c/archive/v%{version}/%{name}-%{version}.tar.gz | |
f0becbaf | 14 | # Source0-md5: f7e624cdaa1f6b526a2d18c9869396fd |
dc5771bc JB |
15 | # cd %{name}-%{version} |
16 | # cargo vendor | |
17 | # cd .. | |
18 | # tar cJf cargo-c-crates-%{version}.tar.xz %{name}-%{version}/{vendor,Cargo.lock} | |
19 | Source1: %{name}-crates-%{version}.tar.xz | |
f0becbaf | 20 | # Source1-md5: 3f22dcb9762cf4824627381553accb38 |
dc5771bc JB |
21 | URL: https://github.com/lu-zero/cargo-c |
22 | BuildRequires: cargo >= 0.45 | |
23 | BuildRequires: curl-devel | |
7f0eaa42 | 24 | %if %{with system_libgit2} |
d82d7340 | 25 | BuildRequires: libgit2-devel < 1.8.0 |
f0becbaf | 26 | BuildRequires: libgit2-devel >= 1.7.2 |
7f0eaa42 | 27 | %endif |
dc5771bc JB |
28 | BuildRequires: libssh2-devel |
29 | BuildRequires: openssl-devel | |
30 | BuildRequires: pkgconfig | |
73ce5ff1 | 31 | BuildRequires: rpmbuild(macros) >= 2.005 |
dc5771bc | 32 | BuildRequires: rust |
102ccf63 JP |
33 | BuildRequires: tar >= 1:1.22 |
34 | BuildRequires: xz | |
dc5771bc | 35 | BuildRequires: zlib-devel |
f0becbaf | 36 | %{?with_system_libgit2:Requires: libgit2 >= 1.7.2} |
a29e190d | 37 | ExclusiveArch: %{rust_arches} |
dc5771bc JB |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
7f0ccbb4 JP |
40 | %define _enable_debug_packages 0 |
41 | ||
dc5771bc JB |
42 | %description |
43 | Cargo subcommands to build and install C-ABI compatible dynamic and | |
44 | static libraries. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Podpolecenia Cargo do budowania i instalowania zgodnych z ABI C | |
48 | bibliotek dynamicznych i statycznych. | |
49 | ||
50 | %prep | |
51 | %setup -q -b1 | |
52 | ||
53 | # bundled: | |
b4f7851d JB |
54 | # curl 7.83.1 vendor/curl-sys/curl |
55 | # libgit2 1.5.0-alpha vendor/libgit2-sys/libgit2 | |
56 | # nghttp2 1.45.0 vendor/libnghttp2-sys/nghttp2 (but system nghttp2 is not supported in rust) | |
57 | # libssh 1.10-dev vendor/libssh2-sys/libssh2 | |
dc5771bc JB |
58 | # zlib 1.2.11 vendor/libz-sys/src/zlib |
59 | ||
60 | # use our offline registry | |
61 | export CARGO_HOME="$(pwd)/.cargo" | |
62 | ||
63 | mkdir -p "$CARGO_HOME" | |
64 | cat >.cargo/config <<EOF | |
65 | [source.crates-io] | |
66 | replace-with = 'vendored-sources' | |
67 | ||
68 | [source.vendored-sources] | |
69 | directory = '$PWD/vendor' | |
70 | EOF | |
71 | ||
72 | %build | |
73 | export CARGO_HOME="$(pwd)/.cargo" | |
74 | export LIBSSH2_SYS_USE_PKG_CONFIG=1 | |
75 | ||
308516b5 | 76 | %cargo_build --frozen |
dc5771bc JB |
77 | |
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | export CARGO_HOME="$(pwd)/.cargo" | |
81 | export LIBSSH2_SYS_USE_PKG_CONFIG=1 | |
82 | ||
308516b5 | 83 | %cargo_install --frozen \ |
b9431a50 JB |
84 | --path . \ |
85 | --root $RPM_BUILD_ROOT%{_prefix} | |
86 | ||
dc5771bc JB |
87 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates* |
88 | ||
89 | %clean | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %files | |
93 | %defattr(644,root,root,755) | |
94 | %doc LICENSE README.md | |
95 | %attr(755,root,root) %{_bindir}/cargo-capi | |
96 | %attr(755,root,root) %{_bindir}/cargo-cbuild | |
97 | %attr(755,root,root) %{_bindir}/cargo-cinstall | |
65830b60 | 98 | %attr(755,root,root) %{_bindir}/cargo-ctest |