Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
server:monitoring
icingadb
icingadb.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File icingadb.spec of Package icingadb
%define revision 1 %global provider github %global provider_tld com %global project Icinga %global repo icingadb %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} %if ! 0%{?gobuild:1} %define gobuild(o:) %{?golang_scl_enable} go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; %endif %if ! 0%{?gopath:1} %define gopath %(%{?golang_scl_enable} go env GOPATH) %endif Name: icingadb Version: 1.1.0 Release: 0 Summary: Icinga DB Group: System Environment/Daemons License: GPL-2.0-or-later Group: System/Monitoring URL: https://%{provider_prefix} Source0: %{name}-%{version}.tar.gz Source1: vendor.tar.gz Source2: %{name}.service Source3: icingadb-redis.service.suse Source4: icingadb-redis.service.rhel Source5: icingadb-redis.conf BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} BuildRequires: git Requires: go BuildRequires: golang-packaging BuildRequires: golang(API) >= 1.18 %{?systemd_requires} BuildRequires: systemd %define debug_package %nil Requires: icinga-redis %if "%{_vendor}" == "suse" PreReq: permissions Provides: user(icingadb) Provides: group(icingadb) Requires(pre): shadow Requires(post): shadow %else # suse Requires(pre): shadow-utils %endif # suse %define configdir %{_sysconfdir}/%{name} %define service %{name}.service %{go_nostrip} %{go_provides} %description Icinga DB %package redis Summary: Icinga Redis for Icinga DB Group: System/Monitoring Requires: icinga-redis %description redis Redis service for Icinga DB. %prep %setup -q -n %{name}-%{version} tar -xvzf %{SOURCE1} ###tar -xvzf %%{SOURCE10} -C . %build %{goprep} %{provider_prefix} export GOFLAGS="$GOFLAGS -buildmode=pie -mod=vendor" ###%%gobuild ./cmd/icingadb go build -ldflags "-s -w" -o icingadb -v ./cmd/icingadb %check %if ! 0%{?gotest:1} %global gotest %{?golang_scl_enable} go test %endif #%%gotest ./... %install ##%%{goinstall} ##%%{gofilelist} install -d -m 0755 %{buildroot}%{_sbindir} install -d -m 0755 %{buildroot}%{configdir} install -d -m 0755 %{buildroot}%{_unitdir} install -m 0755 icingadb %{buildroot}%{_sbindir}/ install -m 0644 config.example.yml %{buildroot}%{configdir}/config.yml install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/ install -d -m 0755 %{buildroot}%{_datadir}/%{name} (umask 0022 && cp -rv schema %{buildroot}%{_datadir}/%{name}/) %if %{?suse_version} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %endif # install redis - Is this still needed? install -d -m 0755 %{buildroot}%{_sharedstatedir}/icinga-redis/icingadb-redis # Install custom systemd service file for icingadb-redis. Source1 is SUSE, Source2 is RHEL. %if %{?suse_version} install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/icingadb-redis.service ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-redis %else install -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/icingadb-redis.service %endif install -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/icinga-redis/icingadb-redis.conf %pre getent group icingadb >/dev/null || groupadd -r icingadb getent passwd icingadb >/dev/null || useradd -r -g icingadb -d /etc/icingadb -s /sbin/nologin -c 'Icinga DB' icingadb %if %{?suse_version} %service_add_pre %{service} %endif %pre redis %if %{?suse_version} %service_add_pre icingadb-redis.service %endif %post %if %{?suse_version} %service_add_post %{service} %else %systemd_post %{service} %endif %post redis %if %{?suse_version} %fillup_only icingadb-redis %service_add_post icingadb-redis.service %else # rhel %systemd_post icingadb-redis.service %endif %preun %if %{?suse_version} %service_del_preun %{service} %else %systemd_preun %{service} %endif %preun redis # suse %if %{?suse_version} %service_del_preun icingadb-redis.service %else %systemd_preun icingadb-redis.service %endif exit 0 %postun %if %{?suse_version} %service_del_postun %{service} %else %systemd_postun %{service} %endif %postun redis # suse %if %{?suse_version} %service_del_postun icingadb-redis.service %else %systemd_postun_with_restart icingadb-redis.service %endif exit 0 %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc LICENSE AUTHORS README.md CHANGELOG.md %{_sbindir}/icingadb %{_unitdir}/%{service} %if %{?suse_version} %{_sbindir}/rc%{name} %endif %dir %{_datadir}/%{name} %{_datadir}/%{name}/schema %defattr(0644,icingadb,icingadb,0755) %dir %{configdir} %config(noreplace) %{configdir}/config.yml %files redis %defattr(-,root,root,-) #%%doc AUTHORS COPYING README.md %dir %{_sysconfdir}/icinga-redis %dir %{_sharedstatedir}/icinga-redis %config(noreplace) %attr(0644,redis,redis) %{_sysconfdir}/icinga-redis/icingadb-redis.conf %if %{?suse_version} %{_sbindir}/rc%{name}-redis %endif %attr(644,root,root) %{_unitdir}/icingadb-redis.service %dir %attr(755,redis,redis) %{_sharedstatedir}/icinga-redis/icingadb-redis %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor