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: 2028688ba7eef600d3667e97210369cd
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: e4386b8606d728f945e7dcf5eecde9cc
17 URL: https://github.com/lu-zero/cargo-c
18 BuildRequires: cargo >= 0.45
19 BuildRequires: curl-devel
20 #BuildRequires: libgit2-devel >= 1.0.0
21 BuildRequires: libssh2-devel
22 BuildRequires: openssl-devel
23 BuildRequires: pkgconfig
25 BuildRequires: zlib-devel
26 ExclusiveArch: %{ix86} %{x8664} x32 aarch64
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _debugsource_packages 0
31 %define target_opt --target x86_64-unknown-linux-gnux32
33 %define target_opt %{nil}
37 Cargo subcommands to build and install C-ABI compatible dynamic and
40 %description -l pl.UTF-8
41 Podpolecenia Cargo do budowania i instalowania zgodnych z ABI C
42 bibliotek dynamicznych i statycznych.
48 # curl 7.71.1 vendor/curl-sys/curl
49 # libgit2 1.0.1 vendor/libgit2-sys/libgit2
50 # nghttp2 1.33.90 vendor/libnghttp2-sys/nghttp2 (but system nghttp2 is not supported in rust)
51 # libssh 1.9.0 vendor/libssh2-sys/libssh2
52 # zlib 1.2.11 vendor/libz-sys/src/zlib
54 # use our offline registry
55 export CARGO_HOME="$(pwd)/.cargo"
57 mkdir -p "$CARGO_HOME"
58 cat >.cargo/config <<EOF
60 replace-with = 'vendored-sources'
62 [source.vendored-sources]
63 directory = '$PWD/vendor'
67 export CARGO_HOME="$(pwd)/.cargo"
68 export LIBSSH2_SYS_USE_PKG_CONFIG=1
69 export PKG_CONFIG_ALLOW_CROSS=1
71 cargo -vv build --release --frozen %{target_opt}
74 rm -rf $RPM_BUILD_ROOT
75 export CARGO_HOME="$(pwd)/.cargo"
76 export LIBSSH2_SYS_USE_PKG_CONFIG=1
77 export PKG_CONFIG_ALLOW_CROSS=1
79 cargo -vv install --frozen %{target_opt} \
81 --root $RPM_BUILD_ROOT%{_prefix}
83 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
86 rm -rf $RPM_BUILD_ROOT
89 %defattr(644,root,root,755)
90 %doc LICENSE README.md
91 %attr(755,root,root) %{_bindir}/cargo-capi
92 %attr(755,root,root) %{_bindir}/cargo-cbuild
93 %attr(755,root,root) %{_bindir}/cargo-cinstall