Skip to content

Commit

Permalink
Initial RPM packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ElXreno committed Apr 5, 2020
1 parent b7ac334 commit b5ae658
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
File renamed without changes.
12 changes: 12 additions & 0 deletions rpm/zswap-cli.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=ZSwap-cli service
Documentation=man:zswap-cli(1) https://github.com/ElXreno/zswap-cli

[Service]
Type=oneshot
ExecStart=/usr/bin/zswap-cli set --use-config
ProtectSystem=strict
ProtectHome=true

[Install]
WantedBy=multi-user.target
59 changes: 59 additions & 0 deletions rpm/zswap-cli.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
%global debug_package %{nil}

%global commit 9419b2f2f3e6c79de581d2b7dc5df83eed4de4b6

Name: zswap-cli
Version: 0.1.0
Release: 1%{?dist}
Summary: Utility for controlling zswap parameters

License: ASL 2.0
URL: https://github.com/ElXreno/zswap-cli
Source0: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz
Source1: %{name}.conf
Source2: %{name}.service

BuildRequires: cargo
BuildRequires: systemd

%description
Utility for controlling zswap parameters


%prep
%autosetup -n %{name}-%{commit}


%build
cargo build --release


%install
install -m 0755 -Dp target/release/%{name} %{buildroot}%{_bindir}/%{name}
install -m 0644 -Dp %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
install -m 0644 -Dp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.conf


%post
%systemd_post %{name}.service


%preun
%systemd_preun %{name}.service


%postun
%systemd_postun_with_restart %{name}.service


%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_unitdir}/%{name}.service
%config(noreplace) %{_sysconfdir}/%{name}.conf


%changelog
* Sun Apr 5 2020 ElXreno <[email protected]>
- Initial packaging

0 comments on commit b5ae658

Please sign in to comment.