]> git.pld-linux.org Git - packages/cargo-c.git/blob - cargo-c.spec
- up to 0.8.0 (doesn't build with rust 1.47, probably needs 1.49 or 1.50?)
[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.8.0
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:  12a73f24e289ee7cb2a9f59bb1b40e50
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:  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)
27
28 %description
29 Cargo subcommands to build and install C-ABI compatible dynamic and
30 static libraries.
31
32 %description -l pl.UTF-8
33 Podpolecenia Cargo do budowania i instalowania zgodnych z ABI C
34 bibliotek dynamicznych i statycznych.
35
36 %prep
37 %setup -q -b1
38
39 # bundled:
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
46
47 # use our offline registry
48 export CARGO_HOME="$(pwd)/.cargo"
49
50 mkdir -p "$CARGO_HOME"
51 cat >.cargo/config <<EOF
52 [source.crates-io]
53 replace-with = 'vendored-sources'
54
55 [source.vendored-sources]
56 directory = '$PWD/vendor'
57 EOF
58
59 %build
60 export CARGO_HOME="$(pwd)/.cargo"
61 export LIBSSH2_SYS_USE_PKG_CONFIG=1
62
63 cargo -vv build --release --frozen
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 export CARGO_HOME="$(pwd)/.cargo"
68 export LIBSSH2_SYS_USE_PKG_CONFIG=1
69
70 cargo -vv install --frozen --path . --root $RPM_BUILD_ROOT%{_prefix}
71 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %files
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
This page took 0.110425 seconds and 3 git commands to generate.