From 17536a11cbfbf835d1aeed1ab66990311f914c515ccb340335f8ed3cfff54b2f Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Thu, 20 Sep 2018 12:51:25 +0000 Subject: [PATCH] - only reload the apparmor profile on newer distros, seems older distros do not have apparmor-rpm-macros yet - only use network namespaces on 12.x and newer, failed to build on sle11 - guard all parts referring to systemd to fix build on sle 11 OBS-URL: https://build.opensuse.org/package/show/server:http/haproxy?expand=0&rev=174 --- haproxy.changes | 17 +++++++++++++++++ haproxy.spec | 17 ++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/haproxy.changes b/haproxy.changes index 7f26846..7ff7056 100644 --- a/haproxy.changes +++ b/haproxy.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Thu Sep 20 12:50:35 UTC 2018 - Marcus Rueckert + +- only reload the apparmor profile on newer distros, seems older + distros do not have apparmor-rpm-macros yet + +------------------------------------------------------------------- +Thu Sep 20 12:45:57 UTC 2018 - Marcus Rueckert + +- only use network namespaces on 12.x and newer, failed to build on + sle11 + +------------------------------------------------------------------- +Thu Sep 20 12:39:42 UTC 2018 - Marcus Rueckert + +- guard all parts referring to systemd to fix build on sle 11 + ------------------------------------------------------------------- Thu Sep 20 12:34:47 UTC 2018 - mrueckert@suse.de diff --git a/haproxy.spec b/haproxy.spec index b1dcf0b..f19dc86 100644 --- a/haproxy.spec +++ b/haproxy.spec @@ -15,11 +15,12 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ %if 0%{?suse_version} >= 1230 %bcond_without tcp_fast_open +%bcond_without network_namespace %else %bcond_with tcp_fast_open +%bcond_with network_namespace %endif -%bcond_without network_namespace %if 0%{?suse_version} > 1320 %bcond_without lua %else @@ -37,7 +38,13 @@ %else %bcond_with pcre_jit %endif + %bcond_without apparmor +%if 0%{?suse_version} > 1320 +%bcond_without apparmor_reload +%else +%bcond_with apparmor_reload +%endif Name: haproxy Version: 1.8.14~git0.52e4d43b @@ -53,7 +60,7 @@ Requires: apparmor-profiles BuildRequires: apparmor-abstractions Requires: apparmor-abstractions %endif -%if 0%{?suse_version} >= 1315 +%if %{with apparmor_reload} BuildRequires: apparmor-rpm-macros %endif %endif @@ -142,14 +149,18 @@ make \ %if %{with network_namespace} USE_NS=1 \ %endif +%if %{with systemd} USE_SYSTEMD=1 \ +%endif USE_PIE=1 \ USE_STACKPROTECTOR=1 \ USE_RELRO_NOW=1 \ LIB="%{_lib}" \ PREFIX="%{_prefix}" \ DEBUG_CFLAGS="%{optflags}" +%if %{with systemd} make -C contrib/systemd PREFIX="%{_prefix}" +%endif make -C contrib/halog PREFIX="%{_prefix}" \ DEFINE="%{optflags} -pie -fpie -fstack-protector -Wl,-z,relro,-z,now" @@ -203,7 +214,7 @@ getent passwd %{pkg_name} >/dev/null || \ %post %fillup_and_insserv %{pkg_name} -%if %{with apparmor} && (0%{?suse_version} >= 1315) +%if %{with apparmor} && %{with apparmor_reload} %apparmor_reload /etc/apparmor.d/usr.sbin.haproxy %endif