%{!?build_dkmspkg: %define build_dkmspkg 1}
-# Determine presence of rpmbuild command line --define arguments used for
-# option specification
+#
+# 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 build_authlibs_on_cmdline %{?build_authlibs:1}%{!?build_authlibs: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
+%if !%{build_modules_on_cmdline}
+%define build_modules 1
+%endif
+%if !%{debugspec_on_cmdline}
+%define debugspec 0
+%endif
+
+# Specify '--without authlibs' if you do not want to build the openafs-authlibs
+# package.
+%define build_authlibs %{?_without_authlibs:0}%{!?_without_authlibs:1}
+# Specify '--without krb5' if you do not want to build the openafs-krb5 package
+# to distribute aklog, asetkey, and akeyconvert.
+%define krb5support %{?_without_krb5:0}%{!?_without_krb5:1}
+
+# Specify '--with bootkernel' if you want to build the
+# kernel module for Red Hat BOOT Kernels on x86.
+%define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0}
+
+#
+# Definitions
+#
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%define depmod /usr/sbin/depmod
%else
%define dkms_version %{pkgvers}-%{pkgrel}%{?dist}
-# Set 'debugspec' to 1 if you want to debug the spec file. This will
-# not remove the installed tree as part of the %clean operation
-%if %{?debugspec:0}%{!?debugspec:1}
-%define debugspec 0
-%endif
-
-# Set 'krb5support' to 1 if you want to build the openafs-krb5 package
-# to distribute aklog and asetkey
-%define krb5support %{?_without_krb5:0}%{!?_without_krb5:1}
-
-# Set 'bootkernelsupport' to 1 if you want to build the
-# kernel module for Red Hat BOOT Kernels on x86.
-%define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0}
-
# Define the location of your init.d directory
%define initdir /etc/rc.d/init.d
# 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
-
-# Make sure RPM doesn't complain about installed but non-packaged files.
-#define __check_files %{nil}
-
Summary: OpenAFS distributed filesystem
Name: openafs
Version: %{pkgvers}
The build will define ksrvdir as
%%{kbase}<kernvers>%%{kend}
+ --without authlibs Disable authlibs package (default: with authlibs)
--without krb5 Disable krb5 support (default: with krb5)
--with bitmap-later Enable "bitmap later" support
--with bos-restricted Enable "bos restricted" mode
--with supergroups Enable "supergroups"
--target=i386 The target architecture to build for.
- When building for a non-default target
- the build may choose whether to build
- userspace or kernel modules automatically.
- The defaults are probably what you want.
--define "build_userspace 1" Request building of userspace tools
--define "build_modules 1" Request building of kernel modules
%if %{krb5support}
--with-krb5 \
%endif
+ --enable-kauth \
$config_opts \
|| exit 1
rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/klog
rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/klog.krb
rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/kpwvalid
+rm -f $RPM_BUILD_ROOT%{_sbindir}/kpwvalid
rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/pts
rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/tokens
rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/tokens.krb
rm -f $RPM_BUILD_ROOT%{_bindir}/install
rm -f $RPM_BUILD_ROOT%{_bindir}/knfs
rm -f $RPM_BUILD_ROOT%{_bindir}/livesys
-rm -f $RPM_BUILD_ROOT%{_sbindir}/kdb
+rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/kdb
rm -f $RPM_BUILD_ROOT%{_sbindir}/rmtsysd
-rm -f $RPM_BUILD_ROOT%{_sbindir}/kpwvalid
rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
%if !%{build_authlibs}
rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so*
rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so*
+rm -f $RPM_BUILD_ROOT%{_libdir}/libkopenafs.so*
%endif
+rm -f $RPM_BUILD_ROOT%{_sbindir}/afsd.fuse
+
+# Relocate afsd to legacy path to match init scripts.
+mv $RPM_BUILD_ROOT%{_sbindir}/afsd $RPM_BUILD_ROOT%{_prefix}/vice/etc/afsd
# Relocate admin utilities to a modern path.
-mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/restorevol $RPM_BUILD_ROOT%{_bindir}/restorevol
+mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/kadb_check $RPM_BUILD_ROOT%{_sbindir}/kadb_check
+mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/prdb_check $RPM_BUILD_ROOT%{_sbindir}/prdb_check
+mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/vldb_check $RPM_BUILD_ROOT%{_sbindir}/vldb_check
+mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/vldb_convert $RPM_BUILD_ROOT%{_sbindir}/vldb_convert
%if %{krb5support}
+mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/akeyconvert $RPM_BUILD_ROOT%{_sbindir}/akeyconvert
mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/asetkey $RPM_BUILD_ROOT%{_sbindir}/asetkey
%endif
mkdir -p $RPM_BUILD_ROOT%{pamdir}
mv $RPM_BUILD_ROOT%{_libdir}/pam_afs.krb.so $RPM_BUILD_ROOT%{pamdir}
mv $RPM_BUILD_ROOT%{_libdir}/pam_afs.so $RPM_BUILD_ROOT%{pamdir}
-ln -sf pam_afs.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.so
-ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so
+ln -sf pam_afs.so $RPM_BUILD_ROOT%{pamdir}/pam_afs.so.1
+ln -sf pam_afs.krb.so $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so.1
# Rename kpasswd to avoid conflicting with krb5 kpasswd.
mv $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/rmtsysd.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/aklog_dynamic_auth.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/kdb.*
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/kpwvalid.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/xfs_size_check.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/package_test.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man5/package.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/package.*
%if !%{krb5support}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/akeyconvert.*
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/asetkey.*
%endif
%{_mandir}/man8/bos_*.*
%{_mandir}/man8/bosserver.*
%{_mandir}/man8/butc.*
+%{_mandir}/man8/dafssync-debug.*
+%{_mandir}/man8/dafssync-debug_*.*
%{_mandir}/man8/fms.*
%{_mandir}/man8/fssync-debug.*
%{_mandir}/man8/fssync-debug_*.*
%{_bindir}/up
%{_prefix}/vice/etc/afsd
%{_prefix}/vice/etc/C/afszcm.cat
+%{_libdir}/libuafs.a
+%{_libdir}/libuafs_pic.a
%{pamdir}/pam_afs.krb.so.1
%{pamdir}/pam_afs.krb.so
%{pamdir}/pam_afs.so.1
%endif
%{_mandir}/man1/cmdebug.*
%{_mandir}/man1/up.*
+%{_mandir}/man3/AFS::ukernel.*
%{_mandir}/man5/afs.5.gz
%{_mandir}/man5/afs_cache.5.gz
%{_mandir}/man5/afs_volume_header.5.gz
%{_mandir}/man5/FORCESALVAGE.*
%{_mandir}/man5/FileLog.*
%{_mandir}/man5/KeyFile.*
+%{_mandir}/man5/KeyFileExt.*
%{_mandir}/man5/NetInfo.*
%{_mandir}/man5/NetRestrict.*
%{_mandir}/man5/NoAuth.*
+%{_mandir}/man5/PtLog.*
%{_mandir}/man5/SALVAGE.fs.*
%{_mandir}/man5/SalvageLog.*
%{_mandir}/man5/sysid.*
%{_includedir}/timer.h
%{_includedir}/ubik.h
%{_includedir}/ubik_int.h
+%{_includedir}/opr/queue.h
%{_libdir}/afs
%{_libdir}/libafshcrypto.a
%{_libdir}/libafshcrypto.so
+%{_libdir}/libafsrfc3961.a
%{_libdir}/liblwp.a
%{_libdir}/libopr.a
%{_libdir}/librokenafs.a
%{_libdir}/librxkad.a
%{_libdir}/librxstat.a
%{_libdir}/libubik.a
-%{_libdir}/libubik_pthread.a
%{_mandir}/man1/rxgen.*
%{_mandir}/man1/afs_compile_et.*
%defattr(-,root,root)
%{_bindir}/aklog
%{_bindir}/klog.krb5
+%{_sbindir}/akeyconvert
%{_sbindir}/asetkey
%{_mandir}/man1/aklog.*
%{_mandir}/man1/klog.krb5.*
+%{_mandir}/man8/akeyconvert.*
%{_mandir}/man8/asetkey.*
%endif