]> git.pld-linux.org Git - packages/cargo-c.git/blobdiff - cargo-c.spec
up to 0.9.32
[packages/cargo-c.git] / cargo-c.spec
index ff3dace1b2213b4bb8f1b4910cc0bcdc6f163402..61c05475540c57ae66c6583bbdca98faf39130b0 100644 (file)
@@ -1,37 +1,43 @@
+#
+# Conditional build:
+%bcond_without system_libgit2          # use system installed libgit2
+
 Summary:       Helper program to build and install C-like libraries
 Summary(pl.UTF-8):     Program pomocniczy do budowania i instalowania bibliotek w stylu C
 Name:          cargo-c
-Version:       0.6.9
-Release:       3
+Version:       0.9.32
+Release:       1
 License:       MIT
 Group:         Development/Tools
 #Source0Download: https://github.com/lu-zero/cargo-c/releases
 Source0:       https://github.com/lu-zero/cargo-c/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 2028688ba7eef600d3667e97210369cd
+# Source0-md5: db2957cb8033cf0ee8d925847b7114ab
 # cd %{name}-%{version}
 # cargo vendor
 # cd ..
 # tar cJf cargo-c-crates-%{version}.tar.xz %{name}-%{version}/{vendor,Cargo.lock}
 Source1:       %{name}-crates-%{version}.tar.xz
-# Source1-md5: e4386b8606d728f945e7dcf5eecde9cc
+# Source1-md5: 3305874ab8c1fb4e67fda47f12cbc2f8
 URL:           https://github.com/lu-zero/cargo-c
 BuildRequires: cargo >= 0.45
 BuildRequires: curl-devel
-#BuildRequires:        libgit2-devel >= 1.0.0
+%if %{with system_libgit2}
+BuildRequires: libgit2-devel < 1.8.0
+BuildRequires: libgit2-devel >= 1.7.2
+%endif
 BuildRequires: libssh2-devel
 BuildRequires: openssl-devel
 BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 2.005
 BuildRequires: rust
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
 BuildRequires: zlib-devel
-ExclusiveArch: %{ix86} %{x8664} x32 aarch64
+%{?with_system_libgit2:Requires:       libgit2 >= 1.7.2}
+ExclusiveArch: %{rust_arches}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _debugsource_packages   0
-%ifarch        x32
-%define                target_opt      --target x86_64-unknown-linux-gnux32
-%else
-%define                target_opt      %{nil}
-%endif
+%define                _enable_debug_packages  0
 
 %description
 Cargo subcommands to build and install C-ABI compatible dynamic and
@@ -45,10 +51,10 @@ bibliotek dynamicznych i statycznych.
 %setup -q -b1
 
 # bundled:
-# curl 7.71.1 vendor/curl-sys/curl
-# libgit2 1.0.1 vendor/libgit2-sys/libgit2
-# nghttp2 1.33.90 vendor/libnghttp2-sys/nghttp2 (but system nghttp2 is not supported in rust)
-# libssh 1.9.0 vendor/libssh2-sys/libssh2
+# curl 7.83.1 vendor/curl-sys/curl
+# libgit2 1.5.0-alpha vendor/libgit2-sys/libgit2
+# nghttp2 1.45.0 vendor/libnghttp2-sys/nghttp2 (but system nghttp2 is not supported in rust)
+# libssh 1.10-dev vendor/libssh2-sys/libssh2
 # zlib 1.2.11 vendor/libz-sys/src/zlib
 
 # use our offline registry
@@ -66,17 +72,15 @@ EOF
 %build
 export CARGO_HOME="$(pwd)/.cargo"
 export LIBSSH2_SYS_USE_PKG_CONFIG=1
-export PKG_CONFIG_ALLOW_CROSS=1
 
-cargo -vv build --release --frozen %{target_opt}
+%cargo_build --frozen
 
 %install
 rm -rf $RPM_BUILD_ROOT
 export CARGO_HOME="$(pwd)/.cargo"
 export LIBSSH2_SYS_USE_PKG_CONFIG=1
-export PKG_CONFIG_ALLOW_CROSS=1
 
-cargo -vv install --frozen %{target_opt} \
+%cargo_install --frozen \
        --path . \
        --root $RPM_BUILD_ROOT%{_prefix}
 
@@ -91,3 +95,4 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/cargo-capi
 %attr(755,root,root) %{_bindir}/cargo-cbuild
 %attr(755,root,root) %{_bindir}/cargo-cinstall
+%attr(755,root,root) %{_bindir}/cargo-ctest
This page took 0.216765 seconds and 4 git commands to generate.