X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre-dkms.spec.in;h=e93c8518e647bbc7a33cda190e279a9dc55ebc6e;hp=09cfac151198ac6a1ed3c5f6497c6cc844f35d27;hb=037840fb6b86d6083d55f3da5ad70d19d34cc5a5;hpb=43ac2686e7eb9c1b042edcd9801e507ec941667c diff --git a/lustre-dkms.spec.in b/lustre-dkms.spec.in index 09cfac1..e93c851 100644 --- a/lustre-dkms.spec.in +++ b/lustre-dkms.spec.in @@ -1,19 +1,43 @@ %bcond_without servers +%bcond_without zfs +%bcond_with ldiskfs # Set the package name prefix %if %{with servers} - %define module @PACKAGE@ + %if %{with zfs} + %if %{with ldiskfs} + %define module @PACKAGE@-all + %else + %define module @PACKAGE@-zfs + %endif + %else + %if %{without ldiskfs} + %define module @PACKAGE@-BADSTATE + %else + %define module @PACKAGE@-ldiskfs + %endif + %endif + %define lustre_name @PACKAGE@ + %else - %define module @PACKAGE@-client + %define module @PACKAGE@-client + %define lustre_name @PACKAGE@-client %endif %if %{_vendor}=="redhat" || %{_vendor}=="fedora" - %global requires_kmod_name kmod-%{module} -%else #for Suse - %global requires_kmod_name %{module}-kmp + %global kmod_name kmod-%{lustre_name} + %define mkconf_options %{nil} +%else #for Suse / Ubuntu + %global kmod_name %{lustre_name}-kmp + %define mkconf_options "-k updates" %endif %define buildid 1 +%define mkconf lustre/scripts/dkms.mkconf + +# There should be a better (non-arch dependent) way to require ext4 +# sources +%define ext4_source_rpm kernel-debuginfo-common-x86_64 Name: %{module}-dkms @@ -32,74 +56,66 @@ BuildArch: noarch # (ie, "BUILD_DEPENDS[#]="), and have latest DKMS fixes integrated # for bugs that prevented our module to build/install. Requires: dkms >= 2.2.0.3-28.git.7c3e7c5 +# for lnetctl +Requires: libyaml-devel +Requires: zlib-devel %if %{with servers} -# Only zfs Lustre DKMS Server is supported -Requires: spl-dkms >= 0.6.1 -Requires: zfs-dkms >= 0.6.1 -Requires: %{module}-osd-zfs-mount # If client package is installed when installing server, remove it since # the server package also includes the client. This can be removed if/when # the packages are split into independent client/server/common packages. Obsoletes: @PACKAGE@-client < %{version} +%if %{with zfs} +Requires: zfs-dkms >= 0.6.5 +Requires: @PACKAGE@-osd-zfs-mount +Conflicts: @PACKAGE@-ldiskfs-dkms +Conflicts: @PACKAGE@-client-dkms +# lustre-zfs-dkms replicates the functionality old lustre-dkms package +Provides: @PACKAGE@-dkms +Obsoletes: @PACKAGE@-dkms +%endif +%if %{with ldiskfs} +Requires: patch +Requires: %{ext4_source_rpm} +Requires: @PACKAGE@-osd-ldiskfs-mount +Conflicts: @PACKAGE@-zfs-dkms +Conflicts: @PACKAGE@-client-dkms +%if "%{module}" != "@PACKAGE@-all" +Conflicts: @PACKAGE@-dkms +%endif +%endif +%if "%{module}" != "@PACKAGE@-all" +Conflicts: @PACKAGE@-all-dkms +%endif %endif Requires: gcc, make, perl Requires: kernel-devel -Provides: %{requires_kmod_name} = %{version} -Provides: %{module}-modules = %{version} +Provides: %{kmod_name} = %{version} +Provides: @PACKAGE@-modules = %{version} %if %{with servers} -# Only zfs Lustre DKMS Server is supported -Provides: %{module}-osd-zfs = %{version} -Provides: %{module}-osd +%if %{with zfs} +Provides: @PACKAGE@-osd-zfs = %{version} +%endif +%if %{with ldiskfs} +Provides: @PACKAGE@-osd-ldiskfs = %{version} +%endif +Provides: @PACKAGE@-osd +%else +Provides: @PACKAGE@-client %endif %description This package contains the dkms Lustre kernel modules. +%if %{with ldiskfs} + +The required %{ext4_source_rpm} package is available from +the repository with other debuginfo rpms. +%endif %prep %setup -q -n @PACKAGE@-%{version} %build -cat << EOF > dkms.conf -# Embryonic lustre-dkms dkms.conf to allow for on-target accurate and full -# version re-create during first run of Lustre DKMS module build step. -PACKAGE_NAME=%{module} -PACKAGE_VERSION=%{version} -PACKAGE_CONFIG="/etc/sysconfig/lustre" -PRE_BUILD="lustre-dkms_pre-build.sh \$module \$module_version \$kernelver \ - \$kernel_source_dir \$arch \$source_tree \$dkms_tree" -POST_BUILD="lustre-dkms_post-build.sh \$module \$module_version \$kernelver \ - \$kernel_source_dir \$arch \$source_tree \$dkms_tree" -EOF -%if %{with servers} -cat << EOF >> dkms.conf -BUILD_DEPENDS[0]="zfs" -EOF -%endif -cat << EOF >> dkms.conf -AUTOINSTALL="yes" -REMAKE_INITRD="no" -MAKE[0]="make" -# just have to set STRIP[0], it will become the new default. -STRIP[0]="\$( - [[ -r \${PACKAGE_CONFIG} ]] \\ - && source \${PACKAGE_CONFIG} \\ - && shopt -q -s extglob \\ - && [[ \${LUSTRE_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\ - && echo -n no -)" - -# at least one module's set of BUILT_MODULE_NAME[]/BUILT_MODULE_LOCATION[] -# elements, along with an install path made of either "extra" or "updates" -# subdir in its DEST_MODULE_LOCATION[] element, are required to fake during -# dkms.conf validity checks of "dkms [add,build]" steps. -# Final/full correct BUILT_MODULE_NAME[]/BUILT_MODULE_LOCATION[]/ -# DEST_MODULE_LOCATION[] sets of values for all modules will be fixed during -# on-target post-configure run of dkms.mkconf as part of build step. -# it must be for a module shared by both lustre[-client]-dkms packages. -BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lustre" -BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/llite/" -DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/extra/lustre/" -EOF +%{mkconf} -n %{module} -v %{version} -f dkms.conf %{mkconf_options} %install if [ "$RPM_BUILD_ROOT" != "/" ]; then @@ -107,10 +123,7 @@ if [ "$RPM_BUILD_ROOT" != "/" ]; then fi mkdir -p $RPM_BUILD_ROOT/usr/src/ cp -rfp ${RPM_BUILD_DIR}/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/ -%if %{without servers} -# To have the directory reflect the DKMS RPM name! mv $RPM_BUILD_ROOT/usr/src/@PACKAGE@-%{version} $RPM_BUILD_ROOT/usr/src/%{module}-%{version} -%endif %clean if [ "$RPM_BUILD_ROOT" != "/" ]; then @@ -140,6 +153,10 @@ dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade exit 0 %changelog +* Wed May 16 2018 Joe Grund +- Add patch requirement +* Mon Aug 1 2016 Nathaniel Clark +- Add option to build either ldiskfs or zfs flavour of server version * Sat Jan 23 2016 Bruno Faccini - detect and handle cases where [spl,zfs]-dkms packages are not built - also handle on-target configure issues