Whamcloud - gitweb
LU-12068 tests: add debug for sanity-lfsck test_6b
[fs/lustre-release.git] / lustre.spec.in
index 1ce962b..75a705c 100644 (file)
@@ -9,12 +9,21 @@
 %bcond_without lustre_iokit
 %bcond_without lustre_modules
 %bcond_with snmp
-%bcond_without gss_keyring
+%bcond_with gss
+%bcond_with gss_keyring
 %bcond_without manpages
 %bcond_without shared
 %bcond_without static
 %bcond_with    systemd
 
+# By default both gss and gss keyring are disabled.
+# gss keyring requires the gss core. If the builder
+# request gss_keyring we must enable gss core even if
+# the builder attempts to disable gss.
+%if %{with gss_keyring}
+    %define with_gss
+%endif
+
 %if %{without servers}
     # --without servers overrides --with {ldiskfs|zfs}
     # so undefine the internal variables set by bcond_*
@@ -132,7 +141,7 @@ Source4: kmp-lustre-osd-ldiskfs.files
 Source5: kmp-lustre-osd-zfs.preamble
 Source6: kmp-lustre-osd-zfs.files
 Source7: kmp-lustre-tests.files
-URL: https://wiki.hpdd.intel.com/
+URL: https://wiki.whamcloud.com/
 BuildRoot: %{_tmppath}/lustre-%{version}-root
 Requires: %{requires_kmod_name} = %{requires_kmod_version} zlib
 Requires: %{requires_yaml_name}
@@ -167,7 +176,27 @@ BuildRequires: systemd
 Userspace tools and files for the Lustre file system.
 
 %if %{with lustre_modules}
-%kernel_module_package -n %{name} -p %SOURCE1 -f %SOURCE2 default
+%if 0%{?rhel} == 7
+# until we have achieved full kABI compatibility we need to
+# restrict the kernel range that can be used to the kernel
+# version from the RHEL minor release
+# this is supposed to be done for kmods automatically but
+# RHBZ#1467319 seems to be getting in the way
+# this is true for el7.0 through el7.4
+%define preamble %{expand:%(
+TMPFILE=`mktemp`
+cat %{SOURCE1} > $TMPFILE
+kver=%{kver}
+linuxversion=${kver%%%%-*}
+linuxrelease=${kver##*-}
+kabiminor=${linuxrelease%%%%.*}
+echo "Requires:       kernel < $linuxversion-$((kabiminor+1)), kernel >= $linuxversion-$((kabiminor))" >> $TMPFILE
+echo $TMPFILE
+)}
+%else
+%define preamble %{SOURCE1}
+%endif
+%kernel_module_package -n %{name} -p %preamble -f %SOURCE2 default
 
 %if %{with ldiskfs}
 %kernel_module_package -n %{name}-osd-ldiskfs -p %SOURCE3 -f %SOURCE4 default
@@ -313,6 +342,7 @@ fi
        %{!?with_servers:--disable-server} \
        %{!?with_zfs:--without-zfs} \
        %{!?with_snmp:--disable-snmp} \
+       %{!?with_gss:--disable-gss} \
        %{!?with_gss_keyring:--disable-gss-keyring} \
        %{!?with_manpages:--disable-manpages} \
        %{!?with_systemd:--with-systemdsystemunitdir=no} \
@@ -364,12 +394,12 @@ echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
 # systemd is on redhat, fedora, and suse
 %if %{with systemd}
 echo '%{_unitdir}/lnet.service' >>lustre.files
+echo '%{_unitdir}/lustre.service' >>lustre.files
 %endif
 
 %if %{_vendor}=="redhat"
 # The following scripts are Red Hat specific
 %if %{with servers}
-echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
 echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
 %if %{with gss_keyring}
 echo '%{_sysconfdir}/init.d/lsvcgss' >>lustre.files
@@ -379,17 +409,11 @@ echo '%{_sysconfdir}/sysconfig/lsvcgss' >>lustre.files
 
 %if %{without systemd}
 echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
+echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
 %endif
 %endif
-
-CONFIGURE_ARGS="%{?configure_args}"
-if [ -z "$(echo $CONFIGURE_ARGS | grep "\-\-disable\-gss\-keyring")" ]; then
-    echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
-fi
-
-%if %{with servers}
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/lustre/
-install -m 0755 contrib/scripts/pacemaker/* $RPM_BUILD_ROOT%{_prefix}/lib/ocf/resource.d/lustre/
+%if %{with gss_keyring}
+echo '%config(noreplace) %{_sysconfdir}/request-key.d/lgssc.conf' >>lustre.files
 %endif
 
 # fc18 needs 'x' permission for library files
@@ -475,6 +499,9 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files
 %{_includedir}/linux/lustre
 %endif
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
+%if %{with servers}
+%{_sysconfdir}/udev/rules.d/99-lustre-server.rules
+%endif
 %if %{with zfs}
 %config(noreplace) %{_sysconfdir}/ldev.conf
 %endif
@@ -546,15 +573,18 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files
 %post
 %if %{with systemd}
 %systemd_post lnet.service
+%systemd_post lustre.service
 %endif
 
 %preun
 %if %{with systemd}
+%systemd_preun lustre.service
 %systemd_preun lnet.service
 %endif
 
 %postun
 %if %{with systemd}
+%systemd_postun_with_restart lustre.service
 %systemd_postun_with_restart lnet.service
 %endif