Whamcloud - gitweb
LU-9210 statahead: missing barrier before wake_up
[fs/lustre-release.git] / lustre.spec.in
index 03f8480..59a3352 100644 (file)
        %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}
@@ -341,6 +331,8 @@ mv $basemodpath/fs/osd_zfs.ko $basemodpath-osd-zfs/fs/osd_zfs.ko
 %if %{with lustre_tests}
 mkdir -p $basemodpath-tests/fs
 mv $basemodpath/fs/llog_test.ko $basemodpath-tests/fs/llog_test.ko
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
+mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
 %endif
 
 :> lustre.files
@@ -355,7 +347,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 +359,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
 
@@ -402,6 +394,7 @@ if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
 fi
 
 %if %{with lustre_utils}
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/lustre
 find $RPM_BUILD_ROOT%{_libdir}/@PACKAGE@ -name \*.la -type f -exec rm -f {} \;
 %endif
 
@@ -448,11 +441,14 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files
 %if %{with manpages}
 %{_mandir}/man?/*
 %endif
+%{_datadir}/lustre
 %{_includedir}/lustre
 %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
@@ -513,17 +509,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