Add spec for using cargo-rpm

With this, fedora/rhel/centos users can use their default package
manager to install bat, without needing cargo or rust.
This commit is contained in:
Cainã Costa 2018-07-14 13:14:23 -03:00
parent 8c6a74a6c5
commit d8edd70294
2 changed files with 39 additions and 0 deletions

33
.rpm/bat.spec Normal file
View File

@ -0,0 +1,33 @@
%define __spec_install_post %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define debug_package %{nil}
Name: bat
Summary: A cat(1) clone with wings.
Version: @@VERSION@@
Release: 1
License: MIT or ASL 2.0
Group: Applications/System
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/sharkdp/bat
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
%{summary}
%prep
%setup -q
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
cp -a * %{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/*

View File

@ -42,3 +42,9 @@ features = []
[dev-dependencies] [dev-dependencies]
tempdir = "0.3" tempdir = "0.3"
[package.metadata.rpm.cargo]
buildflags = ["--release"]
[package.metadata.rpm.targets]
bat = { path = "/usr/bin/bat" }