1 Summary: Helper program to build and install C-like libraries
2 Summary(pl.UTF-8): Program pomocniczy do budowania i instalowania bibliotek w stylu C
7 Group: Development/Tools
8 #Source0Download: https://github.com/lu-zero/cargo-c/releases
9 Source0: https://github.com/lu-zero/cargo-c/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: 12a73f24e289ee7cb2a9f59bb1b40e50
11 # cd %{name}-%{version}
14 # tar cJf cargo-c-crates-%{version}.tar.xz %{name}-%{version}/{vendor,Cargo.lock}
15 Source1: %{name}-crates-%{version}.tar.xz
16 # Source1-md5: 03687edfea85d34bd70887af26108a07
17 URL: https://github.com/lu-zero/cargo-c
18 BuildRequires: cargo >= 0.45
19 BuildRequires: curl-devel
20 #BuildRequires: libgit2-devel >= 1.1.0
21 BuildRequires: libssh2-devel
22 BuildRequires: openssl-devel
23 BuildRequires: pkgconfig
24 BuildRequires: rust >= 1.49
25 BuildRequires: zlib-devel
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 Cargo subcommands to build and install C-ABI compatible dynamic and
32 %description -l pl.UTF-8
33 Podpolecenia Cargo do budowania i instalowania zgodnych z ABI C
34 bibliotek dynamicznych i statycznych.
40 # curl 7.76.0 vendor/curl-sys/curl
41 # libgit2 1.1.0 vendor/libgit2-sys/libgit2
42 # nghttp2 1.43.0 vendor/libnghttp2-sys/nghttp2 (but system nghttp2 is not supported in rust)
43 # libssh 1.9.0 vendor/libssh2-sys/libssh2
44 # zlib 1.2.11 vendor/libz-sys/src/zlib
45 # zlib-ng 1.9.9 vendor/libz-sys/src/zlib-ng
47 # use our offline registry
48 export CARGO_HOME="$(pwd)/.cargo"
50 mkdir -p "$CARGO_HOME"
51 cat >.cargo/config <<EOF
53 replace-with = 'vendored-sources'
55 [source.vendored-sources]
56 directory = '$PWD/vendor'
60 export CARGO_HOME="$(pwd)/.cargo"
61 export LIBSSH2_SYS_USE_PKG_CONFIG=1
63 cargo -vv build --release --frozen
66 rm -rf $RPM_BUILD_ROOT
67 export CARGO_HOME="$(pwd)/.cargo"
68 export LIBSSH2_SYS_USE_PKG_CONFIG=1
70 cargo -vv install --frozen --path . --root $RPM_BUILD_ROOT%{_prefix}
71 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
74 rm -rf $RPM_BUILD_ROOT
77 %defattr(644,root,root,755)
78 %doc LICENSE README.md
79 %attr(755,root,root) %{_bindir}/cargo-capi
80 %attr(755,root,root) %{_bindir}/cargo-cbuild
81 %attr(755,root,root) %{_bindir}/cargo-cinstall