]> git.pld-linux.org Git - packages/delta.git/blobdiff - delta.spec
up to 0.17.0
[packages/delta.git] / delta.spec
index be96b70467a6c1f75200e65f315e94e613860c36..9c0de5cd71be90809e96f5b6793cfe0a4feda5ed 100644 (file)
@@ -1,20 +1,35 @@
+#
+# Conditional build:
+%bcond_without system_libgit2          # use system installed libgit2
+
+%define                crates_ver      0.17.0
+
 Summary:       A viewer for git and diff output
 Name:          delta
-Version:       0.4.4
+Version:       0.17.0
 Release:       1
 License:       MIT
 Group:         Applications
 Source0:       https://github.com/dandavison/delta/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: e41ddf2cd36df5aa1697fc2c2e31cca2
-# cd delta-%{version}
-# cargo vendor
-# cd ..
-# tar cJf delta-crates-%{version}.tar.xz delta-%{version}/{vendor,Cargo.lock}
-Source1:       %{name}-crates-%{version}.tar.xz
-# Source1-md5: 1638d0b8b9dd5bc2783cb1d84720e047
+# Source0-md5: 323ef94cc3d9c0b21691ecc5e250708f
+Source1:       %{name}-crates-%{crates_ver}.tar.xz
+# Source1-md5: c32b2651ccef34736929edaca477a269
 URL:           https://github.com/dandavison/delta
 BuildRequires: cargo
+%if %{with system_libgit2}
+BuildRequires: libgit2-devel < 1.8.0
+BuildRequires: libgit2-devel >= 1.7.2
+%endif
+BuildRequires: oniguruma-devel >= 6.9.8
+BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 2.004
 BuildRequires: rust
+BuildRequires: rust-bindgen
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+%{?with_system_libgit2:Requires:       libgit2 >= 1.7.2}
+Requires:      oniguruma >= 6.9.8
+ExclusiveArch: %{rust_arches}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -43,7 +58,10 @@ Delta's main features are:
   diff output.
 
 %prep
-%setup -q -b1
+%setup -q -a1
+
+%{__mv} delta-%{crates_ver}/* .
+sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
 
 # use our offline registry
 export CARGO_HOME="$(pwd)/.cargo"
@@ -60,14 +78,16 @@ EOF
 
 %build
 export CARGO_HOME="$(pwd)/.cargo"
+export RUSTONIG_SYSTEM_LIBONIG=true
 
-cargo -v build --release --frozen
+%cargo_build --frozen
 
 %install
 rm -rf $RPM_BUILD_ROOT
 export CARGO_HOME="$(pwd)/.cargo"
 
-cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
+export RUSTONIG_SYSTEM_LIBONIG=true
+%cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
 
 %clean
This page took 0.136388 seconds and 4 git commands to generate.