This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add systemd service for rpm-based distros
- Loading branch information
Parity Releases
committed
Sep 4, 2020
1 parent
b73f13a
commit 63382ee
Showing
4 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,5 +8,6 @@ runtime/wasm/target/ | |
.vscode | ||
polkadot.* | ||
!polkadot.service | ||
!.rpm/* | ||
.DS_Store | ||
.cargo |
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,50 @@ | ||
%define __spec_install_post %{nil} | ||
%define __os_install_post %{_dbpath}/brp-compress | ||
%define debug_package %{nil} | ||
|
||
Name: polkadot | ||
Summary: Implementation of a https://polkadot.network node in Rust based on the Substrate framework. | ||
Version: @@VERSION@@ | ||
Release: @@RELEASE@@%{?dist} | ||
License: GPLv3 | ||
Group: Applications/System | ||
Source0: %{name}-%{version}.tar.gz | ||
|
||
Requires: systemd, shadow-utils | ||
Requires(post): systemd | ||
Requires(preun): systemd | ||
Requires(postun): systemd | ||
|
||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | ||
|
||
%description | ||
%{summary} | ||
|
||
|
||
%prep | ||
%setup -q | ||
|
||
|
||
%install | ||
rm -rf %{buildroot} | ||
mkdir -p %{buildroot} | ||
cp -a * %{buildroot} | ||
|
||
%post | ||
config_file="/etc/default/polkadot" | ||
getent group polkadot >/dev/null || groupadd -r polkadot | ||
getent passwd polkadot >/dev/null || \ | ||
useradd -r -g polkadot -d /home/polkadot -m -s /sbin/nologin \ | ||
-c "User account for running polkadot as a service" polkadot | ||
if [ ! -e "$config_file" ]; then | ||
echo 'POLKADOT_CLI_ARGS=""' > /etc/default/polkadot | ||
fi | ||
exit 0 | ||
|
||
%clean | ||
rm -rf %{buildroot} | ||
|
||
%files | ||
%defattr(-,root,root,-) | ||
%{_bindir}/* | ||
/usr/lib/systemd/system/polkadot.service |
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
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