Accepting request 1103501 from home:witekbedyk:branches:server:monitoring

Do not build with apparmor profile for SLE 12

OBS-URL: https://build.opensuse.org/request/show/1103501
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-lusitaniae-apache_exporter?expand=0&rev=24
This commit is contained in:
Witek Bedyk
2023-08-11 14:02:28 +00:00
committed by Git OBS Bridge
parent 0117c3a4c4
commit 69ad394300
2 changed files with 13 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Aug 11 12:55:45 UTC 2023 - Witek Bedyk <witold.bedyk@suse.com>
- Do not build with apparmor profile for SLE 12
-------------------------------------------------------------------
Tue Jul 11 11:18:57 UTC 2023 - Witek Bedyk <witold.bedyk@suse.com>

View File

@@ -25,7 +25,11 @@
%undefine _missing_build_ids_terminate_build
%endif
%bcond_without apparmor
%if 0%{?suse_version} >= 150000
%bcond_without apparmor
%else
%bcond_with apparmor
%endif
# Templating vars to simplify and standardize Prometheus exporters spec files
%define githubrepo github.com/lusitaniae/apache_exporter
@@ -43,7 +47,7 @@ URL: http://%{githubrepo}
Source: %{upstreamname}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: %{targetname}.service
%if 0%{?suse_version} && %{with apparmor}
%if %{with apparmor}
Source3: apparmor-usr.bin.%{targetname}
%endif
BuildRequires: fdupes
@@ -80,7 +84,7 @@ install -d -m 0755 %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
install -d -m 0755 %{buildroot}%{_sbindir}
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{targetname}
%if 0%{?suse_version} && %{with apparmor}
%if %{with apparmor}
# AppArmor profile
mkdir -p %{buildroot}%{_sysconfdir}/apparmor.d
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.%{targetname}
@@ -130,7 +134,7 @@ getent passwd %{serviceuser} >/dev/null || %{_sbindir}/useradd -r -g %{serviceus
%{_bindir}/%{targetname}
%{_unitdir}/%{targetname}.service
%{_sbindir}/rc%{targetname}
%if 0%{?suse_version} && %{with apparmor}
%if %{with apparmor}
%dir %{_sysconfdir}/apparmor.d
%config %{_sysconfdir}/apparmor.d/usr.bin.%{targetname}
%endif