50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
%undefine _missing_build_ids_terminate_build
|
|
%define debug_package %{nil}
|
|
|
|
Name: netoik-api
|
|
Version: %(make version)
|
|
Release: 1%{?dist}
|
|
Summary: Netoik rest API server
|
|
|
|
License: GPLv3
|
|
URL: https://www.netoik.io/api
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
Buildarch: x86_64
|
|
BuildRequires: make
|
|
|
|
%description
|
|
Netoik rest API server
|
|
|
|
%prep
|
|
%autosetup -v
|
|
|
|
%build
|
|
%make_build
|
|
|
|
%install
|
|
%make_install
|
|
|
|
%pre
|
|
id %{name} || useradd --no-create-home --shell=%{_sbindir}/nologin --user-group %{name}
|
|
|
|
%post
|
|
systemctl daemon-reload
|
|
systemctl restart %{name}-server.service
|
|
systemctl enable %{name}-server.service
|
|
|
|
%preun
|
|
[ $1 -eq 0 ] && systemctl stop %{name}-server.service
|
|
|
|
%postun
|
|
[ $1 -eq 0 ] && systemctl daemon-reload && userdel %{name}
|
|
|
|
%files
|
|
%attr(755, root, root) %dir %{_var}/%{name}
|
|
%attr(755, %{name}, %{name}) %dir %{_var}/%{name}/captcha
|
|
%attr(755, root, root) %dir %{_sysconfdir}/%{name}
|
|
%attr(644, root, root) %{_sysconfdir}/%{name}/server.conf.sample
|
|
%attr(644, root, root) %config(noreplace) %{_sysconfdir}/%{name}/server.conf
|
|
%attr(644, root, root) %{_unitdir}/%{name}-server.service
|
|
%attr(755, root, root) %{_bindir}/%{name}-server
|