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}
26 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
27 %define depmod /usr/sbin/depmod
29 %define depmod /sbin/depmod
33 # Determine the version of the kernel to build against
34 # - automatically select running kernel if there are sources in /lib/modules
35 # - note that this can be overridden on the command line
37 %if !%{kernvers_on_cmdline}
38 %define kernvers %(%{_sourcedir}/openafs-kernel-version.sh)
41 # If we're building for a 2.4 series kernel, then fedora style kmods aren't
42 # appropriate - disable them.
44 %define kern24 %([ `echo "%{kernvers}" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'` = "2.4" ] && echo 1 || echo 0)
52 %define kmodtool bash %{_sourcedir}/openafs-kmodtool
54 %define kmod_name openafs
55 %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
58 %{!?kvariants: %define kvariants %{?upvar}}
60 %if %{?ksrcdir:1}%{!?ksrcdir:0}
61 if ( -d %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}) ; then
62 %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}}
64 %define ksrcdir %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}}
68 %else # Legacy kernel build stuff
70 %define kversis %{_sourcedir}/openafs-kvers-is.sh
71 %define kvers %(%{kversis} parsev %{kernvers})
72 %define kvers_is_24 %(%{kversis} %{kvers} "2.4")
73 %define kvers_is_26 %(%{kversis} %{kvers} "2.6")
74 %define ktype %(%{kversis} parset %{kernvers})
75 %define kversion %(%{kversis} kvers %{kernvers})
77 # This is where to look for kernel build include files. Default
78 # is /lib/modules/<kvers>/build, but you can define kbase and
79 # kend on the commandline to change that.
81 %if %{?kbase:0}%{!?kbase:1}
82 %define kbase /lib/modules/
84 %if %{?kend:0}%{!?kend:1}
87 # Let the buildscript define the ksrcdir directly -- needed for RHEL4
88 %if %{?ksrcdir:0}%{!?ksrcdir:1}
89 %define ksrcdir %{kbase}%{kernvers}%{kend}
92 %if %{?kmoddir:0}%{!?kmoddir:1}
93 %define kmoddir /lib/modules
95 %define kxmoddir %{kmoddir}/%{kernvers}
97 # End legacy kernel build stuff
100 %define dkms_version %{pkgvers}-%{pkgrel}%{?dist}
102 # Set 'debugspec' to 1 if you want to debug the spec file. This will
103 # not remove the installed tree as part of the %clean operation
104 %if %{?debugspec:0}%{!?debugspec:1}
108 # Set 'krb5support' to 1 if you want to build the openafs-krb5 package
109 # to distribute aklog and asetkey
110 %define krb5support %{?_without_krb5:0}%{!?_without_krb5:1}
112 # Set 'bootkernelsupport' to 1 if you want to build the
113 # kernel module for Red Hat BOOT Kernels on x86.
114 %define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0}
116 # Define the location of your init.d directory
117 %define initdir /etc/rc.d/init.d
119 #determine if the kernel provides an arch-specific Provides
120 %define kprovidesarch %(%{kversis} provideskernelarch %{ksrcdir} %{_target_cpu})
122 # Define the location of the PAM security module directory
123 %define pamdir /%{_lib}/security
125 #######################################################################
126 # You probably don't need to change anything beyond this line
127 # NOTE: If you do, please email me!!!
129 # Determine which elements of OpenAFS to build. For non-x86 arches
130 # (subject to the ExclusiveArch setting, below), we build both userspace
131 # and modules. For most x86 arches, we build just the kernel modules. For
132 # i386, we build just the userspace. If you're running an i386 kernel,
133 # you'll need to tweak that last bit.
134 %if !%{build_userspace_on_cmdline} && !%{build_modules_on_cmdline}
136 %define build_userspace 1
137 %define build_modules 1
138 %ifarch %{ix86} x86_64 ia64
139 %define build_authlibs 1
141 %define build_authlibs 0
145 %if !%{build_userspace_on_cmdline}
146 %define build_userspace 0
148 %if !%{build_modules_on_cmdline}
149 %define build_modules 0
153 %if !%{build_authlibs_on_cmdline}
154 %if %{build_userspace_on_cmdline}
155 %define build_authlibs 1
157 %define build_authlibs 0
164 # Define the set of kernel module variations to be built:
165 # For 2.4 kernels we just build everything at once for a particular
166 # kernel. So we build up, smp, and bigmem all at once.
167 # For 2.6 kernels we have to build against the specific kernel headers
168 # for a particular kernel variation. AFS will handle the specific smp or
169 # non-smp determination. So just always build as if it's "up" -- the kernel
170 # version will have the 'variation' type already in the version #.
173 %define smp_package 0
174 %define bigmem_package 0
175 %define hugemem_package 0
176 %define largesmp_package 0
178 #######################################################################
181 %define kdepend kernel-source
183 %define smp_package 1
186 %define bigmem_package %(%{kversis} find %{ksrcdir} %{_target_cpu} bigmem)
187 %if %{bigmem_package}
188 %define bigmem_ext bigmem
191 %define hugemem_package %(%{kversis} find %{ksrcdir} %{_target_cpu} hugemem)
192 %if %{hugemem_package}
193 %define hugemem_ext hugemem
196 %define kvariations up smp %{?bigmem_ext:%{bigmem_ext}} %{?hugemem_ext:%{hugemem_ext}}
198 #######################################################################
202 %define kvariations up
207 %define up_package %(%{kversis} "%{ktype}" "")
208 %define smp_package %(%{kversis} "%{ktype}" "smp")
209 %define hugemem_package %(%{kversis} "%{ktype}" "hugemem")
210 %define largesmp_package %(%{kversis} "%{ktype}" "largesmp")
213 %if !%{up_package} && !%{smp_package} && !%{hugemem_package} && !%{largesmp_package}
214 %error "unknown kernel type: %{ktype}"
217 %if !%{kernvers_on_cmdline}
218 %define kdepend %{ksrcdir}/include/linux/version.h
221 #######################################################################
224 %error "unknown kernel version: ${kvers} (parsed from %{kernvers})"
228 # End of legacy kernel module build
232 # Make sure RPM doesn't complain about installed but non-packaged files.
233 #define __check_files %{nil}
235 Summary: OpenAFS distributed filesystem
238 Release: %{pkgrel}%{?dist}
239 License: IBM Public License
240 URL: http://www.openafs.org
241 BuildRoot: %{_tmppath}/%{name}-%{version}-root
242 Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
243 Group: Networking/Filesystems
244 BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
245 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
246 BuildRequires: systemd-units
248 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
249 BuildRequires: perl-devel
251 BuildRequires: perl(ExtUtils::Embed)
253 BuildRequires: krb5-devel
256 BuildRequires: kernel-devel
259 ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
261 # http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
262 Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
263 Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
264 %define srcdir openafs-%{afsvers}
266 Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
267 Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
269 Source20: http://dl.central.org/dl/cellservdb/CellServDB.2013-01-28
271 Source30: openafs-kernel-version.sh
272 Source996: openafs-kvers-is.sh
273 Source997: openafs-buildfedora.pl
274 Source998: openafs-buildall.sh
275 Source999: openafs-kmodtool
278 The AFS distributed filesystem. AFS is a distributed filesystem
279 allowing cross-platform sharing of files among multiple computers.
280 Facilities are provided for access control, authentication, backup and
281 administrative management.
283 This package provides common files shared across all the various
284 OpenAFS packages but are not necessarily tied to a client or server.
286 The OpenAFS SRPM can be rebuilt with the following options to control
289 --define "kernvers 2.4.20-1.1376_FC3" Specify the specific kernel version
290 to build modules against. The default is
291 to build against the currently-running
293 --define "kbase /lib/modules/" The base location to look for kernel headers
294 --define "kend /build" The 'end' location to look for kernels
295 The build will define ksrvdir as
296 %%{kbase}<kernvers>%%{kend}
298 --without krb5 Disable krb5 support (default: with krb5)
299 --with bitmap-later Enable "bitmap later" support
300 --with bos-restricted Enable "bos restricted" mode
301 --with supergroups Enable "supergroups"
303 --target=i386 The target architecture to build for.
304 When building for a non-default target
305 the build may choose whether to build
306 userspace or kernel modules automatically.
307 The defaults are probably what you want.
309 --define "build_userspace 1" Request building of userspace tools
310 --define "build_modules 1" Request building of kernel modules
311 You probably never need to specify these.
313 --define "kmoddir /lib/modules" This is the base location where modules
314 will be installed. You probably don't
315 need to change this ever.
317 --define "fedorakmod 0" Disable the building of 'Fedora' style kernel
318 modules, and use the old format.
320 --define "kvariants <variants>" When building Fedora style kernel modules,
321 this defines the set of kernel variants
323 <variants> is a space seperated list which
324 may contain one or more of
325 '' (for the generic kernel), smp, PAE, xen
328 To a kernel module for your running kernel, just run:
329 rpmbuild --rebuild --target=`uname -m` openafs-%{pkgvers}-%{pkgrel}%{?dist}.src.rpm
331 ##############################################################################
333 # build the userspace side of things if so requested
335 ##############################################################################
336 %if %{build_userspace}
339 Requires: binutils, openafs = %{version}
340 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
341 Requires: systemd-units
342 Requires(post): systemd-units, systemd-sysv
343 Requires(preun): systemd-units
344 Requires(postun): systemd-units
348 Requires: %{name}-kmod >= %{version}
349 Provides: %{name}-kmod-common = %{version}
351 Requires: openafs-kernel
354 Summary: OpenAFS Filesystem Client
355 Group: Networking/Filesystem
358 The AFS distributed filesystem. AFS is a distributed filesystem
359 allowing cross-platform sharing of files among multiple computers.
360 Facilities are provided for access control, authentication, backup and
361 administrative management.
363 This package provides basic client support to mount and manipulate
367 Requires: openafs = %{version}
368 Summary: OpenAFS Filesystem Server
369 Group: Networking/Filesystems
370 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
371 Requires: systemd-units
372 Requires(post): systemd-units, systemd-sysv
373 Requires(preun): systemd-units
374 Requires(postun): systemd-units
378 The AFS distributed filesystem. AFS is a distributed filesystem
379 allowing cross-platform sharing of files among multiple computers.
380 Facilities are provided for access control, authentication, backup and
381 administrative management.
383 This package provides basic server support to host files in an AFS
387 %package -n dkms-%{name}
388 Summary: DKMS-ready kernel source for AFS distributed filesystem
389 Group: Development/Kernel
390 Provides: openafs-kernel = %{version}
392 Provides: %{name}-kmod = %{version}
397 Requires: %{name}-kmod-common = %{version}
399 %description -n dkms-%{name}
400 The AFS distributed filesystem. AFS is a distributed filesystem
401 allowing cross-platform sharing of files among multiple computers.
402 Facilities are provided for access control, authentication, backup and
403 administrative management.
405 This package provides the source code to allow DKMS to build an
409 %if %{build_authlibs}
411 Summary: OpenAFS authentication shared libraries
412 Group: Networking/Filesystems
414 %description authlibs
415 The AFS distributed filesystem. AFS is a distributed filesystem
416 allowing cross-platform sharing of files among multiple computers.
417 Facilities are provided for access control, authentication, backup and
418 administrative management.
420 This package provides a shared version of libafsrpc and libafsauthent.
421 None of the programs included with OpenAFS currently use these shared
422 libraries; however, third-party software that wishes to perform AFS
423 authentication may link against them.
426 %package authlibs-devel
427 %if %{build_authlibs}
428 Requires: openafs-authlibs = %{version}-%{release}
430 Requires: openafs-devel = %{version}-%{release}
431 Summary: OpenAFS shared library development
432 Group: Development/Filesystems
434 %description authlibs-devel
435 The AFS distributed filesystem. AFS is a distributed filesystem
436 allowing cross-platform sharing of files among multiple computers.
437 Facilities are provided for access control, authentication, backup and
438 administrative management.
440 This package includes the static versions of libafsrpc and
441 libafsauthent, and symlinks required for building against the dynamic
445 Summary: OpenAFS Development Libraries and Headers
446 Group: Development/Filesystems
447 Requires: openafs = %{version}-%{release}
450 The AFS distributed filesystem. AFS is a distributed filesystem
451 allowing cross-platform sharing of files among multiple computers.
452 Facilities are provided for access control, authentication, backup and
453 administrative management.
455 This package provides static development libraries and headers needed
456 to compile AFS applications. Note: AFS currently does not provide
460 Summary: OpenAFS user and administrator documentation
461 Requires: openafs = %{version}-%{release}
462 Group: Networking/Filesystems
465 The AFS distributed filesystem. AFS is a distributed filesystem
466 allowing cross-platform sharing of files among multiple computers.
467 Facilities are provided for access control, authentication, backup and
468 administrative management.
470 This package provides HTML documentation for OpenAFS users and system
473 %package kernel-source
474 Summary: OpenAFS Kernel Module source tree
475 Group: Networking/Filesystems
476 Provides: openafs-kernel = %{version}
478 Provides: %{name}-kmod = %{version}
481 %description kernel-source
482 The AFS distributed filesystem. AFS is a distributed filesystem
483 allowing cross-platform sharing of files among multiple computers.
484 Facilities are provided for access control, authentication, backup and
485 administrative management.
487 This package provides the source code to build your own AFS kernel
491 Summary: OpenAFS client compatibility symlinks
492 Requires: openafs = %{version}, openafs-client = %{version}
493 Group: Networking/Filesystems
494 Obsoletes: openafs-client-compat
497 The AFS distributed filesystem. AFS is a distributed filesystem
498 allowing cross-platform sharing of files among multiple computers.
499 Facilities are provided for access control, authentication, backup and
500 administrative management.
502 This package provides compatibility symlinks in /usr/afsws. It is
503 completely optional, and is only necessary to support legacy
504 applications and scripts that hard-code the location of AFS client
508 Summary: OpenAFS KA kpasswd support
510 Group: Networking/Filesystems
513 The AFS distributed filesystem. AFS is a distributed filesystem
514 allowing cross-platform sharing of files among multiple computers.
515 Facilities are provided for access control, authentication, backup and
516 administrative management.
518 This package provides the kpasswd executable, renamed to kapasswd to avoid
519 clashes, for sites still using KAserver instead of Krb5.
523 Summary: OpenAFS programs to use with krb5
524 Requires: openafs = %{version}
525 Group: Networking/Filesystems
526 BuildRequires: krb5-devel
529 The AFS distributed filesystem. AFS is a distributed filesystem
530 allowing cross-platform sharing of files among multiple computers.
531 Facilities are provided for access control, authentication, backup and
532 administrative management.
534 This package provides compatibility programs so you can use krb5
535 to authenticate to AFS services, instead of using AFS's homegrown
536 krb4 lookalike services.
541 ##############################################################################
543 # build the kernel modules if so requested
545 ##############################################################################
549 %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{depmod} %{kvariants} 2>/dev/null)}
553 # Legacy kernel compilation code here ...
554 %define modkversion %(echo %{kernvers} | cut -d- -f1)
555 %define modkrelease %(echo %{kernvers} | cut -d- -f2)
556 %define modpkgrel %{modkversion}_%{modkrelease}_%{pkgrel}
560 Summary: OpenAFS Kernel Module (compiled for UP)
561 Release: %{modpkgrel}
562 Group: Networking/Filesystems
563 Provides: openafs-kernel = %{version}
565 Requires: kernel-%{_target_cpu} = %{kversion}
567 Requires: /boot/config-%{kernvers}
571 The AFS distributed filesystem. AFS is a distributed filesystem
572 allowing cross-platform sharing of files among multiple computers.
573 Facilities are provided for access control, authentication, backup and
574 administrative management.
576 This package provides a precompiled AFS kernel module for %{kernvers}.
581 Summary: OpenAFS Kernel Module (compiled for SMP)
582 Release: %{modpkgrel}
583 Provides: openafs-kernel = %{version}
585 Requires: kernel-smp-%{_target_cpu} = %{kversion}
587 Requires: /boot/config-%{kernvers}%{?smp_ext:%{smp_ext}}
589 Group: Networking/Filesystems
591 %description kernel-smp
592 The AFS distributed filesystem. AFS is a distributed filesystem
593 allowing cross-platform sharing of files among multiple computers.
594 Facilities are provided for access control, authentication, backup and
595 administrative management.
597 This package provides a precompiled AFS kernel module for %{kernvers}.
600 %if %{largesmp_package}
601 %package kernel-largesmp
602 Summary: OpenAFS Kernel Module (compiled for LARGESMP)
603 Release: %{modpkgrel}
604 Provides: openafs-kernel = %{version}
606 Requires: kernel-largesmp-%{_target_cpu} = %{kversion}
608 Requires: /boot/config-%{kernvers}%{?largesmp_ext:%{largesmp_ext}}
610 Group: Networking/Filesystems
612 %description kernel-largesmp
613 The AFS distributed filesystem. AFS is a distributed filesystem
614 allowing cross-platform sharing of files among multiple computers.
615 Facilities are provided for access control, authentication, backup and
616 administrative management.
618 This package provides a precompiled AFS kernel module for %{kernvers}.
621 %if %{bigmem_package}
622 %package kernel-bigmem
623 Summary: OpenAFS Kernel Module (compiled for SMP & big memory support)
624 Release: %{modpkgrel}
625 Provides: openafs-kernel = %{version}
627 Requires: kernel-bigmem-%{_target_cpu} = %{kversion}
629 Requires: /boot/config-%{kernvers}%{?bigmem_ext:%{bigmem_ext}}
631 Group: Networking/Filesystems
633 %description kernel-bigmem
634 The AFS distributed filesystem. AFS is a distributed filesystem
635 allowing cross-platform sharing of files among multiple computers.
636 Facilities are provided for access control, authentication, backup and
637 administrative management.
639 This package provides a precompiled AFS kernel module for %{kernvers}.
642 %if %{hugemem_package}
643 %package kernel-hugemem
644 Summary: OpenAFS Kernel Module (compiled for SMP & huge memory support)
645 Release: %{modpkgrel}
646 Provides: openafs-kernel = %{version}
648 Requires: kernel-hugemem-%{_target_cpu} = %{kversion}
650 Requires: /boot/config-%{kernvers}%{?hugemem_ext:%{hugemem_ext}}
652 Group: Networking/Filesystems
654 %description kernel-hugemem
655 The AFS distributed filesystem. AFS is a distributed filesystem
656 allowing cross-platform sharing of files among multiple computers.
657 Facilities are provided for access control, authentication, backup and
658 administrative management.
660 This package provides a precompiled AFS kernel module for %{kernvers}.
664 # End legacy kernel compilation code ...
667 ##############################################################################
671 ##############################################################################
675 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
677 : @@@ kernel version: %{kernvers}
679 : @@@ kernel variations: %{kvariants}
681 : @@@ base kernel version:%{kversion}
682 : @@@ kernel modules dir: %{kxmoddir}
683 : @@@ kernel source dir: %{ksrcdir}
685 : @@@ kernel variations: %{kvariations}
688 : @@@ kernel type: up
690 : @@@ kernel type: %{ktype}
694 : @@@ PAM modules dir: %{pamdir}
695 : @@@ build userspace: %{build_userspace}
696 : @@@ build modules: %{build_modules}
698 : @@@ target cpu: %{_target_cpu}
700 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
702 # Install OpenAFS src and doc
703 #%setup -q -n %{srcdir}
704 %setup -q -b 1 -n %{srcdir}
706 ##############################################################################
710 ##############################################################################
721 echo "I don't know how to build linux-`expr %{kernvers} : '\(^[0-9]*[.][0-9]*\)'`"
730 x86_64) sysname=amd64_linux${kv} ;;
731 alpha*) sysname=alpha_linux_${kv} ;;
732 i386|i486|i586|i686|athlon) sysname=i386_linux${kv} ;;
733 *) sysname=%{_arch}_linux${kv} ;;
737 archlist="i386 i586 i686 athlon"
738 %if %{bootkernelsupport}
739 archlist="${archlist} BOOT"
746 # PrintDefine var value statements file
751 echo "#ifndef $1" >> $4
756 echo "#undef $1" >> $4
761 echo "#define $1 $2" >> $4
771 echo "#include $1" >> $4
781 # PrintRedhatKernelFix arch mp file
782 PrintRedhatKernelFix() {
796 largesmp) largesmp=1;;
800 echo "$2 not supported"
809 PrintDefine "REDHAT_FIX_H" "" ifn,def,nl $file
811 PrintDefine __BOOT_KERNEL_ENTERPRISE $ent und,def,nl $file
812 PrintDefine __BOOT_KERNEL_BIGMEM $bigmem und,def,nl $file
813 PrintDefine __BOOT_KERNEL_HUGEMEM $hugemem und,def,nl $file
814 PrintDefine __BOOT_KERNEL_SMP $smp und,def,nl $file
815 PrintDefine __BOOT_KERNEL_LARGESMP $largesmp und,def,nl $file
816 PrintDefine __BOOT_KERNEL_UP $up und,def,nl $file
817 PrintDefine __BOOT_KERNEL_BOOT $boot und,def,nl $file
818 PrintDefine __BOOT_KERNEL_BOOTSMP $bootsmp und,def,nl $file
820 PrintDefine '"/boot/kernel.h"' "" inc,nl $file # include file
822 for ar in $archlist ; do
823 if [ "$ar" = "$arch" ]; then
824 PrintDefine "__MODULE_KERNEL_$ar" "1" ifn,def,end $file
826 PrintDefine "__MODULE_KERNEL_$ar" "" und $file # undef
831 PrintDefine "" "" end $file
833 if [ %{debugspec} = 1 ] ; then
834 echo "Kernel Configuration File for Red Hat kernels:"
839 config_opts="--enable-redhat-buildsys \
840 %{?_with_bitmap_later:--enable-bitmap-later} \
841 %{?_with_bos_restricted:--enable-bos-restricted-mode} \
842 %{?_with_supergroups:--enable-supergroups} \
843 --enable-transarc-paths"
847 # If we're using Fedora kmods, work out which is the best kernel module to
848 # use for the userland configuration step. If no variants have been specified,
849 # then use the standard kernel. If variants are specified, use the standard kernel
850 # if it's listed, otherwise pick the first listed kernel.
853 for kvariant in %{kvariants} ; do
854 if [ -z "${kvariant}" -o -z "$ksrc" ] ; then
855 if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
856 ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
857 elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
858 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
860 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
865 if [ -z "$ksrc" ] ; then
869 CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
872 %if %{?krb5config:1}%{!?krb5config:0}
873 KRB5_CONFIG="%{krb5config}"
878 ./configure --with-afs-sysname=${sysname} \
879 --prefix=%{_prefix} \
880 --libdir=%{_libdir} \
881 --bindir=%{_bindir} \
882 --sbindir=%{_sbindir} \
883 --disable-strip-binaries \
885 --with-linux-kernel-packaging \
887 --with-linux-kernel-headers=${ksrc} \
895 # Build the libafs tree
896 make only_libafs_tree || exit 1
898 # Configure each of our kernel modules
900 %if %{fedorakmod} && %{build_modules}
901 for kvariant in %{kvariants} ; do
902 if [ -n "${kvariant}" ] ; then
904 if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
905 ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
907 elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
908 # Fedora 20 started putting kernel sources in e.g.
909 # 3.12.5-302.fc20.i686+PAE, instead of:
910 # 3.12.5-302.fc20.i686.PAE
911 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
914 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
917 cp -R libafs_tree _kmod_build_${kvariant}
918 pushd _kmod_build_${kvariant}
919 ./configure --with-afs-sysname=${sysname} \
920 --prefix=%{_prefix} \
921 --libdir=%{_libdir} \
922 --bindir=%{_bindir} \
923 --sbindir=%{_sbindir} \
924 --with-linux-kernel-packaging \
925 --with-linux-kernel-headers=${ksrc} \
926 --enable-disconnected \
928 --with-krb5-conf=/usr/kerberos/bin/krb5-config \
937 %if %{build_userspace}
938 # Build the user-space AFS stuff
939 make dest_nolibafs || exit 1
944 for kvariant in %{kvariants}
946 if [ -n "${kvariant}" ] ; then
947 pushd _kmod_build_$kvariant;
951 make dest_only_libafs
956 # Begin legacy kernel module building code
959 # Build all the kernel modules for linux 2.4.x
960 for variation in %{kvariations}
962 if [ ${variation} = up ]
964 local_smp_def=-DREDHAT_FIX
967 local_smp_def="-DAFS_SMP -DREDHAT_FIX"
971 PrintRedhatKernelFix %{_target_cpu} $variation src/config/redhat-fix.h
972 make dest_only_libafs LOCAL_SMP_DEF="${local_smp_def}" \
973 LINUX_MODULE_NAME="${suffix}" MPS=SP
976 rm -f src/config/redhat-fix.h
978 %elseif %{kvers_is_26}
979 # Build the kernel module for this version of linux 2.6.x
980 # Notice how much easier this is than 2.4. On the other hand,
981 # we require much more external support to build multiple modules.
983 # the MPS=SP just means that we don't add a '.mp' to the name.
984 make dest_only_libafs MPS=SP
987 # End legacy kernel module building code
992 ##############################################################################
996 ##############################################################################
999 export DONT_GPRINTIFY=1
1001 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
1013 echo "I don't know how to build linux-`expr %{kernvers} : '\(^[0-9]*[.][0-9]*\)'`"
1022 x86_64) sysname=amd64_linux${kv} ;;
1023 alpha*) sysname=alpha_linux_${kv} ;;
1024 i386|i486|i586|i686|athlon) sysname=i386_linux${kv} ;;
1025 *) sysname=%{_arch}_linux${kv} ;;
1028 # Build install tree
1029 %if %{build_userspace}
1030 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
1031 mkdir -p $RPM_BUILD_ROOT%{_libdir}
1032 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
1033 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1034 mkdir -p $RPM_BUILD_ROOT%{initdir}
1036 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
1037 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
1039 mkdir -p $RPM_BUILD_ROOT/etc/openafs
1040 mkdir -p $RPM_BUILD_ROOT%{pamdir}
1041 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
1042 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/logs
1043 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/etc
1044 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/cache
1045 chmod 700 $RPM_BUILD_ROOT%{_prefix}/vice/cache
1046 mkdir -p $RPM_BUILD_ROOT%{_mandir}
1048 # Copy files from dest to the appropriate places in BuildRoot
1049 tar cf - -C ${sysname}/dest bin include | tar xf - -C $RPM_BUILD_ROOT%{_prefix}
1050 tar cf - -C ${sysname}/dest/lib . | tar xf - -C $RPM_BUILD_ROOT%{_libdir}
1051 tar cf - -C ${sysname}/dest/etc . | tar xf - -C $RPM_BUILD_ROOT%{_sbindir}
1052 tar cf - -C ${sysname}/dest/root.server%{_prefix}/afs bin | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/afs
1053 tar cf - -C ${sysname}/dest/root.client%{_prefix}/vice/etc afsd C | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/vice/etc
1055 # Set the executable bit on libraries in libdir, so rpmbuild knows to
1056 # create "Provides" entries in the package metadata for the libraries
1057 chmod +x $RPM_BUILD_ROOT%{_libdir}/*.so*
1059 # Fix the location of restorevol, since it should be available for
1060 # any user in /usr/bin
1061 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/restorevol $RPM_BUILD_ROOT%{_bindir}/restorevol
1063 # Rename kpasswd to kapasswd
1064 mv -f $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
1066 # Copy root.client config files
1067 install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
1068 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1069 install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
1070 install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
1072 install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
1073 install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
1074 install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
1078 install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
1081 ln -sf pam_afs.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.so
1082 ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so
1084 # Populate /usr/vice/etc
1085 uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
1086 install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
1087 install -p -m 644 %{SOURCE20} $uve/CellServDB.dist
1088 install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
1091 # install dkms source
1093 install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src
1094 cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}
1096 cat > $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}/dkms.conf <<"EOF"
1098 PACKAGE_VERSION="%{dkms_version}"
1100 # Items below here should not have to change with each driver version
1101 PACKAGE_NAME="%{name}"
1102 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'
1103 CLEAN="make -C src/libafs clean"
1105 BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
1106 DEST_MODULE_LOCATION[0]="/kernel/3rdparty/$PACKAGE_NAME/"
1113 # install kernel-source
1116 # Install the kernel module source tree
1117 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
1118 tar cf - -C libafs_tree . | \
1119 tar xf - -C $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
1121 # Next, copy the LICENSE Files, README
1122 install -m 644 src/LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1123 install -m 644 src/packaging/RedHat/openafs-LICENSE.Sun $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1124 install -m 644 src/packaging/RedHat/openafs-README $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
1127 # Install DOCUMENTATION
1130 # Build the DOC directory
1131 mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1132 tar cf - -C doc LICENSE html pdf | \
1133 tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1134 install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1135 install -m 644 %{SOURCE11} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1140 tar cf - -C doc/man-pages man1 man5 man8 | \
1141 tar xf - -C $RPM_BUILD_ROOT%{_mandir}
1143 # Copy the uninstalled krb5 files (or delete the unused krb5 files)
1145 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/asetkey $RPM_BUILD_ROOT%{_sbindir}/asetkey
1147 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/asetkey.*
1150 # remove unused man pages
1151 for x in afs_ftpd afs_inetd afs_login afs_rcp afs_rlogind afs_rsh \
1152 dkload knfs package runntp symlink symlink_list symlink_make \
1154 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/${x}.1
1157 # rename kpasswd to kapasswd
1158 mv $RPM_BUILD_ROOT%{_mandir}/man1/kpasswd.1 $RPM_BUILD_ROOT%{_mandir}/man1/kapasswd.1
1161 gzip -9 $RPM_BUILD_ROOT%{_mandir}/man*/*
1163 # create list of man pages that go in the 'openafs' package
1164 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man1 \
1165 |egrep '^afs|^fs|^kas|^klog|pagsh|^pts|^restorevol|^rxdebug|scout|^sys|tokens|translate|^xstat|udebug|unlog|^uss|^vos' \
1166 |egrep -v '^afs_compile_et' \
1169 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man5 \
1170 |egrep 'CellServDB|ThisCell|afsmonitor|^butc|^uss' \
1173 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man8 \
1174 |egrep '^backup|^bos|^butc|^fms|^fssync-debug|^fstrace|^kas|^read_tape|^uss' \
1180 grep -v "^#" >openafs-file-list <<EOF-openafs-file-list
1181 %{_bindir}/afsmonitor
1187 %{_bindir}/pagsh.krb
1189 %{_bindir}/restorevol
1193 %{_bindir}/tokens.krb
1194 %{_bindir}/translate_et
1195 %{_bindir}/xstat_cm_test
1196 %{_bindir}/xstat_fs_test
1204 %{_sbindir}/read_tape
1209 EOF-openafs-file-list
1211 # add man pages to the list
1212 cat openafs-man1files \
1213 | ( while read x; do echo "%{_mandir}/man1/$x"; done ) \
1215 cat openafs-man5files \
1216 | ( while read x; do echo "%{_mandir}/man5/$x"; done ) \
1218 cat openafs-man8files \
1219 | ( while read x; do echo "%{_mandir}/man8/$x"; done ) \
1223 # Install compatiblity links
1225 for d in bin:bin etc:sbin; do
1226 olddir=`echo $d | sed 's/:.*$//'`
1227 newdir=`echo $d | sed 's/^.*://'`
1228 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir
1229 for f in `cat openafs-file-list`; do
1230 if echo $f | grep -q /$newdir/; then
1232 ln -sf %{_prefix}/$newdir/$fb $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir/$fb
1238 # Remove files we're not installing
1241 # remove duplicated files from /usr/afs/bin
1242 for f in bos fs kas klog klog.krb kpwvalid pts tokens tokens.krb udebug vos ; do
1243 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/$f
1246 # the rest are not needed.
1247 for f in dlog dpass install knfs livesys ; do
1248 rm -f $RPM_BUILD_ROOT%{_bindir}/$f
1251 # not supported on Linux or duplicated
1252 for f in kdb rmtsysd kpwvalid ; do
1253 rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
1255 # sometimes install sucks and puts down a directory. kill it all.
1256 rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
1258 # remove man pages from programs deleted above
1259 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
1260 rm -f $RPM_BUILD_ROOT%{_mandir}/man$f.*
1263 # PAM modules are doubly-installed Remove the version we don't need
1264 for f in pam_afs.krb.so.1 pam_afs.so.1 ; do
1265 rm -f $RPM_BUILD_ROOT%{_libdir}/$f
1268 %if !%{build_authlibs}
1269 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
1270 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
1271 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so.*
1272 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so.*
1277 %if %{build_modules}
1279 for kvariant in %{kvariants}
1281 if [ -n "$kvariant" ] ; then
1282 if [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP ] ; then
1283 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
1284 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
1285 elif [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP ] ; then
1286 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP
1287 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}+${kvariant}/extra/openafs
1289 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}.${kvariant}-SP
1290 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}.${kvariant}/extra/openafs
1293 if [ -d ${sysname}/dest/root.client/lib/modules/%{kverrel}/extra/openafs ] ; then
1294 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}/extra/openafs
1295 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}/extra/openafs
1297 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
1298 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
1303 install -m 755 ${srcdir}/openafs.ko ${dstdir}/openafs.ko
1306 # Install the kernel modules
1307 for variation in %{kvariations}
1309 if [ ${variation} = up ]
1312 modname=openafs${kmodend}
1314 kvar=%{kxmoddir}${variation}
1315 modname=openafs${kmodend}
1318 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}${kvariant}/extra/openafs
1319 dstdir=$RPM_BUILD_ROOT${kvar}/fs/openafs
1323 install -m 755 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
1328 ##############################################################################
1332 ##############################################################################
1334 rm -f openafs-file-list
1335 [ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
1336 rm -fr $RPM_BUILD_ROOT
1339 ##############################################################################
1343 ##############################################################################
1344 %if %{build_userspace}
1347 if [ -e %{_prefix}/afsws ]; then
1348 /bin/rm -fr %{_prefix}/afsws
1352 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1353 chkconfig --add openafs-client
1355 if [ $1 -eq 1 ] ; then
1356 # Initial installation
1357 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1360 if [ ! -d /afs ]; then
1362 chown root.root /afs
1364 [ -x /sbin/restorecon ] && /sbin/restorecon /afs
1367 # Create the CellServDB
1368 [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
1370 ( cd /usr/vice/etc ; \
1371 cat CellServDB.local CellServDB.dist > CellServDB ; \
1372 chmod 644 CellServDB )
1375 #on an upgrade, don't enable if we were disabled
1376 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1377 if [ $1 = 1 ] ; then
1378 chkconfig --add openafs-server
1380 %{initdir}/openafs-server condrestart
1382 if [ $1 -eq 1 ] ; then
1383 # Initial installation
1384 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1388 %if %{build_authlibs}
1397 if [ $1 = 0 ] ; then
1398 [ -d /afs ] && rmdir /afs
1403 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1404 if [ $1 = 0 ] ; then
1405 %{initdir}/openafs-client stop
1406 chkconfig --del openafs-client
1409 if [ $1 -eq 0 ] ; then
1410 # Package removal, not upgrade
1411 /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
1412 /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
1417 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1418 if [ $1 = 0 ] ; then
1419 %{initdir}/openafs-server stop
1420 chkconfig --del openafs-server
1423 if [ $1 -eq 0 ] ; then
1424 /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
1425 /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
1429 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1431 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1434 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1437 %if %{build_dkmspkg}
1438 %post -n dkms-%{name}
1439 dkms add -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1440 dkms build -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1441 dkms install -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1443 %preun -n dkms-%{name}
1444 dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
1448 %if %{build_modules}
1452 %{depmod} -ae %{kernvers}
1455 %{depmod} -ae %{kernvers}
1461 %{depmod} -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1464 %{depmod} -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1467 %if %{largesmp_package}
1468 %post kernel-largesmp
1469 %{depmod} -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1471 %postun kernel-largesmp
1472 %{depmod} -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1475 %if %{bigmem_package}
1477 %{depmod} -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1479 %postun kernel-bigmem
1480 %{depmod} -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1483 %if %{hugemem_package}
1484 %post kernel-hugemem
1485 %{depmod} -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1487 %postun kernel-hugemem
1488 %{depmod} -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1493 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1494 %triggerun -- openafs-client < 1.6.0-1
1495 # Save the current service runlevel info
1496 # User must manually run systemd-sysv-convert --apply httpd
1497 # to migrate them to systemd targets
1498 /usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
1500 # Run this because the SysV package being removed won't do it
1501 /sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
1503 %triggerun -- openafs-server < 1.6.0-1
1504 # Save the current service runlevel info
1505 # User must manually run systemd-sysv-convert --apply httpd
1506 # to migrate them to systemd targets
1507 /usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
1509 # Run this because the SysV package being removed won't do it
1510 /sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
1513 ##############################################################################
1517 ##############################################################################
1518 %if %{build_userspace}
1520 %files -f openafs-file-list
1521 %defattr(-,root,root)
1522 %config(noreplace) /etc/sysconfig/openafs
1523 %doc %{_docdir}/openafs-%{afsvers}/LICENSE
1524 %{_libdir}/libafshcrypto.so.*
1525 %{_libdir}/librokenafs.so.*
1528 %defattr(-,root,root)
1529 %docdir %{_docdir}/openafs-%{afsvers}
1530 %dir %{_docdir}/openafs-%{afsvers}
1531 %{_docdir}/openafs-%{afsvers}/ChangeLog
1532 %{_docdir}/openafs-%{afsvers}/RELNOTES-%{afsvers}
1533 %{_docdir}/openafs-%{afsvers}/pdf
1536 %defattr(-,root,root)
1537 %dir %{_prefix}/vice
1538 %dir %{_prefix}/vice/cache
1539 %dir %{_prefix}/vice/etc
1540 %dir %{_prefix}/vice/etc/C
1541 %{_prefix}/vice/etc/CellServDB.dist
1542 %config(noreplace) %{_prefix}/vice/etc/ThisCell
1543 %config(noreplace) %{_prefix}/vice/etc/cacheinfo
1547 %{_prefix}/vice/etc/afsd
1548 %{_prefix}/vice/etc/C/afszcm.cat
1549 %{pamdir}/pam_afs.krb.so.1
1550 %{pamdir}/pam_afs.krb.so
1551 %{pamdir}/pam_afs.so.1
1552 %{pamdir}/pam_afs.so
1553 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1554 %{initdir}/openafs-client
1556 %{_unitdir}/openafs-client.service
1557 %{_sysconfdir}/sysconfig/modules/openafs-client.modules
1559 %{_mandir}/man1/cmdebug.*
1560 %{_mandir}/man1/up.*
1561 %{_mandir}/man5/afs.5.gz
1562 %{_mandir}/man5/afs_cache.5.gz
1563 %{_mandir}/man5/afs_volume_header.5.gz
1564 %{_mandir}/man5/afszcm.cat.5.gz
1565 %{_mandir}/man5/cacheinfo.*
1566 %{_mandir}/man8/afsd.*
1567 %{_mandir}/man8/vsys.*
1568 %{_mandir}/man5/CellAlias.*
1571 %defattr(-,root,root)
1573 %dir %{_prefix}/afs/bin
1574 %dir %{_prefix}/afs/etc
1575 %dir %{_prefix}/afs/logs
1576 %{_prefix}/afs/bin/bosserver
1577 %{_prefix}/afs/bin/bos_util
1578 %{_prefix}/afs/bin/buserver
1579 %{_prefix}/afs/bin/dafileserver
1580 %{_prefix}/afs/bin/dafssync-debug
1581 %{_prefix}/afs/bin/dasalvager
1582 %{_prefix}/afs/bin/davolserver
1583 %{_prefix}/afs/bin/fileserver
1584 %{_prefix}/afs/bin/fssync-debug
1585 # Should we support KAServer?
1586 %{_prefix}/afs/bin/kaserver
1587 %{_prefix}/afs/bin/ka-forwarder
1588 %{_prefix}/afs/bin/pt_util
1589 %{_prefix}/afs/bin/ptserver
1590 %{_prefix}/afs/bin/salvager
1591 %{_prefix}/afs/bin/salvageserver
1592 %{_prefix}/afs/bin/salvsync-debug
1593 %{_prefix}/afs/bin/state_analyzer
1594 %{_prefix}/afs/bin/upclient
1595 %{_prefix}/afs/bin/upserver
1596 %{_prefix}/afs/bin/vlserver
1597 %{_prefix}/afs/bin/volinfo
1598 %{_prefix}/afs/bin/volserver
1599 %{_sbindir}/kadb_check
1600 %{_sbindir}/prdb_check
1601 %{_sbindir}/vldb_check
1602 %{_sbindir}/vldb_convert
1604 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1605 %{initdir}/openafs-server
1607 %{_unitdir}/openafs-server.service
1609 %{_mandir}/man5/AuthLog.*
1610 %{_mandir}/man5/BackupLog.*
1611 %{_mandir}/man5/BosConfig.*
1612 %{_mandir}/man5/BosLog.*
1613 %{_mandir}/man5/FORCESALVAGE.*
1614 %{_mandir}/man5/FileLog.*
1615 %{_mandir}/man5/KeyFile.*
1616 %{_mandir}/man5/NetInfo.*
1617 %{_mandir}/man5/NetRestrict.*
1618 %{_mandir}/man5/NoAuth.*
1619 %{_mandir}/man5/SALVAGE.fs.*
1620 %{_mandir}/man5/SalvageLog.*
1621 %{_mandir}/man5/sysid.*
1622 %{_mandir}/man5/UserList.*
1623 %{_mandir}/man5/VLLog.*
1624 %{_mandir}/man5/VolserLog.*
1625 %{_mandir}/man5/bdb.DB0.*
1626 %{_mandir}/man5/fms.log.*
1627 %{_mandir}/man5/kaserver.DB0.*
1628 %{_mandir}/man5/kaserverauxdb.*
1629 %{_mandir}/man5/krb.conf.*
1630 %{_mandir}/man5/krb.excl.*
1631 %{_mandir}/man5/prdb.DB0.*
1632 %{_mandir}/man5/salvage.lock.*
1633 %{_mandir}/man5/tapeconfig.*
1634 %{_mandir}/man5/vldb.DB0.*
1635 %{_mandir}/man8/buserver.*
1636 %{_mandir}/man8/fileserver.*
1637 %{_mandir}/man8/dafileserver.*
1638 %{_mandir}/man8/dasalvager.*
1639 %{_mandir}/man8/davolserver.*
1640 %{_mandir}/man8/kadb_check.*
1641 %{_mandir}/man8/ka-forwarder.*
1642 %{_mandir}/man8/prdb_check.*
1643 %{_mandir}/man8/ptserver.*
1644 %{_mandir}/man8/pt_util.*
1645 %{_mandir}/man8/salvager.*
1646 %{_mandir}/man8/salvageserver.*
1647 %{_mandir}/man8/state_analyzer.*
1648 %{_mandir}/man8/upclient.*
1649 %{_mandir}/man8/upserver.*
1650 %{_mandir}/man8/vldb_check.*
1651 %{_mandir}/man8/vldb_convert.*
1652 %{_mandir}/man8/vlserver.*
1653 %{_mandir}/man8/voldump.*
1654 %{_mandir}/man8/volinfo.*
1655 %{_mandir}/man8/volserver.*
1657 %if %{build_authlibs}
1659 %defattr(-,root,root)
1660 %{_libdir}/libafsauthent.so.*
1661 %{_libdir}/libafsrpc.so.*
1662 %{_libdir}/libkopenafs.so.*
1665 %files authlibs-devel
1666 %defattr(-,root,root)
1667 %{_includedir}/kopenafs.h
1668 %{_libdir}/libafsauthent.a
1669 %{_libdir}/libafscp.a
1670 %{_libdir}/libafsrpc.a
1671 %{_libdir}/libafsauthent_pic.a
1672 %{_libdir}/libafsrpc_pic.a
1673 %{_libdir}/libkopenafs.a
1674 %if %{build_authlibs}
1675 %{_libdir}/libafsauthent.so
1676 %{_libdir}/libafsrpc.so
1677 %{_libdir}/libkopenafs.so
1681 %defattr(-,root,root)
1682 %{_bindir}/afs_compile_et
1685 %{_includedir}/lock.h
1686 %{_includedir}/lwp.h
1687 %{_includedir}/preempt.h
1689 %{_includedir}/timer.h
1690 %{_includedir}/ubik.h
1691 %{_includedir}/ubik_int.h
1693 %{_libdir}/libafshcrypto.a
1694 %{_libdir}/libafshcrypto.so
1697 %{_libdir}/librokenafs.a
1698 %{_libdir}/librokenafs.so
1700 %{_libdir}/librxkad.a
1701 %{_libdir}/librxstat.a
1702 %{_libdir}/libubik.a
1703 %{_libdir}/libubik_pthread.a
1704 %{_mandir}/man1/rxgen.*
1705 %{_mandir}/man1/afs_compile_et.*
1707 %if %{build_dkmspkg}
1708 %files -n dkms-%{name}
1709 %defattr(-,root,root)
1710 %{_prefix}/src/%{name}-%{dkms_version}
1713 %files kernel-source
1714 %defattr(-,root,root)
1715 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1716 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1717 %{_prefix}/src/openafs-kernel-%{afsvers}/README
1718 %{_prefix}/src/openafs-kernel-%{afsvers}/src
1721 %defattr(-,root,root)
1725 %defattr(-,root,root)
1728 %{_mandir}/man1/kapasswd.*
1729 %{_mandir}/man8/kpwvalid.*
1733 %defattr(-,root,root)
1735 %{_bindir}/klog.krb5
1737 %{_mandir}/man1/aklog.*
1738 %{_mandir}/man8/asetkey.*
1743 %if %{build_modules}
1748 %defattr(-,root,root)
1749 %{kxmoddir}/fs/openafs/openafs.*
1754 %defattr(-,root,root)
1755 %{kxmoddir}%{?smp_ext:%{smp_ext}}/fs/openafs/openafs.*
1758 %if %{largesmp_package}
1759 %files kernel-largesmp
1760 %defattr(-,root,root)
1761 %{kxmoddir}%{?largesmp_ext:%{largesmp_ext}}/fs/openafs/openafs.*
1764 %if %{bigmem_package}
1765 %files kernel-bigmem
1766 %defattr(-,root,root)
1767 %{kxmoddir}%{?bigmem_ext:%{bigmem_ext}}/fs/openafs/openafs.*
1770 %if %{hugemem_package}
1771 %files kernel-hugemem
1772 %defattr(-,root,root)
1773 %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/fs/openafs/openafs.*
1779 ##############################################################################
1781 ### openafs.spec change log
1783 ##############################################################################
1785 * Wed Dec 12 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1786 - Make the RPM mockable
1788 * Mon Oct 29 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1789 - Update to match the shipped 1.4.5 RPMS
1790 - Fix the kvariant stuff to only configure the 'standard' case once
1791 - Add openafs-kvers.sh back in
1793 * Wed Oct 10 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
1794 - Use Fedora style kmods, which allows us to install multiple kernel types
1796 * Thu Jun 07 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.4-3
1797 - Use distributed files, rather than those in packager's SOURCE directory
1798 - Remove SuidCells stuff, which was unused
1800 * Fri Dec 01 2006 Derrick Brashear <shadow@dementia.org> 1.4.2-2
1801 - integrate s390x changes
1802 - allow for building libafs*.a and not libafs*.so into packages, for platforms
1803 that won't build the .so files.
1805 * Wed Aug 23 2006 Derrick Brashear <shadow@dementia.org> 1.4.2-1
1807 - use installed aklog manpage.
1808 - moduleparam patch obsoleted.
1810 * Tue Aug 22 2006 Derek Atkins <warlord@MIT.EDU> 1.4.2-0.1.rc1
1811 - update to 1.4.2-rc1
1812 - hand-apply lee damon's changes to support largesmp kernels from RHEL4
1813 (but only add support for 2.6 kernels. No need for the 2.4 kernels).
1814 - don't need the posixlock patch anymore.
1816 * Wed Jul 12 2006 Derek Atkins <warlord@MIT.EDU> 1.4.2-0.beta2
1817 - update to 1.4.2-beta2
1818 - add linux2.4 posixlock API patch
1820 * Mon Jun 26 2006 Derek Atkins <warlord@MIT.EDU>
1821 - moduleparam and krb524 patches no longer required in OA-CVS
1823 * Wed May 17 2006 Derek Atkins <warlord@MIT.EDU>
1824 - change non-target-cpu kernel dep to a file dep
1825 - make sure we use the proper kernel version for the dependency.
1827 * Tue May 16 2006 Derek Atkins <warlord@MIT.EDU>
1828 - allow users to specify local CellServDB and SuidCells entries
1829 don't overwrite user's changes. Provide a .dist an let users
1830 make entries in a ".local"
1831 - build the CellServDB and SuidCells at client startup and at
1833 - add provideskernelarch functionality to openafs-kvers-is.sh
1834 - use that functionality to Require kernel{,-<type>}-targetcpu
1835 to get better package safety due to RPM bugs where the kernel
1836 release isn't used so you can install the kernel module against
1837 any kernel of the same major version.
1839 * Mon May 15 2006 Derek Atkins <warlord@MIT.EDU>
1840 - update the README in openafs-kernel-source
1841 - fix openafs-kvers-is.sh from Alexander Bergolth's patch.
1842 - move kernel module from .../kernel/fs/openafs to .../fs/openafs/
1844 * Fri Apr 21 2006 Derek Atkins <warlord@MIT.EDU>
1845 - build requires autoconf and automake for krb5support
1846 and autoconf for standard package
1847 - dont setup the krb5 migration kit (or patches) if we don't care.
1848 - require ncurses-devel to build
1850 * Wed Apr 19 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-3
1851 - look for krb524 functions in libkrb524 if we can't find them
1852 in the standard locations.
1854 * Tue Apr 18 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-2
1855 - fix the module_param_array macro for Linux 2.6.9.
1857 * Sat Apr 15 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-1
1858 - update to 1.4.1 release.
1859 - distribute asetkey from openafs instead of krb5-migration kit
1860 - don't need to apply the FC5 patches because they are part of the distro.
1861 - install asetkey into the "proper" place
1862 - dont list a manpage twice.
1863 - package asetkey man page. delete it when not needed.
1865 * Thu Apr 6 2006 Derek Atkins <warlord@MIT.EDU>
1866 - turn authlibs back on, because RT #18767 was applied to CVS.
1868 * Wed Mar 29 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1rc10-1
1869 - update to 1.4.1rc10, build on FC5
1870 - fix the man pages (distribute into various packages)
1871 - include patches for FC5, RT #29112 and #29122
1873 * Mon Dec 19 2005 Derek Atkins <warlord@MIT.EDU>
1874 - openafs-server shouldn't depend on the kernel module.
1876 * Thu Nov 17 2005 Derek Atkins <warlord@MIT.EDU>
1877 - patch from Mike Polek <mike at pictage.com> to run depmod for
1878 the target kernel and not the running kernel.
1880 * Tue Nov 8 2005 Derek Atkins <warlord@MIT.EDU>
1881 - build aklog from the openafs sources, not from the krb5 migration kit.
1883 * Fri Nov 4 2005 Derek Atkins <warlord@MIT.EDU>
1884 - set openafs-kernel-source to Provide openafs-kernel
1886 * Thu Oct 20 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0-1
1887 - update afs-krb5 res_search patch: look for res_search and __res_search
1888 - update to 1.4.0 final
1890 * Mon Oct 10 2005 Derek Atkins <warlord@MIT.EDU>
1891 - remove all kdump builds.
1893 * Thu Oct 6 2005 Derek Atkins <warlord@MIT.EDU>
1894 - fix openafs-kernel-version.sh so it will build an RPM for the
1895 currently-running kernel even if it's smp on 2.6.
1897 * Tue Sep 27 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc5-1
1898 - upgrade to 1.4.0rc5
1899 - turn off authlibs packages
1901 * Fri Sep 23 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-2
1902 - add kmodule26 patch: fix the kernel module name on 2.6 kernels so
1903 it's called "openafs" and not "libafs". This fixes the shutdown
1906 * Thu Sep 22 2005 Derek Atkins <warlord@MIT.EDU>
1907 - update kversis script, add 'kvers' operation
1908 - fix bug that 2.6 smp/hugemem kernels don't provide
1909 kernel-foo = %{kernvers} with 'smp', 'hugemem', etc.
1910 - add patch to remove res_search from the afs-krb5 configure
1912 * Thu Sep 15 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-1
1913 - Update to 1.4.0rc4
1914 - Update the afs-krb5 krb524 patch so it actually works on
1915 some older systems like RHEL3 that still need -lkrb524.
1916 - Update the buildall script so choose better architecture support,
1917 e.g. don't build i586 on RHEL.
1918 - Update the rebuild information in the SPEC file.
1919 - Add support for finding .EL kernels in openafs-kvers-is.sh
1920 - Add additional error messages when kernel version/type parsing fails.
1921 - Update the buildall script to use the kernel srcdir directly.
1923 * Wed Sep 14 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-2
1924 - Add "hugemem" to 2.4 configs
1925 - Add checks to support scripts to determine whether to build
1926 the bigmem and/or hugemem kernels for 2.4.
1928 * Mon Sep 12 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-1
1929 - Added some afs-krb5 patches to get the migration kit to build
1930 on modern AFS and modern Kerberos.
1931 - Added authlibs and authlibs-devel packages as per UMich changes.
1933 * Sun Sep 11 2005 Derek Atkins <warlord@MIT.EDU>
1934 - Merged in some of the 2.6 changes from wingc@engin.umich.edu
1936 * Sat Sep 10 2005 Derek Atkins <warlord@MIT.EDU>
1937 - Merged in lots of changes from David Howells and Nalin Dahyabhai
1938 from Red Hat. Initial attempt at a release of 1.4. Still need
1939 to work in a 2.6 build system.