From: Derrick Brashear Date: Thu, 29 Mar 2012 14:44:53 +0000 (-0400) Subject: linux: update spec requirements X-Git-Tag: upstream/1.6.2_pre2^2~12 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5cfb72022a2647e04fd2a398b9623311a1716f5a;p=packages%2Fo%2Fopenafs.git linux: update spec requirements don't require things which don't exist on el5. do require them in el6. require kernel-devel if building modules don't do anything involving the kernel if not building modules if we can figure out that we don't have 2.4 based on the version, avoiding the need to depend on kernel-devel just to build an srpm. Reviewed-on: http://gerrit.openafs.org/6985 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 72f5d88acc752ff447a9e63327c135473326a34d) Change-Id: Ibcc53eb6a742de2101a054070e9b48607d0bce1d Reviewed-on: http://gerrit.openafs.org/8787 Tested-by: BuildBot Reviewed-by: Paul Smeddle Reviewed-by: Stephan Wiesand Tested-by: Stephan Wiesand --- diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index fc099dbce..7e3a8de22 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -16,6 +16,14 @@ %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0} %define build_authlibs_on_cmdline %{?build_authlibs:1}%{!?build_authlibs:0} +%if 0%{?rhel} >= 5 +%define fedorakmod 1 +%endif +%if 0%{?fedora} +%define fedorakmod 1 +%endif + +%if !%{fedorakmod} # Determine the version of the kernel to build against # - automatically select running kernel if there are sources in /lib/modules # - note that this can be overridden on the command line @@ -32,6 +40,7 @@ %if %{kern24} %define fedorakmod 0 %endif +%endif %if %{fedorakmod} %define kmodtool bash %{_sourcedir}/openafs-kmodtool @@ -107,6 +116,43 @@ # Define the location of the PAM security module directory %define pamdir /%{_lib}/security +####################################################################### +# You probably don't need to change anything beyond this line +# NOTE: If you do, please email me!!! + +# Determine which elements of OpenAFS to build. For non-x86 arches +# (subject to the ExclusiveArch setting, below), we build both userspace +# and modules. For most x86 arches, we build just the kernel modules. For +# i386, we build just the userspace. If you're running an i386 kernel, +# you'll need to tweak that last bit. +%if !%{build_userspace_on_cmdline} && !%{build_modules_on_cmdline} + +%define build_userspace 1 +%define build_modules 1 +%ifarch %{ix86} x86_64 ia64 +%define build_authlibs 1 +%else +%define build_authlibs 0 +%endif + +%else +%if !%{build_userspace_on_cmdline} +%define build_userspace 0 +%endif +%if !%{build_modules_on_cmdline} +%define build_modules 0 +%endif +%endif + +%if !%{build_authlibs_on_cmdline} +%if %{build_userspace_on_cmdline} +%define build_authlibs 1 +%else +%define build_authlibs 0 +%endif +%endif + +%if %{build_modules} %if !%{fedorakmod} # Define the set of kernel module variations to be built: @@ -175,41 +221,6 @@ # End of legacy kernel module build %endif - -####################################################################### -# You probably don't need to change anything beyond this line -# NOTE: If you do, please email me!!! - -# Determine which elements of OpenAFS to build. For non-x86 arches -# (subject to the ExclusiveArch setting, below), we build both userspace -# and modules. For most x86 arches, we build just the kernel modules. For -# i386, we build just the userspace. If you're running an i386 kernel, -# you'll need to tweak that last bit. -%if !%{build_userspace_on_cmdline} && !%{build_modules_on_cmdline} - -%define build_userspace 1 -%define build_modules 1 -%ifarch %{ix86} x86_64 ia64 -%define build_authlibs 1 -%else -%define build_authlibs 0 -%endif - -%else -%if !%{build_userspace_on_cmdline} -%define build_userspace 0 -%endif -%if !%{build_modules_on_cmdline} -%define build_modules 0 -%endif -%endif - -%if !%{build_authlibs_on_cmdline} -%if %{build_userspace_on_cmdline} -%define build_authlibs 1 -%else -%define build_authlibs 0 -%endif %endif # Make sure RPM doesn't complain about installed but non-packaged files. @@ -226,12 +237,19 @@ Packager: OpenAFS Gatekeepers Group: Networking/Filesystems BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison %if 0%{?fedora} >= 15 -BuildRequires: systemd-units +BuildRequires: systemd-units perl-devel +%endif +%if 0%{?rhel} >= 6 +BuildRequires: perl-devel %endif -BuildRequires: perl-devel perl-ExtUtils-Embed +BuildRequires: perl(ExtUtils::Embed) %if %{krb5support} BuildRequires: krb5-devel %endif +%if %{build_modules} +BuildRequires: kernel-devel +%endif + ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64 # http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/... @@ -686,7 +704,7 @@ This package provides a precompiled AFS kernel module for %{kernvers}. # ############################################################################## %build - +%if !%{fedorakmod} case %{kernvers} in 2.4.*) kv='24' @@ -699,6 +717,9 @@ case %{kernvers} in exit 1 ;; esac +%else +kv='26' +%endif case %{_arch} in x86_64) sysname=amd64_linux${kv} ;; @@ -964,7 +985,7 @@ rm -f src/config/redhat-fix.h export DONT_GPRINTIFY=1 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT - +%if !%{fedorakmod} case %{kernvers} in 2.4.*) kv='24' @@ -979,6 +1000,9 @@ case %{kernvers} in exit 1 ;; esac +%else +kv='26' +%endif case %{_arch} in x86_64) sysname=amd64_linux${kv} ;;