1 # Openafs Spec $Revision$
3 %define afsvers @VERSION@
4 %define pkgvers @LINUX_PKGVER@
5 # for beta/rc releases make pkgrel 0.<tag>
6 # for real releases make pkgrel 1 (or more for extra releases)
7 %define pkgrel @LINUX_PKGREL@
9 %{!?fedorakmod: %define fedorakmod 1}
10 %{!?build_dkmspkg: %define build_dkmspkg 1}
12 # Determine presence of rpmbuild command line --define arguments used for
13 # option specification
14 %define kernvers_on_cmdline %{?kernvers:1}%{!?kernvers:0}
15 %define build_userspace_on_cmdline %{?build_userspace:1}%{!?build_userspace:0}
16 %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0}
17 %define build_authlibs_on_cmdline %{?build_authlibs:1}%{!?build_authlibs:0}
27 # Determine the version of the kernel to build against
28 # - automatically select running kernel if there are sources in /lib/modules
29 # - note that this can be overridden on the command line
31 %if !%{kernvers_on_cmdline}
32 %define kernvers %(%{_sourcedir}/openafs-kernel-version.sh)
35 # If we're building for a 2.4 series kernel, then fedora style kmods aren't
36 # appropriate - disable them.
38 %define kern24 %([ `echo "%{kernvers}" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'` = "2.4" ] && echo 1 || echo 0)
46 %define kmodtool bash %{_sourcedir}/openafs-kmodtool
48 %define kmod_name openafs
49 %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
52 %{!?kvariants: %define kvariants %{?upvar}}
54 %if %{?ksrcdir:1}%{!?ksrcdir:0}
55 if ( -d %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}) ; then
56 %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}}
58 %define ksrcdir %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}}
62 %else # Legacy kernel build stuff
64 %define kversis %{_sourcedir}/openafs-kvers-is.sh
65 %define kvers %(%{kversis} parsev %{kernvers})
66 %define kvers_is_24 %(%{kversis} %{kvers} "2.4")
67 %define kvers_is_26 %(%{kversis} %{kvers} "2.6")
68 %define ktype %(%{kversis} parset %{kernvers})
69 %define kversion %(%{kversis} kvers %{kernvers})
71 # This is where to look for kernel build include files. Default
72 # is /lib/modules/<kvers>/build, but you can define kbase and
73 # kend on the commandline to change that.
75 %if %{?kbase:0}%{!?kbase:1}
76 %define kbase /lib/modules/
78 %if %{?kend:0}%{!?kend:1}
81 # Let the buildscript define the ksrcdir directly -- needed for RHEL4
82 %if %{?ksrcdir:0}%{!?ksrcdir:1}
83 %define ksrcdir %{kbase}%{kernvers}%{kend}
86 %if %{?kmoddir:0}%{!?kmoddir:1}
87 %define kmoddir /lib/modules
89 %define kxmoddir %{kmoddir}/%{kernvers}
91 # End legacy kernel build stuff
94 %define dkms_version %{pkgvers}-%{pkgrel}%{?dist}
96 # Set 'debugspec' to 1 if you want to debug the spec file. This will
97 # not remove the installed tree as part of the %clean operation
98 %if %{?debugspec:0}%{!?debugspec:1}
102 # Set 'krb5support' to 1 if you want to build the openafs-krb5 package
103 # to distribute aklog and asetkey
104 %define krb5support %{?_without_krb5:0}%{!?_without_krb5:1}
106 # Set 'bootkernelsupport' to 1 if you want to build the
107 # kernel module for Red Hat BOOT Kernels on x86.
108 %define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0}
110 # Define the location of your init.d directory
111 %define initdir /etc/rc.d/init.d
113 #determine if the kernel provides an arch-specific Provides
114 %define kprovidesarch %(%{kversis} provideskernelarch %{ksrcdir} %{_target_cpu})
116 # Define the location of the PAM security module directory
117 %define pamdir /%{_lib}/security
119 #######################################################################
120 # You probably don't need to change anything beyond this line
121 # NOTE: If you do, please email me!!!
123 # Determine which elements of OpenAFS to build. For non-x86 arches
124 # (subject to the ExclusiveArch setting, below), we build both userspace
125 # and modules. For most x86 arches, we build just the kernel modules. For
126 # i386, we build just the userspace. If you're running an i386 kernel,
127 # you'll need to tweak that last bit.
128 %if !%{build_userspace_on_cmdline} && !%{build_modules_on_cmdline}
130 %define build_userspace 1
131 %define build_modules 1
132 %ifarch %{ix86} x86_64 ia64
133 %define build_authlibs 1
135 %define build_authlibs 0
139 %if !%{build_userspace_on_cmdline}
140 %define build_userspace 0
142 %if !%{build_modules_on_cmdline}
143 %define build_modules 0
147 %if !%{build_authlibs_on_cmdline}
148 %if %{build_userspace_on_cmdline}
149 %define build_authlibs 1
151 %define build_authlibs 0
158 # Define the set of kernel module variations to be built:
159 # For 2.4 kernels we just build everything at once for a particular
160 # kernel. So we build up, smp, and bigmem all at once.
161 # For 2.6 kernels we have to build against the specific kernel headers
162 # for a particular kernel variation. AFS will handle the specific smp or
163 # non-smp determination. So just always build as if it's "up" -- the kernel
164 # version will have the 'variation' type already in the version #.
167 %define smp_package 0
168 %define bigmem_package 0
169 %define hugemem_package 0
170 %define largesmp_package 0
172 #######################################################################
175 %define kdepend kernel-source
177 %define smp_package 1
180 %define bigmem_package %(%{kversis} find %{ksrcdir} %{_target_cpu} bigmem)
181 %if %{bigmem_package}
182 %define bigmem_ext bigmem
185 %define hugemem_package %(%{kversis} find %{ksrcdir} %{_target_cpu} hugemem)
186 %if %{hugemem_package}
187 %define hugemem_ext hugemem
190 %define kvariations up smp %{?bigmem_ext:%{bigmem_ext}} %{?hugemem_ext:%{hugemem_ext}}
192 #######################################################################
196 %define kvariations up
201 %define up_package %(%{kversis} "%{ktype}" "")
202 %define smp_package %(%{kversis} "%{ktype}" "smp")
203 %define hugemem_package %(%{kversis} "%{ktype}" "hugemem")
204 %define largesmp_package %(%{kversis} "%{ktype}" "largesmp")
207 %if !%{up_package} && !%{smp_package} && !%{hugemem_package} && !%{largesmp_package}
208 %error "unknown kernel type: %{ktype}"
211 %if !%{kernvers_on_cmdline}
212 %define kdepend %{ksrcdir}/include/linux/version.h
215 #######################################################################
218 %error "unknown kernel version: ${kvers} (parsed from %{kernvers})"
222 # End of legacy kernel module build
226 # Make sure RPM doesn't complain about installed but non-packaged files.
227 #define __check_files %{nil}
229 Summary: OpenAFS distributed filesystem
232 Release: %{pkgrel}%{?dist}
233 License: IBM Public License
234 URL: http://www.openafs.org
235 BuildRoot: %{_tmppath}/%{name}-%{version}-root
236 Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
237 Group: Networking/Filesystems
238 BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
239 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
240 BuildRequires: systemd-units
242 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
243 BuildRequires: perl-devel
245 BuildRequires: perl(ExtUtils::Embed)
247 BuildRequires: krb5-devel
250 BuildRequires: kernel-devel
253 ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
255 # http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
256 Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
257 Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
258 %define srcdir openafs-%{afsvers}
260 Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
261 Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
263 Source20: http://dl.central.org/dl/cellservdb/CellServDB.2013-01-28
265 Source30: openafs-kernel-version.sh
266 Source996: openafs-kvers-is.sh
267 Source997: openafs-buildfedora.pl
268 Source998: openafs-buildall.sh
269 Source999: openafs-kmodtool
272 The AFS distributed filesystem. AFS is a distributed filesystem
273 allowing cross-platform sharing of files among multiple computers.
274 Facilities are provided for access control, authentication, backup and
275 administrative management.
277 This package provides common files shared across all the various
278 OpenAFS packages but are not necessarily tied to a client or server.
280 The OpenAFS SRPM can be rebuilt with the following options to control
283 --define "kernvers 2.4.20-1.1376_FC3" Specify the specific kernel version
284 to build modules against. The default is
285 to build against the currently-running
287 --define "kbase /lib/modules/" The base location to look for kernel headers
288 --define "kend /build" The 'end' location to look for kernels
289 The build will define ksrvdir as
290 %%{kbase}<kernvers>%%{kend}
292 --without krb5 Disable krb5 support (default: with krb5)
293 --with bitmap-later Enable "bitmap later" support
294 --with bos-restricted Enable "bos restricted" mode
295 --with supergroups Enable "supergroups"
297 --target=i386 The target architecture to build for.
298 When building for a non-default target
299 the build may choose whether to build
300 userspace or kernel modules automatically.
301 The defaults are probably what you want.
303 --define "build_userspace 1" Request building of userspace tools
304 --define "build_modules 1" Request building of kernel modules
305 You probably never need to specify these.
307 --define "kmoddir /lib/modules" This is the base location where modules
308 will be installed. You probably don't
309 need to change this ever.
311 --define "fedorakmod 0" Disable the building of 'Fedora' style kernel
312 modules, and use the old format.
314 --define "kvariants <variants>" When building Fedora style kernel modules,
315 this defines the set of kernel variants
317 <variants> is a space seperated list which
318 may contain one or more of
319 '' (for the generic kernel), smp, PAE, xen
322 To a kernel module for your running kernel, just run:
323 rpmbuild --rebuild --target=`uname -m` openafs-%{pkgvers}-%{pkgrel}%{?dist}.src.rpm
325 ##############################################################################
327 # build the userspace side of things if so requested
329 ##############################################################################
330 %if %{build_userspace}
333 Requires: binutils, openafs = %{version}
334 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
335 Requires: systemd-units
336 Requires(post): systemd-units, systemd-sysv
337 Requires(preun): systemd-units
338 Requires(postun): systemd-units
342 Requires: %{name}-kmod >= %{version}
343 Provides: %{name}-kmod-common = %{version}
345 Requires: openafs-kernel
348 Summary: OpenAFS Filesystem Client
349 Group: Networking/Filesystem
352 The AFS distributed filesystem. AFS is a distributed filesystem
353 allowing cross-platform sharing of files among multiple computers.
354 Facilities are provided for access control, authentication, backup and
355 administrative management.
357 This package provides basic client support to mount and manipulate
361 Requires: openafs = %{version}
362 Summary: OpenAFS Filesystem Server
363 Group: Networking/Filesystems
364 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
365 Requires: systemd-units
366 Requires(post): systemd-units, systemd-sysv
367 Requires(preun): systemd-units
368 Requires(postun): systemd-units
372 The AFS distributed filesystem. AFS is a distributed filesystem
373 allowing cross-platform sharing of files among multiple computers.
374 Facilities are provided for access control, authentication, backup and
375 administrative management.
377 This package provides basic server support to host files in an AFS
381 %package -n dkms-%{name}
382 Summary: DKMS-ready kernel source for AFS distributed filesystem
383 Group: Development/Kernel
384 Provides: openafs-kernel = %{version}
386 Provides: %{name}-kmod = %{version}
391 Requires: %{name}-kmod-common = %{version}
393 %description -n dkms-%{name}
394 The AFS distributed filesystem. AFS is a distributed filesystem
395 allowing cross-platform sharing of files among multiple computers.
396 Facilities are provided for access control, authentication, backup and
397 administrative management.
399 This package provides the source code to allow DKMS to build an
403 %if %{build_authlibs}
405 Summary: OpenAFS authentication shared libraries
406 Group: Networking/Filesystems
408 %description authlibs
409 The AFS distributed filesystem. AFS is a distributed filesystem
410 allowing cross-platform sharing of files among multiple computers.
411 Facilities are provided for access control, authentication, backup and
412 administrative management.
414 This package provides a shared version of libafsrpc and libafsauthent.
415 None of the programs included with OpenAFS currently use these shared
416 libraries; however, third-party software that wishes to perform AFS
417 authentication may link against them.
420 %package authlibs-devel
421 %if %{build_authlibs}
422 Requires: openafs-authlibs = %{version}-%{release}
424 Requires: openafs-devel = %{version}-%{release}
425 Summary: OpenAFS shared library development
426 Group: Development/Filesystems
428 %description authlibs-devel
429 The AFS distributed filesystem. AFS is a distributed filesystem
430 allowing cross-platform sharing of files among multiple computers.
431 Facilities are provided for access control, authentication, backup and
432 administrative management.
434 This package includes the static versions of libafsrpc and
435 libafsauthent, and symlinks required for building against the dynamic
439 Summary: OpenAFS Development Libraries and Headers
440 Group: Development/Filesystems
441 Requires: openafs = %{version}-%{release}
444 The AFS distributed filesystem. AFS is a distributed filesystem
445 allowing cross-platform sharing of files among multiple computers.
446 Facilities are provided for access control, authentication, backup and
447 administrative management.
449 This package provides static development libraries and headers needed
450 to compile AFS applications. Note: AFS currently does not provide
454 Summary: OpenAFS user and administrator documentation
455 Requires: openafs = %{version}-%{release}
456 Group: Networking/Filesystems
459 The AFS distributed filesystem. AFS is a distributed filesystem
460 allowing cross-platform sharing of files among multiple computers.
461 Facilities are provided for access control, authentication, backup and
462 administrative management.
464 This package provides HTML documentation for OpenAFS users and system
467 %package kernel-source
468 Summary: OpenAFS Kernel Module source tree
469 Group: Networking/Filesystems
470 Provides: openafs-kernel = %{version}
472 Provides: %{name}-kmod = %{version}
475 %description kernel-source
476 The AFS distributed filesystem. AFS is a distributed filesystem
477 allowing cross-platform sharing of files among multiple computers.
478 Facilities are provided for access control, authentication, backup and
479 administrative management.
481 This package provides the source code to build your own AFS kernel
485 Summary: OpenAFS client compatibility symlinks
486 Requires: openafs = %{version}, openafs-client = %{version}
487 Group: Networking/Filesystems
488 Obsoletes: openafs-client-compat
491 The AFS distributed filesystem. AFS is a distributed filesystem
492 allowing cross-platform sharing of files among multiple computers.
493 Facilities are provided for access control, authentication, backup and
494 administrative management.
496 This package provides compatibility symlinks in /usr/afsws. It is
497 completely optional, and is only necessary to support legacy
498 applications and scripts that hard-code the location of AFS client
502 Summary: OpenAFS KA kpasswd support
504 Group: Networking/Filesystems
507 The AFS distributed filesystem. AFS is a distributed filesystem
508 allowing cross-platform sharing of files among multiple computers.
509 Facilities are provided for access control, authentication, backup and
510 administrative management.
512 This package provides the compatibility symlink for kpasswd, in case
513 you are using KAserver instead of Krb5.
517 Summary: OpenAFS programs to use with krb5
518 Requires: openafs = %{version}
519 Group: Networking/Filesystems
520 BuildRequires: krb5-devel
523 The AFS distributed filesystem. AFS is a distributed filesystem
524 allowing cross-platform sharing of files among multiple computers.
525 Facilities are provided for access control, authentication, backup and
526 administrative management.
528 This package provides compatibility programs so you can use krb5
529 to authenticate to AFS services, instead of using AFS's homegrown
530 krb4 lookalike services.
535 ##############################################################################
537 # build the kernel modules if so requested
539 ##############################################################################
543 %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)}
547 # Legacy kernel compilation code here ...
548 %define modkversion %(echo %{kernvers} | cut -d- -f1)
549 %define modkrelease %(echo %{kernvers} | cut -d- -f2)
550 %define modpkgrel %{modkversion}_%{modkrelease}_%{pkgrel}
554 Summary: OpenAFS Kernel Module (compiled for UP)
555 Release: %{modpkgrel}
556 Group: Networking/Filesystems
557 Provides: openafs-kernel = %{version}
559 Requires: kernel-%{_target_cpu} = %{kversion}
561 Requires: /boot/config-%{kernvers}
565 The AFS distributed filesystem. AFS is a distributed filesystem
566 allowing cross-platform sharing of files among multiple computers.
567 Facilities are provided for access control, authentication, backup and
568 administrative management.
570 This package provides a precompiled AFS kernel module for %{kernvers}.
575 Summary: OpenAFS Kernel Module (compiled for SMP)
576 Release: %{modpkgrel}
577 Provides: openafs-kernel = %{version}
579 Requires: kernel-smp-%{_target_cpu} = %{kversion}
581 Requires: /boot/config-%{kernvers}%{?smp_ext:%{smp_ext}}
583 Group: Networking/Filesystems
585 %description kernel-smp
586 The AFS distributed filesystem. AFS is a distributed filesystem
587 allowing cross-platform sharing of files among multiple computers.
588 Facilities are provided for access control, authentication, backup and
589 administrative management.
591 This package provides a precompiled AFS kernel module for %{kernvers}.
594 %if %{largesmp_package}
595 %package kernel-largesmp
596 Summary: OpenAFS Kernel Module (compiled for LARGESMP)
597 Release: %{modpkgrel}
598 Provides: openafs-kernel = %{version}
600 Requires: kernel-largesmp-%{_target_cpu} = %{kversion}
602 Requires: /boot/config-%{kernvers}%{?largesmp_ext:%{largesmp_ext}}
604 Group: Networking/Filesystems
606 %description kernel-largesmp
607 The AFS distributed filesystem. AFS is a distributed filesystem
608 allowing cross-platform sharing of files among multiple computers.
609 Facilities are provided for access control, authentication, backup and
610 administrative management.
612 This package provides a precompiled AFS kernel module for %{kernvers}.
615 %if %{bigmem_package}
616 %package kernel-bigmem
617 Summary: OpenAFS Kernel Module (compiled for SMP & big memory support)
618 Release: %{modpkgrel}
619 Provides: openafs-kernel = %{version}
621 Requires: kernel-bigmem-%{_target_cpu} = %{kversion}
623 Requires: /boot/config-%{kernvers}%{?bigmem_ext:%{bigmem_ext}}
625 Group: Networking/Filesystems
627 %description kernel-bigmem
628 The AFS distributed filesystem. AFS is a distributed filesystem
629 allowing cross-platform sharing of files among multiple computers.
630 Facilities are provided for access control, authentication, backup and
631 administrative management.
633 This package provides a precompiled AFS kernel module for %{kernvers}.
636 %if %{hugemem_package}
637 %package kernel-hugemem
638 Summary: OpenAFS Kernel Module (compiled for SMP & huge memory support)
639 Release: %{modpkgrel}
640 Provides: openafs-kernel = %{version}
642 Requires: kernel-hugemem-%{_target_cpu} = %{kversion}
644 Requires: /boot/config-%{kernvers}%{?hugemem_ext:%{hugemem_ext}}
646 Group: Networking/Filesystems
648 %description kernel-hugemem
649 The AFS distributed filesystem. AFS is a distributed filesystem
650 allowing cross-platform sharing of files among multiple computers.
651 Facilities are provided for access control, authentication, backup and
652 administrative management.
654 This package provides a precompiled AFS kernel module for %{kernvers}.
658 # End legacy kernel compilation code ...
661 ##############################################################################
665 ##############################################################################
669 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
671 : @@@ kernel version: %{kernvers}
673 : @@@ kernel variations: %{kvariants}
675 : @@@ base kernel version:%{kversion}
676 : @@@ kernel modules dir: %{kxmoddir}
677 : @@@ kernel source dir: %{ksrcdir}
679 : @@@ kernel variations: %{kvariations}
682 : @@@ kernel type: up
684 : @@@ kernel type: %{ktype}
688 : @@@ PAM modules dir: %{pamdir}
689 : @@@ build userspace: %{build_userspace}
690 : @@@ build modules: %{build_modules}
692 : @@@ target cpu: %{_target_cpu}
694 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
696 # Install OpenAFS src and doc
697 #%setup -q -n %{srcdir}
698 %setup -q -b 1 -n %{srcdir}
700 ##############################################################################
704 ##############################################################################
715 echo "I don't know how to build linux-`expr %{kernvers} : '\(^[0-9]*[.][0-9]*\)'`"
724 x86_64) sysname=amd64_linux${kv} ;;
725 alpha*) sysname=alpha_linux_${kv} ;;
726 i386|i486|i586|i686|athlon) sysname=i386_linux${kv} ;;
727 *) sysname=%{_arch}_linux${kv} ;;
731 archlist="i386 i586 i686 athlon"
732 %if %{bootkernelsupport}
733 archlist="${archlist} BOOT"
740 # PrintDefine var value statements file
745 echo "#ifndef $1" >> $4
750 echo "#undef $1" >> $4
755 echo "#define $1 $2" >> $4
765 echo "#include $1" >> $4
775 # PrintRedhatKernelFix arch mp file
776 PrintRedhatKernelFix() {
790 largesmp) largesmp=1;;
794 echo "$2 not supported"
803 PrintDefine "REDHAT_FIX_H" "" ifn,def,nl $file
805 PrintDefine __BOOT_KERNEL_ENTERPRISE $ent und,def,nl $file
806 PrintDefine __BOOT_KERNEL_BIGMEM $bigmem und,def,nl $file
807 PrintDefine __BOOT_KERNEL_HUGEMEM $hugemem und,def,nl $file
808 PrintDefine __BOOT_KERNEL_SMP $smp und,def,nl $file
809 PrintDefine __BOOT_KERNEL_LARGESMP $largesmp und,def,nl $file
810 PrintDefine __BOOT_KERNEL_UP $up und,def,nl $file
811 PrintDefine __BOOT_KERNEL_BOOT $boot und,def,nl $file
812 PrintDefine __BOOT_KERNEL_BOOTSMP $bootsmp und,def,nl $file
814 PrintDefine '"/boot/kernel.h"' "" inc,nl $file # include file
816 for ar in $archlist ; do
817 if [ "$ar" = "$arch" ]; then
818 PrintDefine "__MODULE_KERNEL_$ar" "1" ifn,def,end $file
820 PrintDefine "__MODULE_KERNEL_$ar" "" und $file # undef
825 PrintDefine "" "" end $file
827 if [ %{debugspec} = 1 ] ; then
828 echo "Kernel Configuration File for Red Hat kernels:"
833 config_opts="--enable-redhat-buildsys \
834 %{?_with_bitmap_later:--enable-bitmap-later} \
835 %{?_with_bos_restricted:--enable-bos-restricted-mode} \
836 %{?_with_supergroups:--enable-supergroups} \
837 --enable-transarc-paths"
841 # If we're using Fedora kmods, work out which is the best kernel module to
842 # use for the userland configuration step. If no variants have been specified,
843 # then use the standard kernel. If variants are specified, use the standard kernel
844 # if it's listed, otherwise pick the first listed kernel.
847 for kvariant in %{kvariants} ; do
848 if [ -z "${kvariant}" -o -z "$ksrc" ] ; then
849 if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
850 ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
851 elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
852 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
854 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
859 if [ -z "$ksrc" ] ; then
863 CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
866 %if %{?krb5config:1}%{!?krb5config:0}
867 KRB5_CONFIG="%{krb5config}"
872 ./configure --with-afs-sysname=${sysname} \
873 --prefix=%{_prefix} \
874 --libdir=%{_libdir} \
875 --bindir=%{_bindir} \
876 --sbindir=%{_sbindir} \
877 --disable-strip-binaries \
879 --with-linux-kernel-packaging \
881 --with-linux-kernel-headers=${ksrc} \
889 # Build the libafs tree
890 make only_libafs_tree || exit 1
892 # Configure each of our kernel modules
894 %if %{fedorakmod} && %{build_modules}
895 for kvariant in %{kvariants} ; do
896 if [ -n "${kvariant}" ] ; then
898 if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
899 ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
901 elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
902 # Fedora 20 started putting kernel sources in e.g.
903 # 3.12.5-302.fc20.i686+PAE, instead of:
904 # 3.12.5-302.fc20.i686.PAE
905 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
908 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
911 cp -R libafs_tree _kmod_build_${kvariant}
912 pushd _kmod_build_${kvariant}
913 ./configure --with-afs-sysname=${sysname} \
914 --prefix=%{_prefix} \
915 --libdir=%{_libdir} \
916 --bindir=%{_bindir} \
917 --sbindir=%{_sbindir} \
918 --with-linux-kernel-packaging \
919 --with-linux-kernel-headers=${ksrc} \
920 --enable-disconnected \
922 --with-krb5-conf=/usr/kerberos/bin/krb5-config \
931 %if %{build_userspace}
932 # Build the user-space AFS stuff
933 make dest_nolibafs || exit 1
938 for kvariant in %{kvariants}
940 if [ -n "${kvariant}" ] ; then
941 pushd _kmod_build_$kvariant;
945 make dest_only_libafs
950 # Begin legacy kernel module building code
953 # Build all the kernel modules for linux 2.4.x
954 for variation in %{kvariations}
956 if [ ${variation} = up ]
958 local_smp_def=-DREDHAT_FIX
961 local_smp_def="-DAFS_SMP -DREDHAT_FIX"
965 PrintRedhatKernelFix %{_target_cpu} $variation src/config/redhat-fix.h
966 make dest_only_libafs LOCAL_SMP_DEF="${local_smp_def}" \
967 LINUX_MODULE_NAME="${suffix}" MPS=SP
970 rm -f src/config/redhat-fix.h
972 %elseif %{kvers_is_26}
973 # Build the kernel module for this version of linux 2.6.x
974 # Notice how much easier this is than 2.4. On the other hand,
975 # we require much more external support to build multiple modules.
977 # the MPS=SP just means that we don't add a '.mp' to the name.
978 make dest_only_libafs MPS=SP
981 # End legacy kernel module building code
986 ##############################################################################
990 ##############################################################################
993 export DONT_GPRINTIFY=1
995 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
1007 echo "I don't know how to build linux-`expr %{kernvers} : '\(^[0-9]*[.][0-9]*\)'`"
1016 x86_64) sysname=amd64_linux${kv} ;;
1017 alpha*) sysname=alpha_linux_${kv} ;;
1018 i386|i486|i586|i686|athlon) sysname=i386_linux${kv} ;;
1019 *) sysname=%{_arch}_linux${kv} ;;
1022 # Build install tree
1023 %if %{build_userspace}
1024 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
1025 mkdir -p $RPM_BUILD_ROOT%{_libdir}
1026 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
1027 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1028 mkdir -p $RPM_BUILD_ROOT%{initdir}
1030 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
1031 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
1033 mkdir -p $RPM_BUILD_ROOT/etc/openafs
1034 mkdir -p $RPM_BUILD_ROOT%{pamdir}
1035 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
1036 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/logs
1037 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/etc
1038 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/cache
1039 chmod 700 $RPM_BUILD_ROOT%{_prefix}/vice/cache
1040 mkdir -p $RPM_BUILD_ROOT%{_mandir}
1042 # Copy files from dest to the appropriate places in BuildRoot
1043 tar cf - -C ${sysname}/dest bin include | tar xf - -C $RPM_BUILD_ROOT%{_prefix}
1044 tar cf - -C ${sysname}/dest/lib . | tar xf - -C $RPM_BUILD_ROOT%{_libdir}
1045 tar cf - -C ${sysname}/dest/etc . | tar xf - -C $RPM_BUILD_ROOT%{_sbindir}
1046 tar cf - -C ${sysname}/dest/root.server%{_prefix}/afs bin | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/afs
1047 tar cf - -C ${sysname}/dest/root.client%{_prefix}/vice/etc afsd C | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/vice/etc
1049 # Set the executable bit on libraries in libdir, so rpmbuild knows to
1050 # create "Provides" entries in the package metadata for the libraries
1051 chmod +x $RPM_BUILD_ROOT%{_libdir}/*.so*
1053 # Fix the location of restorevol, since it should be available for
1054 # any user in /usr/bin
1055 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/restorevol $RPM_BUILD_ROOT%{_bindir}/restorevol
1057 # Link kpasswd to kapasswd
1058 ln -f $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
1060 # Copy root.client config files
1061 install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
1062 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1063 install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
1064 install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
1066 install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
1067 install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
1068 install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
1072 install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
1075 ln -sf pam_afs.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.so
1076 ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so
1078 # Populate /usr/vice/etc
1079 uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
1080 install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
1081 install -p -m 644 %{SOURCE20} $uve/CellServDB.dist
1082 install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
1085 # install dkms source
1087 install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src
1088 cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}
1090 cat > $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}/dkms.conf <<"EOF"
1092 PACKAGE_VERSION="%{dkms_version}"
1094 # Items below here should not have to change with each driver version
1095 PACKAGE_NAME="%{name}"
1096 MAKE[0]='./configure --with-linux-kernel-headers=${kernel_source_dir} --with-linux-kernel-packaging && make && case "${kernelver_array[0]}${kernelver[0]}" in 2.4.*) mv src/libafs/MODLOAD-*/libafs-* openafs.o ;; *) mv src/libafs/MODLOAD-*/openafs.ko . ;; esac'
1097 CLEAN="make -C src/libafs clean"
1099 BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
1100 DEST_MODULE_LOCATION[0]="/kernel/3rdparty/$PACKAGE_NAME/"
1107 # install kernel-source
1110 # Install the kernel module source tree
1111 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
1112 tar cf - -C libafs_tree . | \
1113 tar xf - -C $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
1115 # Next, copy the LICENSE Files, README
1116 install -m 644 src/LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1117 install -m 644 src/packaging/RedHat/openafs-LICENSE.Sun $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1118 install -m 644 src/packaging/RedHat/openafs-README $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
1121 # Install DOCUMENTATION
1124 # Build the DOC directory
1125 mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1126 tar cf - -C doc LICENSE html pdf | \
1127 tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1128 install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1129 install -m 644 %{SOURCE11} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1134 tar cf - -C doc/man-pages man1 man5 man8 | \
1135 tar xf - -C $RPM_BUILD_ROOT%{_mandir}
1137 # Copy the uninstalled krb5 files (or delete the unused krb5 files)
1139 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/asetkey $RPM_BUILD_ROOT%{_sbindir}/asetkey
1141 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/asetkey.*
1144 # remove unused man pages
1145 for x in afs_ftpd afs_inetd afs_login afs_rcp afs_rlogind afs_rsh \
1146 dkload knfs package runntp symlink symlink_list symlink_make \
1148 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/${x}.1
1151 # rename kpasswd to kapasswd
1152 mv $RPM_BUILD_ROOT%{_mandir}/man1/kpasswd.1 $RPM_BUILD_ROOT%{_mandir}/man1/kapasswd.1
1155 gzip -9 $RPM_BUILD_ROOT%{_mandir}/man*/*
1157 # create list of man pages that go in the 'openafs' package
1158 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man1 \
1159 |egrep '^afs|^fs|^kas|^klog|kapasswd|pagsh|^pts|^restorevol|^rxdebug|scout|^sys|tokens|translate|^xstat|udebug|unlog|^uss|^vos' \
1160 |egrep -v '^afs_compile_et' \
1163 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man5 \
1164 |egrep 'CellServDB|ThisCell|afsmonitor|^butc|^uss' \
1167 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man8 \
1168 |egrep '^backup|^bos|^butc|^fms|^fssync-debug|^fstrace|^kas|^read_tape|^uss' \
1174 grep -v "^#" >openafs-file-list <<EOF-openafs-file-list
1175 %{_bindir}/afsmonitor
1182 %{_bindir}/pagsh.krb
1184 %{_bindir}/restorevol
1188 %{_bindir}/tokens.krb
1189 %{_bindir}/translate_et
1190 %{_bindir}/xstat_cm_test
1191 %{_bindir}/xstat_fs_test
1199 %{_sbindir}/read_tape
1204 EOF-openafs-file-list
1206 # add man pages to the list
1207 cat openafs-man1files \
1208 | ( while read x; do echo "%{_mandir}/man1/$x"; done ) \
1210 cat openafs-man5files \
1211 | ( while read x; do echo "%{_mandir}/man5/$x"; done ) \
1213 cat openafs-man8files \
1214 | ( while read x; do echo "%{_mandir}/man8/$x"; done ) \
1218 # Install compatiblity links
1220 for d in bin:bin etc:sbin; do
1221 olddir=`echo $d | sed 's/:.*$//'`
1222 newdir=`echo $d | sed 's/^.*://'`
1223 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir
1224 for f in `cat openafs-file-list`; do
1225 if echo $f | grep -q /$newdir/; then
1227 ln -sf %{_prefix}/$newdir/$fb $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir/$fb
1233 # Remove files we're not installing
1236 # remove duplicated files from /usr/afs/bin
1237 for f in bos fs kas klog klog.krb kpwvalid pts tokens tokens.krb udebug vos ; do
1238 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/$f
1241 # the rest are not needed.
1242 for f in dlog dpass install knfs livesys ; do
1243 rm -f $RPM_BUILD_ROOT%{_bindir}/$f
1246 # not supported on Linux or duplicated
1247 for f in kdb rmtsysd kpwvalid ; do
1248 rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
1250 # sometimes install sucks and puts down a directory. kill it all.
1251 rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
1253 # remove man pages from programs deleted above
1254 for f in 1/dlog 1/copyauth 1/dpass 1/livesys 8/rmtsysd 8/aklog_dynamic_auth 8/kdb 8/kpwvalid 8/xfs_size_check 1/package_test 5/package 8/package ; do
1255 rm -f $RPM_BUILD_ROOT%{_mandir}/man$f.*
1258 # PAM modules are doubly-installed Remove the version we don't need
1259 for f in pam_afs.krb.so.1 pam_afs.so.1 ; do
1260 rm -f $RPM_BUILD_ROOT%{_libdir}/$f
1263 %if !%{build_authlibs}
1264 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
1265 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
1266 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so.*
1267 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so.*
1272 %if %{build_modules}
1274 for kvariant in %{kvariants}
1276 if [ -n "$kvariant" ] ; then
1277 if [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP ] ; then
1278 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
1279 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
1280 elif [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP ] ; then
1281 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP
1282 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}+${kvariant}/extra/openafs
1284 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}.${kvariant}-SP
1285 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}.${kvariant}/extra/openafs
1288 if [ -d ${sysname}/dest/root.client/lib/modules/%{kverrel}/extra/openafs ] ; then
1289 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}/extra/openafs
1290 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}/extra/openafs
1292 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
1293 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
1298 install -m 755 ${srcdir}/openafs.ko ${dstdir}/openafs.ko
1301 # Install the kernel modules
1302 for variation in %{kvariations}
1304 if [ ${variation} = up ]
1307 modname=openafs${kmodend}
1309 kvar=%{kxmoddir}${variation}
1310 modname=openafs${kmodend}
1313 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}${kvariant}/extra/openafs
1314 dstdir=$RPM_BUILD_ROOT${kvar}/fs/openafs
1318 install -m 755 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
1323 ##############################################################################
1327 ##############################################################################
1329 rm -f openafs-file-list
1330 [ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
1331 rm -fr $RPM_BUILD_ROOT
1334 ##############################################################################
1338 ##############################################################################
1339 %if %{build_userspace}
1342 if [ -e %{_prefix}/afsws ]; then
1343 /bin/rm -fr %{_prefix}/afsws
1347 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1348 chkconfig --add openafs-client
1350 if [ $1 -eq 1 ] ; then
1351 # Initial installation
1352 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1355 if [ ! -d /afs ]; then
1357 chown root.root /afs
1359 [ -x /sbin/restorecon ] && /sbin/restorecon /afs
1362 # Create the CellServDB
1363 [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
1365 ( cd /usr/vice/etc ; \
1366 cat CellServDB.local CellServDB.dist > CellServDB ; \
1367 chmod 644 CellServDB )
1370 #on an upgrade, don't enable if we were disabled
1371 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1372 if [ $1 = 1 ] ; then
1373 chkconfig --add openafs-server
1375 %{initdir}/openafs-server condrestart
1377 if [ $1 -eq 1 ] ; then
1378 # Initial installation
1379 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1383 %if %{build_authlibs}
1392 if [ $1 = 0 ] ; then
1393 [ -d /afs ] && rmdir /afs
1398 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1399 if [ $1 = 0 ] ; then
1400 %{initdir}/openafs-client stop
1401 chkconfig --del openafs-client
1404 if [ $1 -eq 0 ] ; then
1405 # Package removal, not upgrade
1406 /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
1407 /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
1412 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1413 if [ $1 = 0 ] ; then
1414 %{initdir}/openafs-server stop
1415 chkconfig --del openafs-server
1418 if [ $1 -eq 0 ] ; then
1419 /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
1420 /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
1424 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1426 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1429 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1432 %if %{build_dkmspkg}
1433 %post -n dkms-%{name}
1434 dkms add -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1435 dkms build -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1436 dkms install -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1438 %preun -n dkms-%{name}
1439 dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
1443 %if %{build_modules}
1447 /sbin/depmod -ae %{kernvers}
1450 /sbin/depmod -ae %{kernvers}
1456 /sbin/depmod -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1459 /sbin/depmod -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1462 %if %{largesmp_package}
1463 %post kernel-largesmp
1464 /sbin/depmod -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1466 %postun kernel-largesmp
1467 /sbin/depmod -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1470 %if %{bigmem_package}
1472 /sbin/depmod -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1474 %postun kernel-bigmem
1475 /sbin/depmod -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1478 %if %{hugemem_package}
1479 %post kernel-hugemem
1480 /sbin/depmod -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1482 %postun kernel-hugemem
1483 /sbin/depmod -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1488 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1489 %triggerun -- openafs-client < 1.6.0-1
1490 # Save the current service runlevel info
1491 # User must manually run systemd-sysv-convert --apply httpd
1492 # to migrate them to systemd targets
1493 /usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
1495 # Run this because the SysV package being removed won't do it
1496 /sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
1498 %triggerun -- openafs-server < 1.6.0-1
1499 # Save the current service runlevel info
1500 # User must manually run systemd-sysv-convert --apply httpd
1501 # to migrate them to systemd targets
1502 /usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
1504 # Run this because the SysV package being removed won't do it
1505 /sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
1508 ##############################################################################
1512 ##############################################################################
1513 %if %{build_userspace}
1515 %files -f openafs-file-list
1516 %defattr(-,root,root)
1517 %config(noreplace) /etc/sysconfig/openafs
1518 %doc %{_docdir}/openafs-%{afsvers}/LICENSE
1519 %{_libdir}/libafshcrypto.so.*
1520 %{_libdir}/librokenafs.so.*
1523 %defattr(-,root,root)
1524 %docdir %{_docdir}/openafs-%{afsvers}
1525 %dir %{_docdir}/openafs-%{afsvers}
1526 %{_docdir}/openafs-%{afsvers}/ChangeLog
1527 %{_docdir}/openafs-%{afsvers}/RELNOTES-%{afsvers}
1528 %{_docdir}/openafs-%{afsvers}/pdf
1531 %defattr(-,root,root)
1532 %dir %{_prefix}/vice
1533 %dir %{_prefix}/vice/cache
1534 %dir %{_prefix}/vice/etc
1535 %dir %{_prefix}/vice/etc/C
1536 %{_prefix}/vice/etc/CellServDB.dist
1537 %config(noreplace) %{_prefix}/vice/etc/ThisCell
1538 %config(noreplace) %{_prefix}/vice/etc/cacheinfo
1542 %{_prefix}/vice/etc/afsd
1543 %{_prefix}/vice/etc/C/afszcm.cat
1544 %{pamdir}/pam_afs.krb.so.1
1545 %{pamdir}/pam_afs.krb.so
1546 %{pamdir}/pam_afs.so.1
1547 %{pamdir}/pam_afs.so
1548 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1549 %{initdir}/openafs-client
1551 %{_unitdir}/openafs-client.service
1552 %{_sysconfdir}/sysconfig/modules/openafs-client.modules
1554 %{_mandir}/man1/cmdebug.*
1555 %{_mandir}/man1/up.*
1556 %{_mandir}/man5/afs.5.gz
1557 %{_mandir}/man5/afs_cache.5.gz
1558 %{_mandir}/man5/afs_volume_header.5.gz
1559 %{_mandir}/man5/afszcm.cat.5.gz
1560 %{_mandir}/man5/cacheinfo.*
1561 %{_mandir}/man8/afsd.*
1562 %{_mandir}/man8/vsys.*
1563 %{_mandir}/man5/CellAlias.*
1566 %defattr(-,root,root)
1568 %dir %{_prefix}/afs/bin
1569 %dir %{_prefix}/afs/etc
1570 %dir %{_prefix}/afs/logs
1571 %{_prefix}/afs/bin/bosserver
1572 %{_prefix}/afs/bin/bos_util
1573 %{_prefix}/afs/bin/buserver
1574 %{_prefix}/afs/bin/dafileserver
1575 %{_prefix}/afs/bin/dafssync-debug
1576 %{_prefix}/afs/bin/dasalvager
1577 %{_prefix}/afs/bin/davolserver
1578 %{_prefix}/afs/bin/fileserver
1579 %{_prefix}/afs/bin/fssync-debug
1580 # Should we support KAServer?
1581 %{_prefix}/afs/bin/kaserver
1582 %{_prefix}/afs/bin/ka-forwarder
1583 %{_prefix}/afs/bin/pt_util
1584 %{_prefix}/afs/bin/ptserver
1585 %{_prefix}/afs/bin/salvager
1586 %{_prefix}/afs/bin/salvageserver
1587 %{_prefix}/afs/bin/salvsync-debug
1588 %{_prefix}/afs/bin/state_analyzer
1589 %{_prefix}/afs/bin/upclient
1590 %{_prefix}/afs/bin/upserver
1591 %{_prefix}/afs/bin/vlserver
1592 %{_prefix}/afs/bin/volinfo
1593 %{_prefix}/afs/bin/volserver
1594 %{_sbindir}/kadb_check
1595 %{_sbindir}/prdb_check
1596 %{_sbindir}/vldb_check
1597 %{_sbindir}/vldb_convert
1599 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1600 %{initdir}/openafs-server
1602 %{_unitdir}/openafs-server.service
1604 %{_mandir}/man5/AuthLog.*
1605 %{_mandir}/man5/BackupLog.*
1606 %{_mandir}/man5/BosConfig.*
1607 %{_mandir}/man5/BosLog.*
1608 %{_mandir}/man5/FORCESALVAGE.*
1609 %{_mandir}/man5/FileLog.*
1610 %{_mandir}/man5/KeyFile.*
1611 %{_mandir}/man5/NetInfo.*
1612 %{_mandir}/man5/NetRestrict.*
1613 %{_mandir}/man5/NoAuth.*
1614 %{_mandir}/man5/SALVAGE.fs.*
1615 %{_mandir}/man5/SalvageLog.*
1616 %{_mandir}/man5/sysid.*
1617 %{_mandir}/man5/UserList.*
1618 %{_mandir}/man5/VLLog.*
1619 %{_mandir}/man5/VolserLog.*
1620 %{_mandir}/man5/bdb.DB0.*
1621 %{_mandir}/man5/fms.log.*
1622 %{_mandir}/man5/kaserver.DB0.*
1623 %{_mandir}/man5/kaserverauxdb.*
1624 %{_mandir}/man5/krb.conf.*
1625 %{_mandir}/man5/krb.excl.*
1626 %{_mandir}/man5/prdb.DB0.*
1627 %{_mandir}/man5/salvage.lock.*
1628 %{_mandir}/man5/tapeconfig.*
1629 %{_mandir}/man5/vldb.DB0.*
1630 %{_mandir}/man8/buserver.*
1631 %{_mandir}/man8/fileserver.*
1632 %{_mandir}/man8/dafileserver.*
1633 %{_mandir}/man8/dasalvager.*
1634 %{_mandir}/man8/davolserver.*
1635 %{_mandir}/man8/kadb_check.*
1636 %{_mandir}/man8/ka-forwarder.*
1637 %{_mandir}/man8/prdb_check.*
1638 %{_mandir}/man8/ptserver.*
1639 %{_mandir}/man8/pt_util.*
1640 %{_mandir}/man8/salvager.*
1641 %{_mandir}/man8/salvageserver.*
1642 %{_mandir}/man8/state_analyzer.*
1643 %{_mandir}/man8/upclient.*
1644 %{_mandir}/man8/upserver.*
1645 %{_mandir}/man8/vldb_check.*
1646 %{_mandir}/man8/vldb_convert.*
1647 %{_mandir}/man8/vlserver.*
1648 %{_mandir}/man8/voldump.*
1649 %{_mandir}/man8/volinfo.*
1650 %{_mandir}/man8/volserver.*
1652 %if %{build_authlibs}
1654 %defattr(-,root,root)
1655 %{_libdir}/libafsauthent.so.*
1656 %{_libdir}/libafsrpc.so.*
1657 %{_libdir}/libkopenafs.so.*
1660 %files authlibs-devel
1661 %defattr(-,root,root)
1662 %{_includedir}/kopenafs.h
1663 %{_libdir}/libafsauthent.a
1664 %{_libdir}/libafscp.a
1665 %{_libdir}/libafsrpc.a
1666 %{_libdir}/libafsauthent_pic.a
1667 %{_libdir}/libafsrpc_pic.a
1668 %{_libdir}/libkopenafs.a
1669 %if %{build_authlibs}
1670 %{_libdir}/libafsauthent.so
1671 %{_libdir}/libafsrpc.so
1672 %{_libdir}/libkopenafs.so
1676 %defattr(-,root,root)
1677 %{_bindir}/afs_compile_et
1680 %{_includedir}/lock.h
1681 %{_includedir}/lwp.h
1682 %{_includedir}/preempt.h
1684 %{_includedir}/timer.h
1685 %{_includedir}/ubik.h
1686 %{_includedir}/ubik_int.h
1688 %{_libdir}/libafshcrypto.a
1689 %{_libdir}/libafshcrypto.so
1692 %{_libdir}/librokenafs.a
1693 %{_libdir}/librokenafs.so
1695 %{_libdir}/librxkad.a
1696 %{_libdir}/librxstat.a
1697 %{_libdir}/libubik.a
1698 %{_libdir}/libubik_pthread.a
1699 %{_mandir}/man1/rxgen.*
1700 %{_mandir}/man1/afs_compile_et.*
1702 %if %{build_dkmspkg}
1703 %files -n dkms-%{name}
1704 %defattr(-,root,root)
1705 %{_prefix}/src/%{name}-%{dkms_version}
1708 %files kernel-source
1709 %defattr(-,root,root)
1710 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1711 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1712 %{_prefix}/src/openafs-kernel-%{afsvers}/README
1713 %{_prefix}/src/openafs-kernel-%{afsvers}/src
1716 %defattr(-,root,root)
1720 %defattr(-,root,root)
1726 %defattr(-,root,root)
1728 %{_bindir}/klog.krb5
1730 %{_mandir}/man1/aklog.*
1731 %{_mandir}/man8/asetkey.*
1736 %if %{build_modules}
1741 %defattr(-,root,root)
1742 %{kxmoddir}/fs/openafs/openafs.*
1747 %defattr(-,root,root)
1748 %{kxmoddir}%{?smp_ext:%{smp_ext}}/fs/openafs/openafs.*
1751 %if %{largesmp_package}
1752 %files kernel-largesmp
1753 %defattr(-,root,root)
1754 %{kxmoddir}%{?largesmp_ext:%{largesmp_ext}}/fs/openafs/openafs.*
1757 %if %{bigmem_package}
1758 %files kernel-bigmem
1759 %defattr(-,root,root)
1760 %{kxmoddir}%{?bigmem_ext:%{bigmem_ext}}/fs/openafs/openafs.*
1763 %if %{hugemem_package}
1764 %files kernel-hugemem
1765 %defattr(-,root,root)
1766 %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/fs/openafs/openafs.*
1772 ##############################################################################
1774 ### openafs.spec change log
1776 ##############################################################################
1778 * Wed Dec 12 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1779 - Make the RPM mockable
1781 * Mon Oct 29 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1782 - Update to match the shipped 1.4.5 RPMS
1783 - Fix the kvariant stuff to only configure the 'standard' case once
1784 - Add openafs-kvers.sh back in
1786 * Wed Oct 10 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
1787 - Use Fedora style kmods, which allows us to install multiple kernel types
1789 * Thu Jun 07 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.4-3
1790 - Use distributed files, rather than those in packager's SOURCE directory
1791 - Remove SuidCells stuff, which was unused
1793 * Fri Dec 01 2006 Derrick Brashear <shadow@dementia.org> 1.4.2-2
1794 - integrate s390x changes
1795 - allow for building libafs*.a and not libafs*.so into packages, for platforms
1796 that won't build the .so files.
1798 * Wed Aug 23 2006 Derrick Brashear <shadow@dementia.org> 1.4.2-1
1800 - use installed aklog manpage.
1801 - moduleparam patch obsoleted.
1803 * Tue Aug 22 2006 Derek Atkins <warlord@MIT.EDU> 1.4.2-0.1.rc1
1804 - update to 1.4.2-rc1
1805 - hand-apply lee damon's changes to support largesmp kernels from RHEL4
1806 (but only add support for 2.6 kernels. No need for the 2.4 kernels).
1807 - don't need the posixlock patch anymore.
1809 * Wed Jul 12 2006 Derek Atkins <warlord@MIT.EDU> 1.4.2-0.beta2
1810 - update to 1.4.2-beta2
1811 - add linux2.4 posixlock API patch
1813 * Mon Jun 26 2006 Derek Atkins <warlord@MIT.EDU>
1814 - moduleparam and krb524 patches no longer required in OA-CVS
1816 * Wed May 17 2006 Derek Atkins <warlord@MIT.EDU>
1817 - change non-target-cpu kernel dep to a file dep
1818 - make sure we use the proper kernel version for the dependency.
1820 * Tue May 16 2006 Derek Atkins <warlord@MIT.EDU>
1821 - allow users to specify local CellServDB and SuidCells entries
1822 don't overwrite user's changes. Provide a .dist an let users
1823 make entries in a ".local"
1824 - build the CellServDB and SuidCells at client startup and at
1826 - add provideskernelarch functionality to openafs-kvers-is.sh
1827 - use that functionality to Require kernel{,-<type>}-targetcpu
1828 to get better package safety due to RPM bugs where the kernel
1829 release isn't used so you can install the kernel module against
1830 any kernel of the same major version.
1832 * Mon May 15 2006 Derek Atkins <warlord@MIT.EDU>
1833 - update the README in openafs-kernel-source
1834 - fix openafs-kvers-is.sh from Alexander Bergolth's patch.
1835 - move kernel module from .../kernel/fs/openafs to .../fs/openafs/
1837 * Fri Apr 21 2006 Derek Atkins <warlord@MIT.EDU>
1838 - build requires autoconf and automake for krb5support
1839 and autoconf for standard package
1840 - dont setup the krb5 migration kit (or patches) if we don't care.
1841 - require ncurses-devel to build
1843 * Wed Apr 19 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-3
1844 - look for krb524 functions in libkrb524 if we can't find them
1845 in the standard locations.
1847 * Tue Apr 18 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-2
1848 - fix the module_param_array macro for Linux 2.6.9.
1850 * Sat Apr 15 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-1
1851 - update to 1.4.1 release.
1852 - distribute asetkey from openafs instead of krb5-migration kit
1853 - don't need to apply the FC5 patches because they are part of the distro.
1854 - install asetkey into the "proper" place
1855 - dont list a manpage twice.
1856 - package asetkey man page. delete it when not needed.
1858 * Thu Apr 6 2006 Derek Atkins <warlord@MIT.EDU>
1859 - turn authlibs back on, because RT #18767 was applied to CVS.
1861 * Wed Mar 29 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1rc10-1
1862 - update to 1.4.1rc10, build on FC5
1863 - fix the man pages (distribute into various packages)
1864 - include patches for FC5, RT #29112 and #29122
1866 * Mon Dec 19 2005 Derek Atkins <warlord@MIT.EDU>
1867 - openafs-server shouldn't depend on the kernel module.
1869 * Thu Nov 17 2005 Derek Atkins <warlord@MIT.EDU>
1870 - patch from Mike Polek <mike at pictage.com> to run depmod for
1871 the target kernel and not the running kernel.
1873 * Tue Nov 8 2005 Derek Atkins <warlord@MIT.EDU>
1874 - build aklog from the openafs sources, not from the krb5 migration kit.
1876 * Fri Nov 4 2005 Derek Atkins <warlord@MIT.EDU>
1877 - set openafs-kernel-source to Provide openafs-kernel
1879 * Thu Oct 20 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0-1
1880 - update afs-krb5 res_search patch: look for res_search and __res_search
1881 - update to 1.4.0 final
1883 * Mon Oct 10 2005 Derek Atkins <warlord@MIT.EDU>
1884 - remove all kdump builds.
1886 * Thu Oct 6 2005 Derek Atkins <warlord@MIT.EDU>
1887 - fix openafs-kernel-version.sh so it will build an RPM for the
1888 currently-running kernel even if it's smp on 2.6.
1890 * Tue Sep 27 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc5-1
1891 - upgrade to 1.4.0rc5
1892 - turn off authlibs packages
1894 * Fri Sep 23 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-2
1895 - add kmodule26 patch: fix the kernel module name on 2.6 kernels so
1896 it's called "openafs" and not "libafs". This fixes the shutdown
1899 * Thu Sep 22 2005 Derek Atkins <warlord@MIT.EDU>
1900 - update kversis script, add 'kvers' operation
1901 - fix bug that 2.6 smp/hugemem kernels don't provide
1902 kernel-foo = %{kernvers} with 'smp', 'hugemem', etc.
1903 - add patch to remove res_search from the afs-krb5 configure
1905 * Thu Sep 15 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-1
1906 - Update to 1.4.0rc4
1907 - Update the afs-krb5 krb524 patch so it actually works on
1908 some older systems like RHEL3 that still need -lkrb524.
1909 - Update the buildall script so choose better architecture support,
1910 e.g. don't build i586 on RHEL.
1911 - Update the rebuild information in the SPEC file.
1912 - Add support for finding .EL kernels in openafs-kvers-is.sh
1913 - Add additional error messages when kernel version/type parsing fails.
1914 - Update the buildall script to use the kernel srcdir directly.
1916 * Wed Sep 14 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-2
1917 - Add "hugemem" to 2.4 configs
1918 - Add checks to support scripts to determine whether to build
1919 the bigmem and/or hugemem kernels for 2.4.
1921 * Mon Sep 12 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-1
1922 - Added some afs-krb5 patches to get the migration kit to build
1923 on modern AFS and modern Kerberos.
1924 - Added authlibs and authlibs-devel packages as per UMich changes.
1926 * Sun Sep 11 2005 Derek Atkins <warlord@MIT.EDU>
1927 - Merged in some of the 2.6 changes from wingc@engin.umich.edu
1929 * Sat Sep 10 2005 Derek Atkins <warlord@MIT.EDU>
1930 - Merged in lots of changes from David Howells and Nalin Dahyabhai
1931 from Red Hat. Initial attempt at a release of 1.4. Still need
1932 to work in a 2.6 build system.