From 28c17d40e5a597a3d2f10f1f43039ef92425954e Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Tue, 12 Jul 2016 10:13:53 -0400 Subject: [PATCH] LU-7643 build: Remove Linux version string from RPM release field 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 Reviewed-on: http://review.whamcloud.com/19954 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- autoMakefile.am | 1 - lustre.spec.in | 16 +++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/autoMakefile.am b/autoMakefile.am index cd0fb11..5fb234e 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -175,7 +175,6 @@ srpm: @PACKAGE_TARNAME@.spec dist Makefile $(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; \ diff --git a/lustre.spec.in b/lustre.spec.in index 2983636..9d3c2f4 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -35,17 +35,6 @@ # 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 @@ -94,6 +83,7 @@ %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 @@ -104,7 +94,7 @@ Summary: Lustre File System Name: %{lustre_name} Version: %{version} -Release: %{fullrelease} +Release: 1%{?dist} 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 -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" -- 1.8.3.1