From: Giuseppe Di Natale Date: Fri, 19 May 2017 20:23:54 +0000 (-0700) Subject: LU-9526 spec: Improve systemd compat in spec file X-Git-Tag: 2.9.59~51 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=933cfab484343742cbcbf46e234d7c80b5f66160;p=fs%2Flustre-release.git LU-9526 spec: Improve systemd compat in spec file Few minor edits that make the systemd compatibility in the lustre.spec file cleaner. Signed-off-by: Giuseppe Di Natale Change-Id: I02076c7806f2c7cb318a505943dca0ca5a030093 Reviewed-on: https://review.whamcloud.com/27215 Reviewed-by: Christopher J. Morrone Tested-by: Jenkins Reviewed-by: Minh Diep Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre.spec.in b/lustre.spec.in index 03f8480..af05155 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -94,26 +94,21 @@ %endif %endif -# Generic enable switch for systemd -%if %{with systemd} -%define _systemd 1 -%endif - # RHEL >= 7 comes with systemd %if 0%{?rhel} >= 7 -%define _systemd 1 +%define with_systemd 1 %endif # Fedora >= 15 comes with systemd, but only >= 18 has # the proper macros %if 0%{?fedora} >= 18 -%define _systemd 1 +%define with_systemd 1 %endif # opensuse >= 12.1 comes with systemd, but only >= 13.1 # has the proper macros %if 0%{?suse_version} >= 1310 -%define _systemd 1 +%define with_systemd 1 %endif Summary: Lustre File System @@ -153,7 +148,7 @@ BuildRequires: redhat-rpm-config %endif %endif -%if 0%{?_systemd} +%if %{with systemd} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -276,12 +271,6 @@ cd $RPM_BUILD_DIR/lustre-%{version} # build failures %define optflags -g -O2 -Werror -%if 0%{?_systemd} - %define systemd --with-systemdsystemunitdir=%{_unitdir} -%else - %define systemd --with-systemdsystemunitdir=no -%endif - CONFIGURE_ARGS="%{?configure_args}" if [ -n "$CONFIGURE_ARGS" ]; then # make sure %%kdir and %%kobjdir are not in the configure arguments @@ -311,7 +300,8 @@ fi %{!?with_zfs:--without-zfs} \ %{!?with_lnet_dlc:--disable-dlc} \ %{!?with_manpages:--disable-manpages} \ - %{systemd} \ + %{!?with_systemd:--with-systemdsystemunitdir=no} \ + %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \ --with-linux=%{kdir} \ --with-linux-obj=%{kobjdir} \ --with-kmp-moddir=%{kmoddir}/%{name} @@ -355,7 +345,7 @@ echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files %endif # systemd is on redhat, fedora, and suse -%if 0%{?_systemd} +%if %{with systemd} echo '%{_unitdir}/lnet.service' >>lustre.files %endif @@ -367,7 +357,7 @@ echo '%{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files echo '%{_sysconfdir}/init.d/lustre' >>lustre.files %endif -%if 0%{!?_systemd:1} +%if %{without systemd} echo '%{_sysconfdir}/init.d/lnet' >>lustre.files %endif @@ -513,17 +503,17 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files %endif %post -%if 0%{?_systemd} +%if %{with systemd} %systemd_post lnet.service %endif %preun -%if 0%{?_systemd} +%if %{with systemd} %systemd_preun lnet.service %endif %postun -%if 0%{?_systemd} +%if %{with systemd} %systemd_postun_with_restart lnet.service %endif