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

Import spec file

parents
%define revision 1
%define debug_package %{nil}
Name: icingadb
Version: 0.0
Release: %{revision}%{?dist}
Summary: Icinga DB
Group: System Environment/Daemons
License: GPLv2+
URL: https://git.icinga.com/icingadb/icingadb
Source0: %{name}-%{version}.tar.gz
Vendor: Icinga <info@icinga.com>
Packager: Icinga <info@icinga.com>
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: golang git
%{?systemd_requires}
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
%description
Icinga DB
%prep
%setup -q
%build
mkdir -p %{gopath}/src/git.icinga.com/icingadb
ln -s $(pwd) %{gopath}/src/git.icinga.com/icingadb/icingadb
GOPATH=%{gopath} go get git.icinga.com/icingadb/icingadb
GOPATH=%{gopath} go install git.icinga.com/icingadb/icingadb
%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}
%pre
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
%post
%systemd_post %{service}
%preun
%systemd_preun %{service}
%postun
%systemd_postun %{service}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
#%doc AUTHORS COPYING
%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