%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
%endif
%endif
-%if 0%{?_systemd}
+%if %{with systemd}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# 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
%{!?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}
%endif
# systemd is on redhat, fedora, and suse
-%if 0%{?_systemd}
+%if %{with systemd}
echo '%{_unitdir}/lnet.service' >>lustre.files
%endif
echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
%endif
-%if 0%{!?_systemd:1}
+%if %{without systemd}
echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
%endif
%{_datadir}/lustre
%{_sysconfdir}/udev/rules.d/99-lustre.rules
%config(noreplace) %{_sysconfdir}/ldev.conf
+%if %{with lnet_dlc}
+%config(noreplace) %{_sysconfdir}/lnet.conf
+%endif
%config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf
%if %{with lustre_utils}
%config(noreplace) %{_sysconfdir}/lnet_routes.conf
%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