]> git.pld-linux.org Git - packages/cargo-c.git/blob - cargo-c.spec
- updated to 0.9.10
[packages/cargo-c.git] / cargo-c.spec
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
3 Name:           cargo-c
4 Version:        0.9.10
5 Release:        1
6 License:        MIT
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:  e1efdfc1b99b871873e5494f2d1e0d2e
11 # cd %{name}-%{version}
12 # cargo vendor
13 # cd ..
14 # tar cJf cargo-c-crates-%{version}.tar.xz %{name}-%{version}/{vendor,Cargo.lock}
15 Source1:        %{name}-crates-%{version}.tar.xz
16 # Source1-md5:  d1f41556287ee95e338fbb8ec4060d68
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
24 BuildRequires:  rust
25 BuildRequires:  zlib-devel
26 ExclusiveArch:  %{ix86} %{x8664} x32 aarch64
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %define         _debugsource_packages   0
30 %ifarch x32
31 %define         target_opt      --target x86_64-unknown-linux-gnux32
32 %else
33 %define         target_opt      %{nil}
34 %endif
35
36 %description
37 Cargo subcommands to build and install C-ABI compatible dynamic and
38 static libraries.
39
40 %description -l pl.UTF-8
41 Podpolecenia Cargo do budowania i instalowania zgodnych z ABI C
42 bibliotek dynamicznych i statycznych.
43
44 %prep
45 %setup -q -b1
46
47 # bundled:
48 # curl 7.83.1 vendor/curl-sys/curl
49 # libgit2 1.5.0-alpha vendor/libgit2-sys/libgit2
50 # nghttp2 1.45.0 vendor/libnghttp2-sys/nghttp2 (but system nghttp2 is not supported in rust)
51 # libssh 1.10-dev vendor/libssh2-sys/libssh2
52 # zlib 1.2.11 vendor/libz-sys/src/zlib
53
54 # use our offline registry
55 export CARGO_HOME="$(pwd)/.cargo"
56
57 mkdir -p "$CARGO_HOME"
58 cat >.cargo/config <<EOF
59 [source.crates-io]
60 replace-with = 'vendored-sources'
61
62 [source.vendored-sources]
63 directory = '$PWD/vendor'
64 EOF
65
66 %build
67 export CARGO_HOME="$(pwd)/.cargo"
68 export LIBSSH2_SYS_USE_PKG_CONFIG=1
69 export PKG_CONFIG_ALLOW_CROSS=1
70
71 cargo -vv build --release --frozen %{target_opt}
72
73 %install
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
78
79 cargo -vv install --frozen %{target_opt} \
80         --path . \
81         --root $RPM_BUILD_ROOT%{_prefix}
82
83 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %files
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
94 %attr(755,root,root) %{_bindir}/cargo-ctest
This page took 0.07485 seconds and 4 git commands to generate.