redhat: parallel builds
[openafs.git] / src / packaging / RedHat / openafs.spec.in
index eed4976..8938e0d 100644 (file)
 # Determine presence of rpmbuild command line --define arguments and set
 # defaults if not present.
 #
-%define kernvers_on_cmdline %{?kernvers:1}%{!?kernvers:0}
 %define build_userspace_on_cmdline %{?build_userspace:1}%{!?build_userspace:0}
 %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0}
 %define debugspec_on_cmdline %{?debugspec:1}%{!?debugspec:0}
 
-%if !%{kernvers_on_cmdline}
-%define kernvers %(uname -r)
-%endif
 %if !%{build_userspace_on_cmdline}
 %define build_userspace 1
 %endif
@@ -96,7 +92,7 @@ BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
 BuildRequires: systemd-units
 %endif
 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
-BuildRequires: perl-devel
+BuildRequires: perl-devel, swig
 %endif
 BuildRequires: perl(ExtUtils::Embed)
 %if %{krb5support}
@@ -106,7 +102,7 @@ BuildRequires: krb5-devel
 BuildRequires: kernel-devel
 %endif
 
-ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
+ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64 aarch64
 
 #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
 Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
@@ -116,9 +112,8 @@ Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar
 Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
 Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
 
-Source20: https://www.central.org/dl/cellservdb/CellServDB.2016-01-01
+Source20: https://www.central.org/dl/cellservdb/CellServDB.2017-03-14
 
-Source30: openafs-kernel-version.sh
 Source996: openafs-kvers-is.sh
 Source997: openafs-buildfedora.pl
 Source998: openafs-buildall.sh
@@ -403,17 +398,6 @@ krb4 lookalike services.
 ##############################################################################
 %if %{build_modules}
 
-# Make debuginfo for the kernel components into their own package
-# so we can upgrade kernel and userspace seperately and still debug each
-%package -n %{name}-kernel-debuginfo
-Summary: Debug information for %{name} kernel modules
-Group: Development/Debug
-AutoReqProv: no
-%description -n %{name}-kernel-debuginfo
-This package provides debug information for %{name} kernel modules.
-
-%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*openafs.ko(\.debug)?' -o kmod-debuginfo.list}
-
 %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{depmod} %{kvariants} 2>/dev/null)}
 
 %endif
@@ -428,7 +412,7 @@ This package provides debug information for %{name} kernel modules.
 
 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 : @@@
-: @@@ kernel version:     %{kernvers}
+: @@@ kernel version:     %{kverrel}
 : @@@ kernel variations:  %{kvariants}
 : @@@ PAM modules dir:    %{pamdir}
 : @@@ build userspace:    %{build_userspace}
@@ -452,6 +436,7 @@ case %{_arch} in
        x86_64)                         sysname=amd64_linux26        ;;
        alpha*)                         sysname=alpha_linux_26       ;;
        i386|i486|i586|i686|athlon)     sysname=i386_linux26         ;;
+       aarch64)                        sysname=arm64_linux26        ;;
        *)                              sysname=%{_arch}_linux26     ;;
 esac
 
@@ -606,15 +591,22 @@ export KRB5_CONFIG
        --with-linux-kernel-packaging \
 %if %{build_modules}
        --with-linux-kernel-headers=${ksrc} \
+%else
+       --disable-kernel-module \
 %endif
 %if %{krb5support}
        --with-krb5 \
 %endif
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
+    --with-swig \
+%else
+    --without-swig \
+%endif
        $config_opts \
        || exit 1
 
 # Build the libafs tree
-make only_libafs_tree || exit 1
+make %{_smp_mflags} only_libafs_tree || exit 1
 
 %if %{krb5support}
 %if %{?krb5config:1}%{!?krb5config:0}
@@ -663,7 +655,7 @@ done
 
 %if %{build_userspace}
 # Build the user-space AFS stuff
-make all_nolibafs
+make %{_smp_mflags} all_nolibafs
 %endif
 
 %if %{build_modules}
@@ -671,10 +663,10 @@ for kvariant in %{kvariants}
 do
   if [ -n "${kvariant}" ] ; then
     pushd _kmod_build_$kvariant;
-    make all
+    make %{_smp_mflags} all
     popd
   else
-    make libafs
+    make %{_smp_mflags} libafs
   fi
 done
 %endif
@@ -701,7 +693,7 @@ export DONT_GPRINTIFY=1 # Do not modify initscripts.
 #-----------------------------------------------------------------------------
 # Install userspace files
 #-----------------------------------------------------------------------------
-make install_nolibafs DESTDIR="$RPM_BUILD_ROOT"
+make %{_smp_mflags} install_nolibafs DESTDIR="$RPM_BUILD_ROOT"
 
 # Set the executable bit on libraries in libdir, so rpmbuild knows to
 # create "Provides" entries in the package metadata for the libraries
@@ -809,6 +801,9 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man1/tokens.krb.1
 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/AuthLog.5
 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/AuthLog.dir.5
 %endif
+%if !(0%{?fedora} >= 15 || 0%{?rhel} >= 6)
+rm -f %{_mandir}/man3/AFS::ukernel.3
+%endif
 
 #-----------------------------------------------------------------------------
 # Install client and server initscripts/systemd files
@@ -1208,7 +1203,6 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
 %endif
 %{_mandir}/man1/cmdebug.1.gz
 %{_mandir}/man1/up.1.gz
-%{_mandir}/man3/AFS::ukernel.3.gz
 %{_mandir}/man5/afs.5.gz
 %{_mandir}/man5/afs_cache.5.gz
 %{_mandir}/man5/afs_volume_header.5.gz
@@ -1339,6 +1333,7 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
 %{_includedir}/timer.h
 %{_includedir}/ubik.h
 %{_includedir}/ubik_int.h
+%{_includedir}/opr/lock.h
 %{_includedir}/opr/queue.h
 %{_libdir}/afs
 %{_libdir}/libafshcrypto.a
@@ -1354,6 +1349,11 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
 %{_libdir}/libubik.a
 %{_mandir}/man1/rxgen.1.gz
 %{_mandir}/man1/afs_compile_et.1.gz
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
+%{_libdir}/perl/AFS/ukernel.pm
+%{_libdir}/perl/ukernel.so
+%{_mandir}/man3/AFS::ukernel.3.gz
+%endif
 
 %if %{build_dkmspkg}
 %files -n dkms-%{name}
@@ -1453,11 +1453,6 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
 %endif
 %endif  # build_userspace
 
-%if %{build_modules}
-%files -f kmod-debuginfo.list -n %{name}-kernel-debuginfo
-%defattr(-,root,root)
-%endif
-
 ##############################################################################
 ###
 ### openafs.spec change log