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.2015-01-19
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
899 %if %{?krb5config:1}%{!?krb5config:0}
900 KRB5_CONFIG="%{krb5config}"
905 # Configure each of our kernel modules
907 %if %{fedorakmod} && %{build_modules}
908 for kvariant in %{kvariants} ; do
909 if [ -n "${kvariant}" ] ; then
911 if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
912 ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
914 elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
915 # Fedora 20 started putting kernel sources in e.g.
916 # 3.12.5-302.fc20.i686+PAE, instead of:
917 # 3.12.5-302.fc20.i686.PAE
918 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
921 ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
924 cp -R libafs_tree _kmod_build_${kvariant}
925 pushd _kmod_build_${kvariant}
926 ./configure --with-afs-sysname=${sysname} \
927 --prefix=%{_prefix} \
928 --libdir=%{_libdir} \
929 --bindir=%{_bindir} \
930 --sbindir=%{_sbindir} \
931 --with-linux-kernel-packaging \
932 --with-linux-kernel-headers=${ksrc} \
943 %if %{build_userspace}
944 # Build the user-space AFS stuff
945 make dest_nolibafs || exit 1
950 for kvariant in %{kvariants}
952 if [ -n "${kvariant}" ] ; then
953 pushd _kmod_build_$kvariant;
957 make dest_only_libafs
962 # Begin legacy kernel module building code
965 # Build all the kernel modules for linux 2.4.x
966 for variation in %{kvariations}
968 if [ ${variation} = up ]
970 local_smp_def=-DREDHAT_FIX
973 local_smp_def="-DAFS_SMP -DREDHAT_FIX"
977 PrintRedhatKernelFix %{_target_cpu} $variation src/config/redhat-fix.h
978 make dest_only_libafs LOCAL_SMP_DEF="${local_smp_def}" \
979 LINUX_MODULE_NAME="${suffix}" MPS=SP
982 rm -f src/config/redhat-fix.h
984 %elseif %{kvers_is_26}
985 # Build the kernel module for this version of linux 2.6.x
986 # Notice how much easier this is than 2.4. On the other hand,
987 # we require much more external support to build multiple modules.
989 # the MPS=SP just means that we don't add a '.mp' to the name.
990 make dest_only_libafs MPS=SP
993 # End legacy kernel module building code
998 ##############################################################################
1002 ##############################################################################
1005 export DONT_GPRINTIFY=1
1007 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
1019 echo "I don't know how to build linux-`expr %{kernvers} : '\(^[0-9]*[.][0-9]*\)'`"
1028 x86_64) sysname=amd64_linux${kv} ;;
1029 alpha*) sysname=alpha_linux_${kv} ;;
1030 i386|i486|i586|i686|athlon) sysname=i386_linux${kv} ;;
1031 *) sysname=%{_arch}_linux${kv} ;;
1034 # Build install tree
1035 %if %{build_userspace}
1036 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
1037 mkdir -p $RPM_BUILD_ROOT%{_libdir}
1038 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
1039 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1040 mkdir -p $RPM_BUILD_ROOT%{initdir}
1042 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
1043 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
1045 mkdir -p $RPM_BUILD_ROOT/etc/openafs
1046 mkdir -p $RPM_BUILD_ROOT%{pamdir}
1047 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
1048 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/logs
1049 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/etc
1050 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/cache
1051 chmod 700 $RPM_BUILD_ROOT%{_prefix}/vice/cache
1052 mkdir -p $RPM_BUILD_ROOT%{_mandir}
1054 # Copy files from dest to the appropriate places in BuildRoot
1055 tar cf - -C ${sysname}/dest bin include | tar xf - -C $RPM_BUILD_ROOT%{_prefix}
1056 tar cf - -C ${sysname}/dest/lib . | tar xf - -C $RPM_BUILD_ROOT%{_libdir}
1057 tar cf - -C ${sysname}/dest/etc . | tar xf - -C $RPM_BUILD_ROOT%{_sbindir}
1058 tar cf - -C ${sysname}/dest/root.server%{_prefix}/afs bin | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/afs
1059 tar cf - -C ${sysname}/dest/root.client%{_prefix}/vice/etc afsd C | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/vice/etc
1061 # Set the executable bit on libraries in libdir, so rpmbuild knows to
1062 # create "Provides" entries in the package metadata for the libraries
1063 chmod +x $RPM_BUILD_ROOT%{_libdir}/*.so*
1065 # Fix the location of restorevol, since it should be available for
1066 # any user in /usr/bin
1067 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/restorevol $RPM_BUILD_ROOT%{_bindir}/restorevol
1069 # Rename kpasswd to kapasswd
1070 mv -f $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
1072 # Copy root.client config files
1073 install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
1074 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1075 install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
1076 install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
1078 install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
1079 install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
1080 install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
1084 install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
1087 ln -sf pam_afs.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.so
1088 ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so
1090 # Populate /usr/vice/etc
1091 uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
1092 install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
1093 install -p -m 644 %{SOURCE20} $uve/CellServDB.dist
1094 install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
1097 # install dkms source
1099 install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src
1100 cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}
1102 cat > $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}/dkms.conf <<"EOF"
1104 PACKAGE_VERSION="%{dkms_version}"
1106 # Items below here should not have to change with each driver version
1107 PACKAGE_NAME="%{name}"
1108 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'
1109 CLEAN="make -C src/libafs clean"
1111 BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
1112 DEST_MODULE_LOCATION[0]="/kernel/3rdparty/$PACKAGE_NAME/"
1119 # install kernel-source
1122 # Install the kernel module source tree
1123 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
1124 tar cf - -C libafs_tree . | \
1125 tar xf - -C $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
1127 # Next, copy the LICENSE Files, README
1128 install -m 644 src/LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1129 install -m 644 src/packaging/RedHat/openafs-LICENSE.Sun $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1130 install -m 644 src/packaging/RedHat/openafs-README $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
1133 # Install DOCUMENTATION
1136 # Build the DOC directory
1137 mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1138 tar cf - -C doc LICENSE html pdf | \
1139 tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1140 install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1141 install -m 644 %{SOURCE11} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1146 tar cf - -C doc/man-pages man1 man5 man8 | \
1147 tar xf - -C $RPM_BUILD_ROOT%{_mandir}
1149 # Copy the uninstalled krb5 files (or delete the unused krb5 files)
1151 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/asetkey $RPM_BUILD_ROOT%{_sbindir}/asetkey
1153 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/asetkey.*
1156 # remove unused man pages
1157 for x in afs_ftpd afs_inetd afs_login afs_rcp afs_rlogind afs_rsh \
1158 dkload knfs package runntp symlink symlink_list symlink_make \
1160 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/${x}.1
1163 # rename kpasswd to kapasswd
1164 mv $RPM_BUILD_ROOT%{_mandir}/man1/kpasswd.1 $RPM_BUILD_ROOT%{_mandir}/man1/kapasswd.1
1167 gzip -9 $RPM_BUILD_ROOT%{_mandir}/man*/*
1169 # create list of man pages that go in the 'openafs' package
1170 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man1 \
1171 |egrep '^afs|^fs|^kas|^klog|pagsh|^pts|^restorevol|^rxdebug|scout|^sys|tokens|translate|^xstat|udebug|unlog|^uss|^vos' \
1172 |egrep -v '^afs_compile_et' \
1175 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man5 \
1176 |egrep 'CellServDB|ThisCell|afsmonitor|^butc|^uss' \
1179 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man8 \
1180 |egrep '^backup|^bos|^butc|^fms|^fssync-debug|^fstrace|^kas|^read_tape|^uss' \
1186 grep -v "^#" >openafs-file-list <<EOF-openafs-file-list
1187 %{_bindir}/afsmonitor
1193 %{_bindir}/pagsh.krb
1195 %{_bindir}/restorevol
1199 %{_bindir}/tokens.krb
1200 %{_bindir}/translate_et
1201 %{_bindir}/xstat_cm_test
1202 %{_bindir}/xstat_fs_test
1210 %{_sbindir}/read_tape
1215 EOF-openafs-file-list
1217 # add man pages to the list
1218 cat openafs-man1files \
1219 | ( while read x; do echo "%{_mandir}/man1/$x"; done ) \
1221 cat openafs-man5files \
1222 | ( while read x; do echo "%{_mandir}/man5/$x"; done ) \
1224 cat openafs-man8files \
1225 | ( while read x; do echo "%{_mandir}/man8/$x"; done ) \
1229 # Install compatiblity links
1231 for d in bin:bin etc:sbin; do
1232 olddir=`echo $d | sed 's/:.*$//'`
1233 newdir=`echo $d | sed 's/^.*://'`
1234 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir
1235 for f in `cat openafs-file-list`; do
1236 if echo $f | grep -q /$newdir/; then
1238 ln -sf %{_prefix}/$newdir/$fb $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir/$fb
1244 # Remove files we're not installing
1247 # remove duplicated files from /usr/afs/bin
1248 for f in bos fs kas klog klog.krb kpwvalid pts tokens tokens.krb udebug vos ; do
1249 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/$f
1252 # the rest are not needed.
1253 for f in dlog dpass install knfs livesys ; do
1254 rm -f $RPM_BUILD_ROOT%{_bindir}/$f
1257 # not supported on Linux or duplicated
1258 for f in kdb rmtsysd kpwvalid ; do
1259 rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
1261 # sometimes install sucks and puts down a directory. kill it all.
1262 rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
1264 # remove man pages from programs deleted above
1265 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
1266 rm -f $RPM_BUILD_ROOT%{_mandir}/man$f.*
1269 # PAM modules are doubly-installed Remove the version we don't need
1270 for f in pam_afs.krb.so.1 pam_afs.so.1 ; do
1271 rm -f $RPM_BUILD_ROOT%{_libdir}/$f
1274 %if !%{build_authlibs}
1275 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
1276 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
1277 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so.*
1278 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so.*
1283 %if %{build_modules}
1285 for kvariant in %{kvariants}
1287 if [ -n "$kvariant" ] ; then
1288 if [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP ] ; then
1289 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
1290 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
1291 elif [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP ] ; then
1292 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP
1293 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}+${kvariant}/extra/openafs
1295 srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}.${kvariant}-SP
1296 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}.${kvariant}/extra/openafs
1299 if [ -d ${sysname}/dest/root.client/lib/modules/%{kverrel}/extra/openafs ] ; then
1300 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}/extra/openafs
1301 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}/extra/openafs
1303 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
1304 dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
1309 install -m 755 ${srcdir}/openafs.ko ${dstdir}/openafs.ko
1312 # Install the kernel modules
1313 for variation in %{kvariations}
1315 if [ ${variation} = up ]
1318 modname=openafs${kmodend}
1320 kvar=%{kxmoddir}${variation}
1321 modname=openafs${kmodend}
1324 srcdir=${sysname}/dest/root.client/lib/modules/%{kverrel}${kvariant}/extra/openafs
1325 dstdir=$RPM_BUILD_ROOT${kvar}/fs/openafs
1329 install -m 755 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
1334 ##############################################################################
1338 ##############################################################################
1340 rm -f openafs-file-list
1341 [ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
1342 rm -fr $RPM_BUILD_ROOT
1345 ##############################################################################
1349 ##############################################################################
1350 %if %{build_userspace}
1353 if [ -e %{_prefix}/afsws ]; then
1354 /bin/rm -fr %{_prefix}/afsws
1358 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1359 chkconfig --add openafs-client
1361 if [ $1 -eq 1 ] ; then
1362 # Initial installation
1363 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1366 if [ ! -d /afs ]; then
1368 chown root.root /afs
1370 [ -x /sbin/restorecon ] && /sbin/restorecon /afs
1373 # Create the CellServDB
1374 [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
1376 ( cd /usr/vice/etc ; \
1377 if [ -h CellServDB ]; then \
1380 cat CellServDB.local CellServDB.dist > CellServDB ; \
1381 chmod 644 CellServDB )
1384 #on an upgrade, don't enable if we were disabled
1385 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1386 if [ $1 = 1 ] ; then
1387 chkconfig --add openafs-server
1389 %{initdir}/openafs-server condrestart
1391 if [ $1 -eq 1 ] ; then
1392 # Initial installation
1393 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1397 %if %{build_authlibs}
1406 if [ $1 = 0 ] ; then
1407 [ -d /afs ] && rmdir /afs
1412 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1413 if [ $1 = 0 ] ; then
1414 %{initdir}/openafs-client stop
1415 chkconfig --del openafs-client
1418 if [ $1 -eq 0 ] ; then
1419 # Package removal, not upgrade
1420 /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
1421 /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
1426 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1427 if [ $1 = 0 ] ; then
1428 %{initdir}/openafs-server stop
1429 chkconfig --del openafs-server
1432 if [ $1 -eq 0 ] ; then
1433 /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
1434 /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
1438 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1440 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1443 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1446 %if %{build_dkmspkg}
1447 %post -n dkms-%{name}
1448 dkms add -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1449 dkms build -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1450 dkms install -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1452 %preun -n dkms-%{name}
1453 dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
1457 %if %{build_modules}
1461 %{depmod} -ae %{kernvers}
1464 %{depmod} -ae %{kernvers}
1470 %{depmod} -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1473 %{depmod} -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1476 %if %{largesmp_package}
1477 %post kernel-largesmp
1478 %{depmod} -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1480 %postun kernel-largesmp
1481 %{depmod} -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1484 %if %{bigmem_package}
1486 %{depmod} -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1488 %postun kernel-bigmem
1489 %{depmod} -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1492 %if %{hugemem_package}
1493 %post kernel-hugemem
1494 %{depmod} -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1496 %postun kernel-hugemem
1497 %{depmod} -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1502 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1503 %triggerun -- openafs-client < 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-client >/dev/null 2>&1 ||:
1509 # Run this because the SysV package being removed won't do it
1510 /sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
1512 %triggerun -- openafs-server < 1.6.0-1
1513 # Save the current service runlevel info
1514 # User must manually run systemd-sysv-convert --apply httpd
1515 # to migrate them to systemd targets
1516 /usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
1518 # Run this because the SysV package being removed won't do it
1519 /sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
1522 ##############################################################################
1526 ##############################################################################
1527 %if %{build_userspace}
1529 %files -f openafs-file-list
1530 %defattr(-,root,root)
1531 %config(noreplace) /etc/sysconfig/openafs
1532 %doc %{_docdir}/openafs-%{afsvers}/LICENSE
1533 %{_libdir}/libafshcrypto.so.*
1534 %{_libdir}/librokenafs.so.*
1537 %defattr(-,root,root)
1538 %docdir %{_docdir}/openafs-%{afsvers}
1539 %dir %{_docdir}/openafs-%{afsvers}
1540 %{_docdir}/openafs-%{afsvers}/ChangeLog
1541 %{_docdir}/openafs-%{afsvers}/RELNOTES-%{afsvers}
1542 %{_docdir}/openafs-%{afsvers}/pdf
1545 %defattr(-,root,root)
1546 %dir %{_prefix}/vice
1547 %dir %{_prefix}/vice/cache
1548 %dir %{_prefix}/vice/etc
1549 %dir %{_prefix}/vice/etc/C
1550 %{_prefix}/vice/etc/CellServDB.dist
1551 %config(noreplace) %{_prefix}/vice/etc/ThisCell
1552 %config(noreplace) %{_prefix}/vice/etc/cacheinfo
1556 %{_prefix}/vice/etc/afsd
1557 %{_prefix}/vice/etc/C/afszcm.cat
1558 %{pamdir}/pam_afs.krb.so.1
1559 %{pamdir}/pam_afs.krb.so
1560 %{pamdir}/pam_afs.so.1
1561 %{pamdir}/pam_afs.so
1562 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1563 %{initdir}/openafs-client
1565 %{_unitdir}/openafs-client.service
1566 %{_sysconfdir}/sysconfig/modules/openafs-client.modules
1568 %{_mandir}/man1/cmdebug.*
1569 %{_mandir}/man1/up.*
1570 %{_mandir}/man5/afs.5.gz
1571 %{_mandir}/man5/afs_cache.5.gz
1572 %{_mandir}/man5/afs_volume_header.5.gz
1573 %{_mandir}/man5/afszcm.cat.5.gz
1574 %{_mandir}/man5/cacheinfo.*
1575 %{_mandir}/man8/afsd.*
1576 %{_mandir}/man8/vsys.*
1577 %{_mandir}/man5/CellAlias.*
1580 %defattr(-,root,root)
1582 %dir %{_prefix}/afs/bin
1583 %dir %{_prefix}/afs/etc
1584 %dir %{_prefix}/afs/logs
1585 %{_prefix}/afs/bin/bosserver
1586 %{_prefix}/afs/bin/bos_util
1587 %{_prefix}/afs/bin/buserver
1588 %{_prefix}/afs/bin/dafileserver
1589 %{_prefix}/afs/bin/dafssync-debug
1590 %{_prefix}/afs/bin/dasalvager
1591 %{_prefix}/afs/bin/davolserver
1592 %{_prefix}/afs/bin/fileserver
1593 %{_prefix}/afs/bin/fssync-debug
1594 # Should we support KAServer?
1595 %{_prefix}/afs/bin/kaserver
1596 %{_prefix}/afs/bin/ka-forwarder
1597 %{_prefix}/afs/bin/pt_util
1598 %{_prefix}/afs/bin/ptserver
1599 %{_prefix}/afs/bin/salvager
1600 %{_prefix}/afs/bin/salvageserver
1601 %{_prefix}/afs/bin/salvsync-debug
1602 %{_prefix}/afs/bin/state_analyzer
1603 %{_prefix}/afs/bin/upclient
1604 %{_prefix}/afs/bin/upserver
1605 %{_prefix}/afs/bin/vlserver
1606 %{_prefix}/afs/bin/volinfo
1607 %{_prefix}/afs/bin/volscan
1608 %{_prefix}/afs/bin/volserver
1609 %{_sbindir}/kadb_check
1610 %{_sbindir}/prdb_check
1611 %{_sbindir}/vldb_check
1612 %{_sbindir}/vldb_convert
1614 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1615 %{initdir}/openafs-server
1617 %{_unitdir}/openafs-server.service
1619 %{_mandir}/man5/AuthLog.*
1620 %{_mandir}/man5/BackupLog.*
1621 %{_mandir}/man5/BosConfig.*
1622 %{_mandir}/man5/BosLog.*
1623 %{_mandir}/man5/FORCESALVAGE.*
1624 %{_mandir}/man5/FileLog.*
1625 %{_mandir}/man5/KeyFile.*
1626 %{_mandir}/man5/NetInfo.*
1627 %{_mandir}/man5/NetRestrict.*
1628 %{_mandir}/man5/NoAuth.*
1629 %{_mandir}/man5/SALVAGE.fs.*
1630 %{_mandir}/man5/SalvageLog.*
1631 %{_mandir}/man5/sysid.*
1632 %{_mandir}/man5/UserList.*
1633 %{_mandir}/man5/VLLog.*
1634 %{_mandir}/man5/VolserLog.*
1635 %{_mandir}/man5/bdb.DB0.*
1636 %{_mandir}/man5/fms.log.*
1637 %{_mandir}/man5/kaserver.DB0.*
1638 %{_mandir}/man5/kaserverauxdb.*
1639 %{_mandir}/man5/krb.conf.*
1640 %{_mandir}/man5/krb.excl.*
1641 %{_mandir}/man5/prdb.DB0.*
1642 %{_mandir}/man5/salvage.lock.*
1643 %{_mandir}/man5/tapeconfig.*
1644 %{_mandir}/man5/vldb.DB0.*
1645 %{_mandir}/man8/buserver.*
1646 %{_mandir}/man8/fileserver.*
1647 %{_mandir}/man8/dafileserver.*
1648 %{_mandir}/man8/dasalvager.*
1649 %{_mandir}/man8/davolserver.*
1650 %{_mandir}/man8/kadb_check.*
1651 %{_mandir}/man8/ka-forwarder.*
1652 %{_mandir}/man8/prdb_check.*
1653 %{_mandir}/man8/ptserver.*
1654 %{_mandir}/man8/pt_util.*
1655 %{_mandir}/man8/salvager.*
1656 %{_mandir}/man8/salvageserver.*
1657 %{_mandir}/man8/state_analyzer.*
1658 %{_mandir}/man8/upclient.*
1659 %{_mandir}/man8/upserver.*
1660 %{_mandir}/man8/vldb_check.*
1661 %{_mandir}/man8/vldb_convert.*
1662 %{_mandir}/man8/vlserver.*
1663 %{_mandir}/man8/voldump.*
1664 %{_mandir}/man8/volinfo.*
1665 %{_mandir}/man8/volscan.*
1666 %{_mandir}/man8/volserver.*
1668 %if %{build_authlibs}
1670 %defattr(-,root,root)
1671 %{_libdir}/libafsauthent.so.*
1672 %{_libdir}/libafsrpc.so.*
1673 %{_libdir}/libkopenafs.so.*
1676 %files authlibs-devel
1677 %defattr(-,root,root)
1678 %{_includedir}/kopenafs.h
1679 %{_libdir}/libafsauthent.a
1680 %{_libdir}/libafscp.a
1681 %{_libdir}/libafsrpc.a
1682 %{_libdir}/libafsauthent_pic.a
1683 %{_libdir}/libafsrpc_pic.a
1684 %{_libdir}/libkopenafs.a
1685 %if %{build_authlibs}
1686 %{_libdir}/libafsauthent.so
1687 %{_libdir}/libafsrpc.so
1688 %{_libdir}/libkopenafs.so
1692 %defattr(-,root,root)
1693 %{_bindir}/afs_compile_et
1696 %{_includedir}/lock.h
1697 %{_includedir}/lwp.h
1698 %{_includedir}/preempt.h
1700 %{_includedir}/timer.h
1701 %{_includedir}/ubik.h
1702 %{_includedir}/ubik_int.h
1704 %{_libdir}/libafshcrypto.a
1705 %{_libdir}/libafshcrypto.so
1708 %{_libdir}/librokenafs.a
1709 %{_libdir}/librokenafs.so
1711 %{_libdir}/librxkad.a
1712 %{_libdir}/librxstat.a
1713 %{_libdir}/libubik.a
1714 %{_libdir}/libubik_pthread.a
1715 %{_mandir}/man1/rxgen.*
1716 %{_mandir}/man1/afs_compile_et.*
1718 %if %{build_dkmspkg}
1719 %files -n dkms-%{name}
1720 %defattr(-,root,root)
1721 %{_prefix}/src/%{name}-%{dkms_version}
1724 %files kernel-source
1725 %defattr(-,root,root)
1726 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1727 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1728 %{_prefix}/src/openafs-kernel-%{afsvers}/README
1729 %{_prefix}/src/openafs-kernel-%{afsvers}/src
1732 %defattr(-,root,root)
1736 %defattr(-,root,root)
1739 %{_mandir}/man1/kapasswd.*
1740 %{_mandir}/man8/kpwvalid.*
1744 %defattr(-,root,root)
1746 %{_bindir}/klog.krb5
1748 %{_mandir}/man1/aklog.*
1749 %{_mandir}/man8/asetkey.*
1754 %if %{build_modules}
1759 %defattr(-,root,root)
1760 %{kxmoddir}/fs/openafs/openafs.*
1765 %defattr(-,root,root)
1766 %{kxmoddir}%{?smp_ext:%{smp_ext}}/fs/openafs/openafs.*
1769 %if %{largesmp_package}
1770 %files kernel-largesmp
1771 %defattr(-,root,root)
1772 %{kxmoddir}%{?largesmp_ext:%{largesmp_ext}}/fs/openafs/openafs.*
1775 %if %{bigmem_package}
1776 %files kernel-bigmem
1777 %defattr(-,root,root)
1778 %{kxmoddir}%{?bigmem_ext:%{bigmem_ext}}/fs/openafs/openafs.*
1781 %if %{hugemem_package}
1782 %files kernel-hugemem
1783 %defattr(-,root,root)
1784 %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/fs/openafs/openafs.*
1790 ##############################################################################
1792 ### openafs.spec change log
1794 ##############################################################################
1796 * Wed Dec 12 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1797 - Make the RPM mockable
1799 * Mon Oct 29 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1800 - Update to match the shipped 1.4.5 RPMS
1801 - Fix the kvariant stuff to only configure the 'standard' case once
1802 - Add openafs-kvers.sh back in
1804 * Wed Oct 10 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
1805 - Use Fedora style kmods, which allows us to install multiple kernel types
1807 * Thu Jun 07 2007 Simon Wilkinson <simon@sxw.org.uk> 1.4.4-3
1808 - Use distributed files, rather than those in packager's SOURCE directory
1809 - Remove SuidCells stuff, which was unused
1811 * Fri Dec 01 2006 Derrick Brashear <shadow@dementia.org> 1.4.2-2
1812 - integrate s390x changes
1813 - allow for building libafs*.a and not libafs*.so into packages, for platforms
1814 that won't build the .so files.
1816 * Wed Aug 23 2006 Derrick Brashear <shadow@dementia.org> 1.4.2-1
1818 - use installed aklog manpage.
1819 - moduleparam patch obsoleted.
1821 * Tue Aug 22 2006 Derek Atkins <warlord@MIT.EDU> 1.4.2-0.1.rc1
1822 - update to 1.4.2-rc1
1823 - hand-apply lee damon's changes to support largesmp kernels from RHEL4
1824 (but only add support for 2.6 kernels. No need for the 2.4 kernels).
1825 - don't need the posixlock patch anymore.
1827 * Wed Jul 12 2006 Derek Atkins <warlord@MIT.EDU> 1.4.2-0.beta2
1828 - update to 1.4.2-beta2
1829 - add linux2.4 posixlock API patch
1831 * Mon Jun 26 2006 Derek Atkins <warlord@MIT.EDU>
1832 - moduleparam and krb524 patches no longer required in OA-CVS
1834 * Wed May 17 2006 Derek Atkins <warlord@MIT.EDU>
1835 - change non-target-cpu kernel dep to a file dep
1836 - make sure we use the proper kernel version for the dependency.
1838 * Tue May 16 2006 Derek Atkins <warlord@MIT.EDU>
1839 - allow users to specify local CellServDB and SuidCells entries
1840 don't overwrite user's changes. Provide a .dist an let users
1841 make entries in a ".local"
1842 - build the CellServDB and SuidCells at client startup and at
1844 - add provideskernelarch functionality to openafs-kvers-is.sh
1845 - use that functionality to Require kernel{,-<type>}-targetcpu
1846 to get better package safety due to RPM bugs where the kernel
1847 release isn't used so you can install the kernel module against
1848 any kernel of the same major version.
1850 * Mon May 15 2006 Derek Atkins <warlord@MIT.EDU>
1851 - update the README in openafs-kernel-source
1852 - fix openafs-kvers-is.sh from Alexander Bergolth's patch.
1853 - move kernel module from .../kernel/fs/openafs to .../fs/openafs/
1855 * Fri Apr 21 2006 Derek Atkins <warlord@MIT.EDU>
1856 - build requires autoconf and automake for krb5support
1857 and autoconf for standard package
1858 - dont setup the krb5 migration kit (or patches) if we don't care.
1859 - require ncurses-devel to build
1861 * Wed Apr 19 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-3
1862 - look for krb524 functions in libkrb524 if we can't find them
1863 in the standard locations.
1865 * Tue Apr 18 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-2
1866 - fix the module_param_array macro for Linux 2.6.9.
1868 * Sat Apr 15 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1-1
1869 - update to 1.4.1 release.
1870 - distribute asetkey from openafs instead of krb5-migration kit
1871 - don't need to apply the FC5 patches because they are part of the distro.
1872 - install asetkey into the "proper" place
1873 - dont list a manpage twice.
1874 - package asetkey man page. delete it when not needed.
1876 * Thu Apr 6 2006 Derek Atkins <warlord@MIT.EDU>
1877 - turn authlibs back on, because RT #18767 was applied to CVS.
1879 * Wed Mar 29 2006 Derek Atkins <warlord@MIT.EDU> 1.4.1rc10-1
1880 - update to 1.4.1rc10, build on FC5
1881 - fix the man pages (distribute into various packages)
1882 - include patches for FC5, RT #29112 and #29122
1884 * Mon Dec 19 2005 Derek Atkins <warlord@MIT.EDU>
1885 - openafs-server shouldn't depend on the kernel module.
1887 * Thu Nov 17 2005 Derek Atkins <warlord@MIT.EDU>
1888 - patch from Mike Polek <mike at pictage.com> to run depmod for
1889 the target kernel and not the running kernel.
1891 * Tue Nov 8 2005 Derek Atkins <warlord@MIT.EDU>
1892 - build aklog from the openafs sources, not from the krb5 migration kit.
1894 * Fri Nov 4 2005 Derek Atkins <warlord@MIT.EDU>
1895 - set openafs-kernel-source to Provide openafs-kernel
1897 * Thu Oct 20 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0-1
1898 - update afs-krb5 res_search patch: look for res_search and __res_search
1899 - update to 1.4.0 final
1901 * Mon Oct 10 2005 Derek Atkins <warlord@MIT.EDU>
1902 - remove all kdump builds.
1904 * Thu Oct 6 2005 Derek Atkins <warlord@MIT.EDU>
1905 - fix openafs-kernel-version.sh so it will build an RPM for the
1906 currently-running kernel even if it's smp on 2.6.
1908 * Tue Sep 27 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc5-1
1909 - upgrade to 1.4.0rc5
1910 - turn off authlibs packages
1912 * Fri Sep 23 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-2
1913 - add kmodule26 patch: fix the kernel module name on 2.6 kernels so
1914 it's called "openafs" and not "libafs". This fixes the shutdown
1917 * Thu Sep 22 2005 Derek Atkins <warlord@MIT.EDU>
1918 - update kversis script, add 'kvers' operation
1919 - fix bug that 2.6 smp/hugemem kernels don't provide
1920 kernel-foo = %{kernvers} with 'smp', 'hugemem', etc.
1921 - add patch to remove res_search from the afs-krb5 configure
1923 * Thu Sep 15 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-1
1924 - Update to 1.4.0rc4
1925 - Update the afs-krb5 krb524 patch so it actually works on
1926 some older systems like RHEL3 that still need -lkrb524.
1927 - Update the buildall script so choose better architecture support,
1928 e.g. don't build i586 on RHEL.
1929 - Update the rebuild information in the SPEC file.
1930 - Add support for finding .EL kernels in openafs-kvers-is.sh
1931 - Add additional error messages when kernel version/type parsing fails.
1932 - Update the buildall script to use the kernel srcdir directly.
1934 * Wed Sep 14 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-2
1935 - Add "hugemem" to 2.4 configs
1936 - Add checks to support scripts to determine whether to build
1937 the bigmem and/or hugemem kernels for 2.4.
1939 * Mon Sep 12 2005 Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-1
1940 - Added some afs-krb5 patches to get the migration kit to build
1941 on modern AFS and modern Kerberos.
1942 - Added authlibs and authlibs-devel packages as per UMich changes.
1944 * Sun Sep 11 2005 Derek Atkins <warlord@MIT.EDU>
1945 - Merged in some of the 2.6 changes from wingc@engin.umich.edu
1947 * Sat Sep 10 2005 Derek Atkins <warlord@MIT.EDU>
1948 - Merged in lots of changes from David Howells and Nalin Dahyabhai
1949 from Red Hat. Initial attempt at a release of 1.4. Still need
1950 to work in a 2.6 build system.