-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |