]> git.pld-linux.org Git - packages/cargo-c.git/blob - cargo-c.spec
disable debug packages
[packages/cargo-c.git] / cargo-c.spec
1 #
2 # Conditional build:
3 %bcond_without  system_libgit2          # use system installed libgit2
4
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
8 Version:        0.9.31
9 Release:        1
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
14 # Source0-md5:  f7e624cdaa1f6b526a2d18c9869396fd
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
20 # Source1-md5:  3f22dcb9762cf4824627381553accb38
21 URL:            https://github.com/lu-zero/cargo-c
22 BuildRequires:  cargo >= 0.45
23 BuildRequires:  curl-devel
24 %if %{with system_libgit2}
25 BuildRequires:  libgit2-devel < 1.8.0
26 BuildRequires:  libgit2-devel >= 1.7.2
27 %endif
28 BuildRequires:  libssh2-devel
29 BuildRequires:  openssl-devel
30 BuildRequires:  pkgconfig
31 BuildRequires:  rpmbuild(macros) >= 2.005
32 BuildRequires:  rust
33 BuildRequires:  tar >= 1:1.22
34 BuildRequires:  xz
35 BuildRequires:  zlib-devel
36 %{?with_system_libgit2:Requires:        libgit2 >= 1.7.2}
37 ExclusiveArch:  %{rust_arches}
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %define         _enable_debug_packages  0
41
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:
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
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
76 %cargo_build --frozen
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 export CARGO_HOME="$(pwd)/.cargo"
81 export LIBSSH2_SYS_USE_PKG_CONFIG=1
82
83 %cargo_install --frozen \
84         --path . \
85         --root $RPM_BUILD_ROOT%{_prefix}
86
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
98 %attr(755,root,root) %{_bindir}/cargo-ctest
This page took 0.145888 seconds and 4 git commands to generate.