Add script for rpm build

This commit is contained in:
dalance
2020-02-12 17:04:55 +09:00
parent 3fee1d3742
commit 3c83a635bb
4 changed files with 49 additions and 0 deletions
+6
View File
@@ -21,3 +21,9 @@ jobs:
uses: actions/checkout@v1
- name: Run tests
run: cargo test
- name: RPM test
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get -qq install musl-tools
cargo install cargo-rpm
make release_rpm
+31
View File
@@ -0,0 +1,31 @@
%define __spec_install_post %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define debug_package %{nil}
Name: procs
Summary: A modern replacement for ps
Version: @@VERSION@@
Release: @@RELEASE@@
License: MIT
Group: Applications/System
Source0: %{name}-%{version}.tar.gz
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}/*
+7
View File
@@ -62,3 +62,10 @@ users = "0.9"
[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3", features = ["handleapi", "minwindef", "psapi", "securitybaseapi", "tlhelp32", "winbase", "winnt"] }
[package.metadata.rpm.cargo]
buildflags = ["--release"]
target = "x86_64-unknown-linux-musl"
[package.metadata.rpm.targets]
procs = { path = "/usr/bin/procs" }
+5
View File
@@ -31,3 +31,8 @@ release_win:
release_mac:
cargo build --release --target=x86_64-apple-darwin
zip -j ${BIN_NAME}-v${VERSION}-x86_64-mac.zip target/x86_64-apple-darwin/release/${BIN_NAME}
release_rpm:
cargo rpm build -v
cp target/x86_64-unknown-linux-musl/release/rpmbuild/RPMS/x86_64/* ./
ls