Whamcloud - gitweb
LU-7643 build: Remove Linux version string from RPM release field 54/19954/7
authorChristopher J. Morrone <morrone2@llnl.gov>
Tue, 12 Jul 2016 14:13:53 +0000 (10:13 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 20 Jul 2016 17:42:28 +0000 (17:42 +0000)
With the landing of the patch:

  "LU-5614 build: use %kernel_module_package in rpm spec"

we neither need, nor desire, to tie a lustre build to a specific
Linux kernel version.  Instead we want to allow the weak updates
system to symlink the lustre modules into any and all kernel
directories that are ABI compatible.

Therefore, we remove the Linux version string from Lustre's
RPM release field.

Note that "%define krequires" is moved to a SLES-only section
when the 0%{?build_src_rpm} conditional is removed.  This may
seem like an odd place to put it at first glance.  But the
next line is the only remaining consumer of krequires, so
we are just moving it to the last place that it might be needed.
This could perhaps be simplified further in a future commit.

When removing the no longer needed %{fullrelease} from the Release
field, we replace it with a 1 and with the %{?dist} string.
%{?dist} is customary for Fedora, RHEL, and likely most rpm-based
distros.

Because the release field is no longer modified between the source
rpm and binary rpm build steps, there is not longer a need for
The build_src_rpm macro.  That is removed as well.

Test-Parameters: trivial
Change-Id: I8306f48d5bf0dffcae2888505ec7f0f63e47fc08
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/19954
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
autoMakefile.am
lustre.spec.in

index cd0fb11..5fb234e 100644 (file)
@@ -175,7 +175,6 @@ srpm: @PACKAGE_TARNAME@.spec dist Makefile
        $(RPMBUILD) \
                --define "_tmppath $$rpmbuilddir/TMP" \
                --define "_topdir $$rpmbuilddir" \
        $(RPMBUILD) \
                --define "_tmppath $$rpmbuilddir/TMP" \
                --define "_topdir $$rpmbuilddir" \
-               --define "build_src_rpm 1" \
                --define "dist %{nil}" \
                -ts $(distdir).tar.gz || exit 1; \
        cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
                --define "dist %{nil}" \
                -ts $(distdir).tar.gz || exit 1; \
        cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
index 2983636..9d3c2f4 100644 (file)
 # selection with our selection.
 %{!?kernel_version: %global kernel_version %kversion}
 
 # selection with our selection.
 %{!?kernel_version: %global kernel_version %kversion}
 
-%if 0%{?build_src_rpm}
-    %{!?myrelease: %global myrelease 1}
-%else
-    %{!?myrelease: %global myrelease %(echo %kversion | tr '-' '_')}
-    # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end
-    # of %kversion
-    %define krequires %(echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//')
-%endif
-
-%define fullrelease %{myrelease}
-
 # in order to get kernel symset and/or kernel module dependencies into
 # the RPM, in order to support weak-modules, the internal dependency gen-
 # erator needs to be disabled
 # in order to get kernel symset and/or kernel module dependencies into
 # the RPM, in order to support weak-modules, the internal dependency gen-
 # erator needs to be disabled
@@ -94,6 +83,7 @@
        %global requires_kmod_version %{version}
 %else  #for Suse
        %global requires_kmod_name %{lustre_name}-kmp
        %global requires_kmod_version %{version}
 %else  #for Suse
        %global requires_kmod_name %{lustre_name}-kmp
+       %define krequires %(echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//')
        %if 0%{?suse_version} >= 1200
                %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
        %else
        %if 0%{?suse_version} >= 1200
                %global requires_kmod_version %{version}_k%(echo %{krequires} | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/;')
        %else
 Summary: Lustre File System
 Name: %{lustre_name}
 Version: %{version}
 Summary: Lustre File System
 Name: %{lustre_name}
 Version: %{version}
-Release: %{fullrelease}
+Release: 1%{?dist}
 License: GPL
 Group: Utilities/System
 Source: lustre-%{version}.tar.gz
 License: GPL
 Group: Utilities/System
 Source: lustre-%{version}.tar.gz
@@ -124,7 +114,7 @@ BuildRequires: libtool
 %if %{with servers}
 Requires: lustre-osd
 Requires: lustre-osd-mount
 %if %{with servers}
 Requires: lustre-osd
 Requires: lustre-osd-mount
-Provides: lustre-client = %{version}-%{fullrelease}
+Provides: lustre-client = %{version}-%{release}
 %endif
 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
 %endif
 # GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"