mirror of
https://github.com/Syping/dtranslatebot.git
synced 2024-11-22 13:50:22 +01:00
add basic config file to RPM
This commit is contained in:
parent
6a89203415
commit
382f029c3b
4 changed files with 28 additions and 3 deletions
6
rpmsrc/dtranslatebot.json
Normal file
6
rpmsrc/dtranslatebot.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"token": "add bot token from here -> https://discord.com/developers/applications",
|
||||
"translator": {
|
||||
"type": "stub"
|
||||
}
|
||||
}
|
13
rpmsrc/dtranslatebot.service
Normal file
13
rpmsrc/dtranslatebot.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Discord Translation Bot
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=dtranslatebot
|
||||
Group=dtranslatebot
|
||||
WorkingDirectory=/var/lib/dtranslatebot
|
||||
ExecStart=/usr/bin/dtranslatebot /etc/dtranslatebot.json
|
||||
Restart=on-abnormal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -8,9 +8,12 @@ Summary: Discord Translation Bot
|
|||
License: BSD-2-Clause
|
||||
URL: https://github.com/Syping/%{name}
|
||||
Source0: %{name}_%{version}.tar.gz
|
||||
Source1: %{name}.sysusersd
|
||||
Source1: %{name}.json
|
||||
Source2: %{name}.service
|
||||
Source3: %{name}.sysusersd
|
||||
|
||||
BuildRequires: cmake >= 3.16
|
||||
BuildRequires: perl
|
||||
%if 0%{?rhel} && 0%{?rhel} < 9
|
||||
BuildRequires: gcc-toolset-9-annobin
|
||||
BuildRequires: gcc-toolset-9-gcc-c++
|
||||
|
@ -49,10 +52,12 @@ source /opt/rh/gcc-toolset-9/enable
|
|||
%make_install
|
||||
%endif
|
||||
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
|
||||
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf
|
||||
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.json
|
||||
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
|
||||
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf
|
||||
|
||||
%pre
|
||||
%sysusers_create_compat %{SOURCE1}
|
||||
%sysusers_create_compat %{SOURCE3}
|
||||
|
||||
%post
|
||||
%systemd_post %{name}.service
|
||||
|
@ -67,4 +72,5 @@ install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf
|
|||
%{_bindir}/%{name}
|
||||
%{_unitdir}/%{name}.service
|
||||
%{_sysusersdir}/%{name}.conf
|
||||
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}.json
|
||||
%dir %attr(0750,%{name},%{name}) %{_localstatedir}/lib/%{name}
|
Loading…
Reference in a new issue