Commit d5765752 authored by Alexander A. Klimov's avatar Alexander A. Klimov Committed by Markus Frosch
Browse files

Import spec file

%define revision 1
%define debug_package %{nil}
Name: icingadb
Version: 0.0
Release: %{revision}%{?dist}
Summary: Icinga DB
Group: System Environment/Daemons
License: GPLv2+
Source0: %{name}-%{version}.tar.gz
Vendor: Icinga <>
Packager: Icinga <>
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: golang git
BuildRequires: systemd
Requires(pre): shadow-utils
Provides: user(icingadb)
Provides: group(icingadb)
%define configdir %{_sysconfdir}/%{name}
%define service %{name}.service
%define gopath %{_tmppath}/%{name}-%{version}-%{release}-gopath
Icinga DB
%setup -q
mkdir -p %{gopath}/src/
ln -s $(pwd) %{gopath}/src/
GOPATH=%{gopath} go get
GOPATH=%{gopath} go install
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{configdir}
mkdir -p %{buildroot}%{_unitdir}
cp %{gopath}/bin/icingadb %{buildroot}%{_sbindir}
cp etc/config_production.ini %{buildroot}%{configdir}/config.ini
cp etc/%{service} %{buildroot}%{_unitdir}
getent group icingadb >/dev/null || groupadd -r icingadb
getent passwd icingadb >/dev/null || useradd -r -g icingadb -d / -s /sbin/nologin -c 'Icinga DB' icingadb
%systemd_post %{service}
%systemd_preun %{service}
%systemd_postun %{service}
rm -rf %{buildroot}
%attr(0755,icingadb,icingadb) %{_sbindir}/icingadb
%attr(0750,icingadb,icingadb) %config(noreplace) %dir %{configdir}
%attr(0640,icingadb,icingadb) %config(noreplace) %{configdir}/config.ini
%attr(0644,root,root) %{_unitdir}/%{service}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment