85bfc88c384ca52b94fbe2928d515d8f37e7b989
[openafs.git] / src / packaging / RedHat / openafs.spec.in
1 # Openafs Spec $Revision$
2
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@
8
9 %{!?build_dkmspkg: %define build_dkmspkg 1}
10
11 #
12 # Determine presence of rpmbuild command line --define arguments and set
13 # defaults if not present.
14 #
15 %define kernvers_on_cmdline %{?kernvers:1}%{!?kernvers:0}
16 %define build_userspace_on_cmdline %{?build_userspace:1}%{!?build_userspace:0}
17 %define build_modules_on_cmdline %{?build_modules:1}%{!?build_modules:0}
18 %define debugspec_on_cmdline %{?debugspec:1}%{!?debugspec:0}
19
20 %if !%{kernvers_on_cmdline}
21 %define kernvers %(uname -r)
22 %endif
23 %if !%{build_userspace_on_cmdline}
24 %define build_userspace 1
25 %endif
26 %if !%{build_modules_on_cmdline}
27 %define build_modules 1
28 %endif
29 %if !%{debugspec_on_cmdline}
30 %define debugspec 0
31 %endif
32
33 # Specify '--with kauth' if you want to include the legacy kaserver and related
34 # programs.
35 %define kauth_support %{?_with_kauth:1}%{!?_with_kauth:0}
36
37 # Specify '--without authlibs' if you do not want to build the openafs-authlibs
38 # package.
39 %define build_authlibs %{?_without_authlibs:0}%{!?_without_authlibs:1}
40
41 # Specify '--without krb5' if you do not want to build the openafs-krb5 package
42 # to distribute aklog, asetkey, and akeyconvert.
43 %define krb5support %{?_without_krb5:0}%{!?_without_krb5:1}
44
45 # Specify '--with bootkernel' if you want to build the
46 # kernel module for Red Hat BOOT Kernels on x86.
47 %define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0}
48
49 #
50 # Definitions
51 #
52 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
53 %define depmod /usr/sbin/depmod
54 %else
55 %define depmod /sbin/depmod
56 %endif
57
58 %define kmodtool bash %{_sourcedir}/openafs-kmodtool
59
60 %define kmod_name openafs
61 %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
62
63 %define upvar ""
64 %{!?kvariants: %define kvariants %{?upvar}}
65
66 %if %{?ksrcdir:1}%{!?ksrcdir:0}
67   if ( -d %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}) ; then
68     %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}}
69   else
70     %define ksrcdir %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}}
71   fi
72 %endif
73
74 %define dkms_version %{pkgvers}-%{pkgrel}%{?dist}
75
76 # Define the location of your init.d directory
77 %define initdir /etc/rc.d/init.d
78
79 #determine if the kernel provides an arch-specific Provides
80 %define kprovidesarch %(%{kversis} provideskernelarch %{ksrcdir} %{_target_cpu})
81
82 # Define the location of the PAM security module directory
83 %define pamdir /%{_lib}/security
84
85 Summary: OpenAFS distributed filesystem
86 Name: openafs
87 Version: %{pkgvers}
88 Release: %{pkgrel}%{?dist}
89 License: IBM Public License
90 URL: http://www.openafs.org
91 BuildRoot: %{_tmppath}/%{name}-%{version}-root
92 Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
93 Group: Networking/Filesystems
94 BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
95 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
96 BuildRequires: systemd-units
97 %endif
98 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
99 BuildRequires: perl-devel
100 %endif
101 BuildRequires: perl(ExtUtils::Embed)
102 %if %{krb5support}
103 BuildRequires: krb5-devel
104 %endif
105 %if %{build_modules}
106 BuildRequires: kernel-devel
107 %endif
108
109 ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
110
111 #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
112 Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
113 Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
114 %define srcdir openafs-%{afsvers}
115
116 Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
117 Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
118
119 Source20: https://www.central.org/dl/cellservdb/CellServDB.2016-01-01
120
121 Source30: openafs-kernel-version.sh
122 Source996: openafs-kvers-is.sh
123 Source997: openafs-buildfedora.pl
124 Source998: openafs-buildall.sh
125 Source999: openafs-kmodtool
126
127 %description
128 The AFS distributed filesystem.  AFS is a distributed filesystem
129 allowing cross-platform sharing of files among multiple computers.
130 Facilities are provided for access control, authentication, backup and
131 administrative management.
132
133 This package provides common files shared across all the various
134 OpenAFS packages but are not necessarily tied to a client or server.
135
136 The OpenAFS SRPM can be rebuilt with the following options to control
137 what gets built:
138
139  --define "kernvers 3.19.3-100.fc20.i686" Specify the specific kernel version
140                                   to build modules against. The default is
141                                   to build against the currently-running
142                                   kernel.
143  --define "kbase /lib/modules/"   The base location to look for kernel headers
144  --define "kend /build"           The 'end' location to look for kernels
145                                   The build will define ksrvdir as
146                                   %%{kbase}<kernvers>%%{kend}
147
148  --without authlibs               Disable authlibs package (default: with authlibs)
149  --without krb5                   Disable krb5 support (default: with krb5)
150  --with bitmap-later              Enable "bitmap later" support
151  --with bos-restricted            Enable "bos restricted" mode
152  --with supergroups               Enable "supergroups"
153
154  --target=i386                    The target architecture to build for.
155
156  --define "build_userspace 1"     Request building of userspace tools
157  --define "build_modules 1"       Request building of kernel modules
158                                   You probably never need to specify these.
159
160  --define "kmoddir /lib/modules"  This is the base location where modules
161                                   will be installed.  You probably don't
162                                   need to change this ever.
163
164  --define "kvariants <variants>"  When building Fedora style kernel modules,
165                                   this defines the set of kernel variants
166                                   to build.
167                                   <variants> is a space seperated list which
168                                   may contain one or more of
169                                   '' (for the generic kernel), smp, PAE, xen
170                                   or kdump
171
172 To a kernel module for your running kernel, just run:
173   rpmbuild --rebuild --target=`uname -m` openafs-%{pkgvers}-%{pkgrel}%{?dist}.src.rpm
174
175 ##############################################################################
176 #
177 # build the userspace side of things if so requested
178 #
179 ##############################################################################
180 %if %{build_userspace}
181
182 %package client
183 Requires: binutils, openafs = %{version}
184 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
185 Requires: systemd-units
186 Requires(post): systemd-units, systemd-sysv
187 Requires(preun): systemd-units
188 Requires(postun): systemd-units
189 %endif
190
191 Requires: %{name}-kmod >= %{version}
192 Provides: %{name}-kmod-common = %{version}
193
194 Summary: OpenAFS Filesystem Client
195 Group: Networking/Filesystem
196
197 %description client
198 The AFS distributed filesystem.  AFS is a distributed filesystem
199 allowing cross-platform sharing of files among multiple computers.
200 Facilities are provided for access control, authentication, backup and
201 administrative management.
202
203 This package provides basic client support to mount and manipulate
204 AFS.
205
206 %package server
207 Requires: openafs = %{version}
208 Summary: OpenAFS Filesystem Server
209 Group: Networking/Filesystems
210 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
211 Requires: systemd-units
212 Requires(post): systemd-units, systemd-sysv
213 Requires(preun): systemd-units
214 Requires(postun): systemd-units
215 %endif
216
217 %description server
218 The AFS distributed filesystem.  AFS is a distributed filesystem
219 allowing cross-platform sharing of files among multiple computers.
220 Facilities are provided for access control, authentication, backup and
221 administrative management.
222
223 This package provides basic server support to host files in an AFS
224 Cell.
225
226 %if %{build_dkmspkg}
227 %package -n dkms-%{name}
228 Summary:        DKMS-ready kernel source for AFS distributed filesystem
229 Group:          Development/Kernel
230 Provides:       openafs-kernel = %{version}
231 Provides: %{name}-kmod = %{version}
232 Requires(pre):  dkms
233 Requires(pre):  flex
234 Requires(post): dkms
235 Requires:       %{name}-kmod-common = %{version}
236
237 %description -n dkms-%{name}
238 The AFS distributed filesystem.  AFS is a distributed filesystem
239 allowing cross-platform sharing of files among multiple computers.
240 Facilities are provided for access control, authentication, backup and
241 administrative management.
242
243 This package provides the source code to allow DKMS to build an
244 AFS kernel module.
245 %endif
246
247 %if %{build_authlibs}
248 %package authlibs
249 Summary: OpenAFS authentication shared libraries
250 Group: Networking/Filesystems
251
252 %description authlibs
253 The AFS distributed filesystem.  AFS is a distributed filesystem
254 allowing cross-platform sharing of files among multiple computers.
255 Facilities are provided for access control, authentication, backup and
256 administrative management.
257
258 This package provides a shared version of libafsrpc and libafsauthent.
259 None of the programs included with OpenAFS currently use these shared
260 libraries; however, third-party software that wishes to perform AFS
261 authentication may link against them.
262 %endif
263
264 %package authlibs-devel
265 %if %{build_authlibs}
266 Requires: openafs-authlibs = %{version}-%{release}
267 %endif
268 Requires: openafs-devel = %{version}-%{release}
269 Summary: OpenAFS shared library development
270 Group: Development/Filesystems
271
272 %description authlibs-devel
273 The AFS distributed filesystem.  AFS is a distributed filesystem
274 allowing cross-platform sharing of files among multiple computers.
275 Facilities are provided for access control, authentication, backup and
276 administrative management.
277
278 This package includes the static versions of libafsrpc and
279 libafsauthent, and symlinks required for building against the dynamic
280 libraries.
281
282 %package devel
283 Summary: OpenAFS Development Libraries and Headers
284 Group: Development/Filesystems
285 Requires: openafs = %{version}-%{release}
286
287 %description devel
288 The AFS distributed filesystem.  AFS is a distributed filesystem
289 allowing cross-platform sharing of files among multiple computers.
290 Facilities are provided for access control, authentication, backup and
291 administrative management.
292
293 This package provides static development libraries and headers needed
294 to compile AFS applications.  Note: AFS currently does not provide
295 shared libraries.
296
297 %package docs
298 Summary: OpenAFS user and administrator documentation
299 Requires: openafs = %{version}-%{release}
300 Group: Networking/Filesystems
301
302 %description docs
303 The AFS distributed filesystem.  AFS is a distributed filesystem
304 allowing cross-platform sharing of files among multiple computers.
305 Facilities are provided for access control, authentication, backup and
306 administrative management.
307
308 This package provides HTML documentation for OpenAFS users and system
309 administrators.
310
311 %package kernel-source
312 Summary: OpenAFS Kernel Module source tree
313 Group: Networking/Filesystems
314 Provides: openafs-kernel = %{version}
315 Provides: %{name}-kmod = %{version}
316
317 %description kernel-source
318 The AFS distributed filesystem.  AFS is a distributed filesystem
319 allowing cross-platform sharing of files among multiple computers.
320 Facilities are provided for access control, authentication, backup and
321 administrative management.
322
323 This package provides the source code to build your own AFS kernel
324 module.
325
326 %package compat
327 Summary: OpenAFS client compatibility symlinks
328 Requires: openafs = %{version}, openafs-client = %{version}
329 Group: Networking/Filesystems
330 Obsoletes: openafs-client-compat
331
332 %description compat
333 The AFS distributed filesystem.  AFS is a distributed filesystem
334 allowing cross-platform sharing of files among multiple computers.
335 Facilities are provided for access control, authentication, backup and
336 administrative management.
337
338 This package provides compatibility symlinks in /usr/afsws.  It is
339 completely optional, and is only necessary to support legacy
340 applications and scripts that hard-code the location of AFS client
341 programs.
342
343 %if %{kauth_support}
344 %package kpasswd
345 Summary: OpenAFS KA kpasswd support
346 Requires: openafs
347 Group: Networking/Filesystems
348
349 %description kpasswd
350 The AFS distributed filesystem.  AFS is a distributed filesystem
351 allowing cross-platform sharing of files among multiple computers.
352 Facilities are provided for access control, authentication, backup and
353 administrative management.
354
355 This package provides the kpasswd executable, renamed to kapasswd to avoid
356 clashes, for sites still using KAserver instead of Krb5.
357 %endif
358
359 %if %{krb5support}
360 %package krb5
361 Summary: OpenAFS programs to use with krb5
362 Requires: openafs = %{version}
363 Group: Networking/Filesystems
364 BuildRequires: krb5-devel
365
366 %description krb5
367 The AFS distributed filesystem.  AFS is a distributed filesystem
368 allowing cross-platform sharing of files among multiple computers.
369 Facilities are provided for access control, authentication, backup and
370 administrative management.
371
372 This package provides compatibility programs so you can use krb5
373 to authenticate to AFS services, instead of using AFS's homegrown
374 krb4 lookalike services.
375 %endif
376
377 %endif
378
379 ##############################################################################
380 #
381 # build the kernel modules if so requested
382 #
383 ##############################################################################
384 %if %{build_modules}
385
386 %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{depmod} %{kvariants} 2>/dev/null)}
387
388 %endif
389
390 ##############################################################################
391 #
392 # PREP
393 #
394 ##############################################################################
395
396 %prep
397
398 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
399 : @@@
400 : @@@ kernel version:     %{kernvers}
401 : @@@ kernel variations:  %{kvariants}
402 : @@@ PAM modules dir:    %{pamdir}
403 : @@@ build userspace:    %{build_userspace}
404 : @@@ build modules:      %{build_modules}
405 : @@@ arch:               %{_arch}
406 : @@@ target cpu:         %{_target_cpu}
407 : @@@
408 : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
409
410 # Install OpenAFS src and doc
411 #%setup -q -n %{srcdir}
412 %setup -q -b 1 -n %{srcdir}
413
414 ##############################################################################
415 #
416 # building
417 #
418 ##############################################################################
419 %build
420 case %{_arch} in
421        x86_64)                         sysname=amd64_linux26        ;;
422        alpha*)                         sysname=alpha_linux_26       ;;
423        i386|i486|i586|i686|athlon)     sysname=i386_linux26         ;;
424        *)                              sysname=%{_arch}_linux26     ;;
425 esac
426
427 %ifarch %{ix86}
428 archlist="i386 i586 i686 athlon"
429 %if %{bootkernelsupport}
430   archlist="${archlist} BOOT"
431 %endif
432 %else
433 archlist=%{_arch}
434 %endif
435
436 #
437 # PrintDefine var value statements file
438 #
439 PrintDefine() {
440     case $3 in
441     *ifn*)
442         echo "#ifndef $1" >> $4
443         ;;
444     esac
445     case $3 in
446     *und*)
447         echo "#undef $1" >> $4
448         ;;
449     esac
450     case $3 in
451     *def*)
452         echo "#define $1 $2" >> $4
453         ;;
454     esac
455     case $3 in
456     *end*)
457         echo "#endif" >> $4
458         ;;
459     esac
460     case $3 in
461     *inc*)
462         echo "#include $1" >> $4
463         ;;
464     esac
465     case $3 in
466     *nl*)
467         echo "" >> $4
468         ;;
469     esac
470 }
471
472 # PrintRedhatKernelFix arch mp file
473 PrintRedhatKernelFix() {
474     arch="$1"
475     up=0
476     smp=0
477     largesmp=0
478     ent=0
479     bigmem=0
480     hugemem=0
481     boot=0
482     bootsmp=0
483
484     case "$2" in
485        up)     up=1;;
486        smp)    smp=1;;
487        largesmp) largesmp=1;;
488        bigmem) bigmem=1;;
489        hugemem) hugemem=1;;
490        *)
491                echo "$2 not supported"
492                exit 2;;
493     esac
494
495     file="$3"
496
497     rm -f $file
498     touch $file
499
500     PrintDefine "REDHAT_FIX_H" "" ifn,def,nl $file
501
502     PrintDefine __BOOT_KERNEL_ENTERPRISE $ent     und,def,nl $file
503     PrintDefine __BOOT_KERNEL_BIGMEM     $bigmem  und,def,nl $file
504     PrintDefine __BOOT_KERNEL_HUGEMEM    $hugemem und,def,nl $file
505     PrintDefine __BOOT_KERNEL_SMP        $smp     und,def,nl $file
506     PrintDefine __BOOT_KERNEL_LARGESMP   $largesmp und,def,nl $file
507     PrintDefine __BOOT_KERNEL_UP         $up      und,def,nl $file
508     PrintDefine __BOOT_KERNEL_BOOT       $boot    und,def,nl $file
509     PrintDefine __BOOT_KERNEL_BOOTSMP    $bootsmp und,def,nl $file
510
511     PrintDefine '"/boot/kernel.h"' "" inc,nl $file      # include file
512
513     for ar in $archlist ; do
514         if [ "$ar" = "$arch" ]; then
515             PrintDefine "__MODULE_KERNEL_$ar" "1" ifn,def,end $file
516         else
517             PrintDefine "__MODULE_KERNEL_$ar" "" und $file      # undef
518         fi
519     done
520     echo "" >> $file
521
522     PrintDefine "" "" end $file
523
524     if [ %{debugspec} = 1 ] ; then
525         echo "Kernel Configuration File for Red Hat kernels:"
526         cat $file
527     fi
528 }
529
530 config_opts="--enable-redhat-buildsys \
531         %{?_with_kauth:--enable-kauth} \
532         %{?_with_bitmap_later:--enable-bitmap-later} \
533         %{?_with_bos_restricted:--enable-bos-restricted-mode} \
534         %{?_with_supergroups:--enable-supergroups} \
535         --enable-transarc-paths"
536
537 # Configure AFS
538
539 # If we're using Fedora kmods, work out which is the best kernel module to
540 # use for the userland configuration step. If no variants have been specified,
541 # then use the standard kernel. If variants are specified, use the standard kernel
542 # if it's listed, otherwise pick the first listed kernel.
543 ksrc=""
544 for kvariant in %{kvariants} ; do
545   if [ -z "${kvariant}" -o -z "$ksrc" ] ; then
546     if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
547       ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
548     elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
549       ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
550     else
551       ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
552     fi
553   fi
554 done
555 if [ -z "$ksrc" ] ; then
556 ksrc=%{ksrcdir}
557 fi
558
559 CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
560
561 %if %{krb5support}
562 %if %{?krb5config:1}%{!?krb5config:0}
563 KRB5_CONFIG="%{krb5config}"
564 export KRB5_CONFIG
565 %endif
566 %endif
567
568 ./configure --with-afs-sysname=${sysname} \
569        --prefix=%{_prefix} \
570        --libdir=%{_libdir} \
571        --bindir=%{_bindir} \
572        --sbindir=%{_sbindir} \
573        --disable-strip-binaries \
574        --enable-debug \
575        --with-linux-kernel-packaging \
576 %if %{build_modules}
577        --with-linux-kernel-headers=${ksrc} \
578 %endif
579 %if %{krb5support}
580         --with-krb5 \
581 %endif
582        $config_opts \
583        || exit 1
584
585 # Build the libafs tree
586 make only_libafs_tree || exit 1
587
588 %if %{krb5support}
589 %if %{?krb5config:1}%{!?krb5config:0}
590 KRB5_CONFIG="%{krb5config}"
591 export KRB5_CONFIG
592 %endif
593 %endif
594
595 # Configure each of our kernel modules
596
597 %if %{build_modules}
598 for kvariant in %{kvariants} ; do
599   if [ -n "${kvariant}" ] ; then
600
601     if [ -d %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} ] ; then
602       ksrc=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu}
603
604     elif [ -d %{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant} ] ; then
605       # Fedora 20 started putting kernel sources in e.g.
606       # 3.12.5-302.fc20.i686+PAE, instead of:
607       # 3.12.5-302.fc20.i686.PAE
608       ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:++$kvariant}
609
610     else
611       ksrc=%{_usrsrc}/kernels/%{kverrel}.%{_target_cpu}${kvariant:+.$kvariant}
612     fi
613
614     cp -R libafs_tree _kmod_build_${kvariant}
615     pushd _kmod_build_${kvariant}
616     ./configure --with-afs-sysname=${sysname} \
617         --prefix=%{_prefix} \
618         --libdir=%{_libdir} \
619         --bindir=%{_bindir} \
620         --sbindir=%{_sbindir} \
621         --with-linux-kernel-packaging \
622         --with-linux-kernel-headers=${ksrc} \
623 %if %{krb5support}
624         --with-krb5 \
625 %endif
626         $config_opts \
627         || exit 1
628     popd
629   fi
630 done
631 %endif
632
633 %if %{build_userspace}
634 # Build the user-space AFS stuff
635 make all_nolibafs
636 %endif
637
638 %if %{build_modules}
639 for kvariant in %{kvariants}
640 do
641   if [ -n "${kvariant}" ] ; then
642     pushd _kmod_build_$kvariant;
643     make all
644     popd
645   else
646     make libafs
647   fi
648 done
649 %endif
650
651
652 ##############################################################################
653 ###
654 ### install
655 ###
656 ##############################################################################
657 %install
658
659 export DONT_GPRINTIFY=1 # Do not modify initscripts.
660
661 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
662
663 ##############################################################################
664 ###
665 ### Install userspace
666 ###
667 ##############################################################################
668 %if %{build_userspace}
669
670 #-----------------------------------------------------------------------------
671 # Install userspace files
672 #-----------------------------------------------------------------------------
673 make install_nolibafs DESTDIR="$RPM_BUILD_ROOT"
674
675 # Set the executable bit on libraries in libdir, so rpmbuild knows to
676 # create "Provides" entries in the package metadata for the libraries
677 chmod +x $RPM_BUILD_ROOT%{_libdir}/*.so*
678
679 # Exclude duplicated files.
680 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/bos
681 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/fs
682 %if %{kauth_support}
683 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/kas
684 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/klog
685 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/klog.krb
686 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/kpwvalid
687 rm -f $RPM_BUILD_ROOT%{_sbindir}/kpwvalid
688 %endif
689 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/pts
690 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/tokens
691 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/tokens.krb
692 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/udebug
693 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/vos
694
695 # Exclude obsolete or unused files.
696 rm -f $RPM_BUILD_ROOT%{_bindir}/dlog
697 rm -f $RPM_BUILD_ROOT%{_bindir}/dpass
698 rm -f $RPM_BUILD_ROOT%{_bindir}/install
699 rm -f $RPM_BUILD_ROOT%{_bindir}/knfs
700 rm -f $RPM_BUILD_ROOT%{_bindir}/livesys
701 rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/kdb
702 rm -f $RPM_BUILD_ROOT%{_sbindir}/rmtsysd
703 rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
704 %if !%{build_authlibs}
705 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so*
706 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so*
707 rm -f $RPM_BUILD_ROOT%{_libdir}/libkopenafs.so*
708 %endif
709 rm -f $RPM_BUILD_ROOT%{_sbindir}/afsd.fuse
710
711 # Relocate afsd to legacy path to match init scripts.
712 mv $RPM_BUILD_ROOT%{_sbindir}/afsd $RPM_BUILD_ROOT%{_prefix}/vice/etc/afsd
713
714 # Relocate admin utilities to a modern path.
715 %if %{kauth_support}
716 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/kadb_check $RPM_BUILD_ROOT%{_sbindir}/kadb_check
717 %endif
718 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/prdb_check $RPM_BUILD_ROOT%{_sbindir}/prdb_check
719 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/vldb_check $RPM_BUILD_ROOT%{_sbindir}/vldb_check
720 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/vldb_convert $RPM_BUILD_ROOT%{_sbindir}/vldb_convert
721 %if %{krb5support}
722 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/akeyconvert $RPM_BUILD_ROOT%{_sbindir}/akeyconvert
723 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/asetkey $RPM_BUILD_ROOT%{_sbindir}/asetkey
724 %endif
725
726 %if %{kauth_support}
727 # Relocate PAM files to the standard PAM module path.
728 mkdir -p $RPM_BUILD_ROOT%{pamdir}
729 mv $RPM_BUILD_ROOT%{_libdir}/pam_afs.krb.so $RPM_BUILD_ROOT%{pamdir}
730 mv $RPM_BUILD_ROOT%{_libdir}/pam_afs.so $RPM_BUILD_ROOT%{pamdir}
731 ln -sf pam_afs.so $RPM_BUILD_ROOT%{pamdir}/pam_afs.so.1
732 ln -sf pam_afs.krb.so $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so.1
733
734 # Rename kpasswd to avoid conflicting with krb5 kpasswd.
735 mv $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
736 mv $RPM_BUILD_ROOT%{_mandir}/man1/kpasswd.1 $RPM_BUILD_ROOT%{_mandir}/man1/kapasswd.1
737 %endif
738
739 # Exclude obsolete or unused man pages.
740 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/afs_ftpd.1
741 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/afs_inetd.1
742 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/afs_login.1
743 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/afs_rcp.1
744 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/afs_rlogind.1
745 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/afs_rsh.1
746 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/dkload.1
747 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/knfs.1
748 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/package.1
749 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/runntp.1
750 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/symlink.1
751 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/symlink_list.1
752 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/symlink_make.1
753 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/symlink_remove.1
754 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/dlog.*
755 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/copyauth.*
756 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/dpass.*
757 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/livesys.*
758 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/rmtsysd.*
759 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/aklog_dynamic_auth.*
760 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/kdb.*
761 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/xfs_size_check.*
762 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/package_test.*
763 rm -f $RPM_BUILD_ROOT%{_mandir}/man5/package.*
764 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/package.*
765 %if !%{krb5support}
766 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/akeyconvert.*
767 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/asetkey.*
768 %endif
769
770 #-----------------------------------------------------------------------------
771 # Install client and server initscripts/systemd files
772 #-----------------------------------------------------------------------------
773 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
774 install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
775 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
776 mkdir -p $RPM_BUILD_ROOT%{initdir}
777 install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
778 install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
779 %else
780 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
781 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
782 install -m 644 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
783 install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
784 install -m 644 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
785 %endif
786
787 #-----------------------------------------------------------------------------
788 # Install server directories.
789 #-----------------------------------------------------------------------------
790 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
791 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/logs
792
793 #-----------------------------------------------------------------------------
794 # Install client directories and config files.
795 #-----------------------------------------------------------------------------
796 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/etc
797 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/cache
798 chmod 700 $RPM_BUILD_ROOT%{_prefix}/vice/cache
799 install -p -m 644 src/packaging/RedHat/openafs-ThisCell $RPM_BUILD_ROOT%{_prefix}/vice/etc/ThisCell
800 install -p -m 644 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/vice/etc/CellServDB.dist
801 install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $RPM_BUILD_ROOT%{_prefix}/vice/etc/cacheinfo
802
803 #-----------------------------------------------------------------------------
804 # Install DKMS source.
805 #-----------------------------------------------------------------------------
806 install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src
807 cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}
808
809 cat > $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}/dkms.conf <<"EOF"
810
811 PACKAGE_VERSION="%{dkms_version}"
812
813 # Items below here should not have to change with each driver version.
814 PACKAGE_NAME="%{name}"
815 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'
816 CLEAN="make -C src/libafs clean"
817
818 BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
819 DEST_MODULE_LOCATION[0]="/kernel/3rdparty/$PACKAGE_NAME/"
820 STRIP[0]=no
821 AUTOINSTALL=yes
822
823 EOF
824
825 #-----------------------------------------------------------------------------
826 # Install the kernel module source tree.
827 #-----------------------------------------------------------------------------
828 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
829 tar cf - -C libafs_tree . | \
830         tar xf - -C $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
831 install -m 644 LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
832 install -m 644 src/packaging/RedHat/openafs-LICENSE.Sun $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
833 install -m 644 src/packaging/RedHat/openafs-README $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
834
835 #-----------------------------------------------------------------------------
836 # Install documentation.
837 #-----------------------------------------------------------------------------
838 mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
839 tar cf - -C doc LICENSE html pdf | \
840     tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
841 install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
842 install -m 644 %{SOURCE11} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
843
844 #-----------------------------------------------------------------------------
845 # Install compatiblity links.
846 #-----------------------------------------------------------------------------
847 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afsws/bin
848 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afsws/etc
849 ln -sf %{_prefix}/bin/afsmonitor    $RPM_BUILD_ROOT%{_prefix}/afsws/bin/afsmonitor
850 ln -sf %{_prefix}/bin/bos           $RPM_BUILD_ROOT%{_prefix}/afsws/bin/bos
851 ln -sf %{_prefix}/bin/fs            $RPM_BUILD_ROOT%{_prefix}/afsws/bin/fs
852 %if %{kauth_support}
853 ln -sf %{_prefix}/bin/kapasswd      $RPM_BUILD_ROOT%{_prefix}/afsws/bin/kapasswd
854 ln -sf %{_prefix}/bin/klog          $RPM_BUILD_ROOT%{_prefix}/afsws/bin/klog
855 ln -sf %{_prefix}/bin/klog.krb      $RPM_BUILD_ROOT%{_prefix}/afsws/bin/klog.krb
856 %endif
857 ln -sf %{_prefix}/bin/pagsh         $RPM_BUILD_ROOT%{_prefix}/afsws/bin/pagsh
858 ln -sf %{_prefix}/bin/pagsh.krb     $RPM_BUILD_ROOT%{_prefix}/afsws/bin/pagsh.krb
859 ln -sf %{_prefix}/bin/pts           $RPM_BUILD_ROOT%{_prefix}/afsws/bin/pts
860 ln -sf %{_prefix}/bin/restorevol    $RPM_BUILD_ROOT%{_prefix}/afsws/bin/restorevol
861 ln -sf %{_prefix}/bin/scout         $RPM_BUILD_ROOT%{_prefix}/afsws/bin/scout
862 ln -sf %{_prefix}/bin/sys           $RPM_BUILD_ROOT%{_prefix}/afsws/bin/sys
863 ln -sf %{_prefix}/bin/tokens        $RPM_BUILD_ROOT%{_prefix}/afsws/bin/tokens
864 ln -sf %{_prefix}/bin/tokens.krb    $RPM_BUILD_ROOT%{_prefix}/afsws/bin/tokens.krb
865 ln -sf %{_prefix}/bin/translate_et  $RPM_BUILD_ROOT%{_prefix}/afsws/bin/translate_et
866 ln -sf %{_prefix}/bin/xstat_cm_test $RPM_BUILD_ROOT%{_prefix}/afsws/bin/xstat_cm_test
867 ln -sf %{_prefix}/bin/xstat_fs_test $RPM_BUILD_ROOT%{_prefix}/afsws/bin/xstat_fs_test
868 ln -sf %{_prefix}/bin/udebug        $RPM_BUILD_ROOT%{_prefix}/afsws/bin/udebug
869 ln -sf %{_prefix}/bin/unlog         $RPM_BUILD_ROOT%{_prefix}/afsws/bin/unlog
870 ln -sf %{_prefix}/sbin/backup       $RPM_BUILD_ROOT%{_prefix}/afsws/etc/backup
871 ln -sf %{_prefix}/sbin/butc         $RPM_BUILD_ROOT%{_prefix}/afsws/etc/butc
872 ln -sf %{_prefix}/sbin/fms          $RPM_BUILD_ROOT%{_prefix}/afsws/etc/fms
873 ln -sf %{_prefix}/sbin/fstrace      $RPM_BUILD_ROOT%{_prefix}/afsws/etc/fstrace
874 %if %{kauth_support}
875 ln -sf %{_prefix}/sbin/kas          $RPM_BUILD_ROOT%{_prefix}/afsws/etc/kas
876 %endif
877 ln -sf %{_prefix}/sbin/read_tape    $RPM_BUILD_ROOT%{_prefix}/afsws/etc/read_tape
878 ln -sf %{_prefix}/sbin/rxdebug      $RPM_BUILD_ROOT%{_prefix}/afsws/etc/rxdebug
879 ln -sf %{_prefix}/sbin/uss          $RPM_BUILD_ROOT%{_prefix}/afsws/etc/uss
880 ln -sf %{_prefix}/sbin/vos          $RPM_BUILD_ROOT%{_prefix}/afsws/etc/vos
881 ln -sf %{_prefix}/sbin/vsys         $RPM_BUILD_ROOT%{_prefix}/afsws/etc/vsys
882
883 %endif
884
885 ##############################################################################
886 ###
887 ### Install modules
888 ###
889 ##############################################################################
890 %if %{build_modules}
891
892 for kvariant in %{kvariants}
893 do
894   if [ -n "$kvariant" ] ; then
895     if [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP ] ; then
896       srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
897       dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
898     elif [ -d _kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP ] ; then
899       srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}+${kvariant}-SP
900       dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}+${kvariant}/extra/openafs
901     else
902       srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}.${kvariant}-SP
903       dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}.${kvariant}/extra/openafs
904     fi
905   else
906     if [ -d src/libafs/MODLOAD-%{kverrel}-SP ] ; then
907       srcdir=src/libafs/MODLOAD-%{kverrel}-SP
908       dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}/extra/openafs
909     else
910       srcdir=src/libafs/MODLOAD-%{kverrel}.%{_target_cpu}-SP
911       dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}.%{_target_cpu}/extra/openafs
912     fi
913   fi
914
915   mkdir -p ${dstdir}
916   install -m 755 ${srcdir}/openafs.ko ${dstdir}/openafs.ko
917 done
918 %endif
919
920 ##############################################################################
921 ###
922 ### clean
923 ###
924 ##############################################################################
925 %clean
926 [ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
927         rm -fr $RPM_BUILD_ROOT
928
929
930 ##############################################################################
931 ###
932 ### scripts
933 ###
934 ##############################################################################
935 %if %{build_userspace}
936
937 %pre compat
938 if [ -e %{_prefix}/afsws ]; then
939         /bin/rm -fr %{_prefix}/afsws
940 fi
941
942 %post client
943 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
944 chkconfig --add openafs-client
945 %else
946 if [ $1 -eq 1 ] ; then
947     # Initial installation
948     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
949 fi
950 %endif
951 if [ ! -d /afs ]; then
952         mkdir /afs
953         chown root.root /afs
954         chmod 0755 /afs
955         [ -x /sbin/restorecon ] && /sbin/restorecon /afs
956 fi
957
958 # Create the CellServDB
959 [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
960
961 ( cd /usr/vice/etc ; \
962   if [ -h CellServDB ]; then \
963     rm -f CellServDB; \
964   fi; \
965   cat CellServDB.local CellServDB.dist > CellServDB ; \
966   chmod 644 CellServDB )
967
968 %post server
969 #on an upgrade, don't enable if we were disabled
970 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
971 if [ $1 = 1 ] ; then
972   chkconfig --add openafs-server
973 fi
974 %{initdir}/openafs-server condrestart
975 %else
976 if [ $1 -eq 1 ] ; then
977     # Initial installation
978     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
979 fi
980 %endif
981
982 %if %{build_authlibs}
983 %post authlibs
984 /sbin/ldconfig
985
986 %postun authlibs
987 /sbin/ldconfig
988 %endif
989
990 %preun
991 if [ $1 = 0 ] ; then
992         [ -d /afs ] && rmdir /afs
993         :
994 fi
995
996 %preun client
997 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
998 if [ $1 = 0 ] ; then
999         %{initdir}/openafs-client stop
1000         chkconfig --del openafs-client
1001 fi
1002 %else
1003 if [ $1 -eq 0 ] ; then
1004         # Package removal, not upgrade
1005         /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
1006         /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
1007 fi
1008 %endif
1009
1010 %preun server
1011 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1012 if [ $1 = 0 ] ; then
1013         %{initdir}/openafs-server stop
1014         chkconfig --del openafs-server
1015 fi
1016 %else
1017 if [ $1 -eq 0 ] ; then
1018         /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
1019         /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
1020 fi
1021 %endif
1022
1023 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1024 %postun client
1025 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1026
1027 %postun server
1028 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
1029 %endif
1030
1031 %if %{build_dkmspkg}
1032 %post -n dkms-%{name}
1033 dkms add -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1034 dkms build -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1035 dkms install -m %{name} -v %{dkms_version} --rpm_safe_upgrade
1036
1037 %preun -n dkms-%{name}
1038 dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
1039 %endif
1040 %endif
1041
1042 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
1043 %triggerun -- openafs-client < 1.6.0-1
1044 # Save the current service runlevel info
1045 # User must manually run systemd-sysv-convert --apply httpd
1046 # to migrate them to systemd targets
1047 /usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
1048
1049 # Run this because the SysV package being removed won't do it
1050 /sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
1051
1052 %triggerun -- openafs-server < 1.6.0-1
1053 # Save the current service runlevel info
1054 # User must manually run systemd-sysv-convert --apply httpd
1055 # to migrate them to systemd targets
1056 /usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
1057
1058 # Run this because the SysV package being removed won't do it
1059 /sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
1060 %endif
1061
1062 ##############################################################################
1063 ###
1064 ### file lists
1065 ###
1066 ##############################################################################
1067 %if %{build_userspace}
1068
1069 %files
1070 %defattr(-,root,root)
1071 %config(noreplace) /etc/sysconfig/openafs
1072 %doc %{_docdir}/openafs-%{afsvers}/LICENSE
1073 %exclude %{_mandir}/man1/klog.krb5.*
1074 %{_bindir}/afsmonitor
1075 %{_bindir}/bos
1076 %{_bindir}/fs
1077 %if %{kauth_support}
1078 %{_bindir}/klog
1079 %{_bindir}/klog.krb
1080 %endif
1081 %{_bindir}/pagsh
1082 %{_bindir}/pagsh.krb
1083 %{_bindir}/pts
1084 %{_bindir}/restorevol
1085 %{_bindir}/scout
1086 %{_bindir}/sys
1087 %{_bindir}/tokens
1088 %{_bindir}/tokens.krb
1089 %{_bindir}/translate_et
1090 %{_bindir}/xstat_cm_test
1091 %{_bindir}/xstat_fs_test
1092 %{_bindir}/udebug
1093 %{_bindir}/unlog
1094 %{_sbindir}/backup
1095 %{_sbindir}/butc
1096 %{_sbindir}/fms
1097 %{_sbindir}/fstrace
1098 %if %{kauth_support}
1099 %{_sbindir}/kas
1100 %endif
1101 %{_sbindir}/read_tape
1102 %{_sbindir}/rxdebug
1103 %{_sbindir}/uss
1104 %{_sbindir}/vos
1105 %{_sbindir}/vsys
1106 %{_libdir}/libafshcrypto.so.*
1107 %{_libdir}/librokenafs.so.*
1108 %{_mandir}/man1/afs.*
1109 %{_mandir}/man1/afsmonitor.*
1110 %{_mandir}/man1/fs.*
1111 %{_mandir}/man1/fs_*.*
1112 %if %{kauth_support}
1113 %{_mandir}/man1/klog.*
1114 %endif
1115 %{_mandir}/man1/pagsh.*
1116 %{_mandir}/man1/pts.*
1117 %{_mandir}/man1/pts_*.*
1118 %{_mandir}/man1/restorevol.*
1119 %{_mandir}/man1/rxdebug.*
1120 %{_mandir}/man1/scout.*
1121 %{_mandir}/man1/sys.*
1122 %{_mandir}/man1/tokens.*
1123 %{_mandir}/man1/translate_et.*
1124 %{_mandir}/man1/udebug.*
1125 %{_mandir}/man1/unlog.*
1126 %{_mandir}/man1/vos.*
1127 %{_mandir}/man1/vos_*.*
1128 %{_mandir}/man1/xstat_cm_test.*
1129 %{_mandir}/man1/xstat_fs_test.*
1130 %{_mandir}/man5/CellServDB.*
1131 %{_mandir}/man5/ThisCell.*
1132 %{_mandir}/man5/afsmonitor.*
1133 %{_mandir}/man5/butc.*
1134 %{_mandir}/man5/butc_logs.*
1135 %{_mandir}/man5/uss.*
1136 %{_mandir}/man5/uss_bulk.*
1137 %{_mandir}/man8/backup.*
1138 %{_mandir}/man8/backup_*.*
1139 %{_mandir}/man8/bos.*
1140 %{_mandir}/man8/bos_*.*
1141 %{_mandir}/man8/bosserver.*
1142 %{_mandir}/man8/butc.*
1143 %{_mandir}/man8/dafssync-debug.*
1144 %{_mandir}/man8/dafssync-debug_*.*
1145 %{_mandir}/man8/fms.*
1146 %{_mandir}/man8/fssync-debug.*
1147 %{_mandir}/man8/fssync-debug_*.*
1148 %{_mandir}/man8/fstrace.*
1149 %{_mandir}/man8/fstrace_*.*
1150 %if %{kauth_support}
1151 %{_mandir}/man8/kas.*
1152 %{_mandir}/man8/kas_*.*
1153 %{_mandir}/man8/kaserver.*
1154 %endif
1155 %{_mandir}/man8/read_tape.*
1156 %{_mandir}/man8/uss.*
1157 %{_mandir}/man8/uss_*.*
1158
1159 %files docs
1160 %defattr(-,root,root)
1161 %docdir %{_docdir}/openafs-%{afsvers}
1162 %dir %{_docdir}/openafs-%{afsvers}
1163 %{_docdir}/openafs-%{afsvers}/ChangeLog
1164 %{_docdir}/openafs-%{afsvers}/RELNOTES-%{afsvers}
1165 %{_docdir}/openafs-%{afsvers}/pdf
1166
1167 %files client
1168 %defattr(-,root,root)
1169 %dir %{_prefix}/vice
1170 %dir %{_prefix}/vice/cache
1171 %dir %{_prefix}/vice/etc
1172 %dir %{_prefix}/vice/etc/C
1173 %{_prefix}/vice/etc/CellServDB.dist
1174 %config(noreplace) %{_prefix}/vice/etc/ThisCell
1175 %config(noreplace) %{_prefix}/vice/etc/cacheinfo
1176 %{_bindir}/afsio
1177 %{_bindir}/cmdebug
1178 %{_bindir}/up
1179 %{_prefix}/vice/etc/afsd
1180 %{_prefix}/vice/etc/C/afszcm.cat
1181 %{_libdir}/libuafs.a
1182 %{_libdir}/libuafs_pic.a
1183 %if %{kauth_support}
1184 %{pamdir}/pam_afs.krb.so.1
1185 %{pamdir}/pam_afs.krb.so
1186 %{pamdir}/pam_afs.so.1
1187 %{pamdir}/pam_afs.so
1188 %endif
1189 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1190 %{initdir}/openafs-client
1191 %else
1192 %{_unitdir}/openafs-client.service
1193 %{_sysconfdir}/sysconfig/modules/openafs-client.modules
1194 %endif
1195 %{_mandir}/man1/cmdebug.*
1196 %{_mandir}/man1/up.*
1197 %{_mandir}/man3/AFS::ukernel.*
1198 %{_mandir}/man5/afs.5.gz
1199 %{_mandir}/man5/afs_cache.5.gz
1200 %{_mandir}/man5/afs_volume_header.5.gz
1201 %{_mandir}/man5/afszcm.cat.5.gz
1202 %{_mandir}/man5/cacheinfo.*
1203 %{_mandir}/man8/afsd.*
1204 %{_mandir}/man8/vsys.*
1205 %{_mandir}/man5/CellAlias.*
1206
1207 %files server
1208 %defattr(-,root,root)
1209 %dir %{_prefix}/afs
1210 %dir %{_prefix}/afs/bin
1211 %dir %{_prefix}/afs/etc
1212 %dir %{_prefix}/afs/logs
1213 %{_prefix}/afs/bin/bosserver
1214 %{_prefix}/afs/bin/bos_util
1215 %{_prefix}/afs/bin/buserver
1216 %{_prefix}/afs/bin/dafileserver
1217 %{_prefix}/afs/bin/dafssync-debug
1218 %{_prefix}/afs/bin/dasalvager
1219 %{_prefix}/afs/bin/davolserver
1220 %{_prefix}/afs/bin/fileserver
1221 %{_prefix}/afs/bin/fssync-debug
1222 %if %{kauth_support}
1223 %{_prefix}/afs/bin/kaserver
1224 %{_prefix}/afs/bin/ka-forwarder
1225 %endif
1226 %{_prefix}/afs/bin/pt_util
1227 %{_prefix}/afs/bin/ptserver
1228 %{_prefix}/afs/bin/salvager
1229 %{_prefix}/afs/bin/salvageserver
1230 %{_prefix}/afs/bin/salvsync-debug
1231 %{_prefix}/afs/bin/state_analyzer
1232 %{_prefix}/afs/bin/upclient
1233 %{_prefix}/afs/bin/upserver
1234 %{_prefix}/afs/bin/vlserver
1235 %{_prefix}/afs/bin/volinfo
1236 %{_prefix}/afs/bin/volscan
1237 %{_prefix}/afs/bin/volserver
1238 %if %{kauth_support}
1239 %{_sbindir}/kadb_check
1240 %endif
1241 %{_sbindir}/prdb_check
1242 %{_sbindir}/vldb_check
1243 %{_sbindir}/vldb_convert
1244 %{_sbindir}/voldump
1245 %if 0%{?fedora} < 15 && 0%{?rhel} < 7
1246 %{initdir}/openafs-server
1247 %else
1248 %{_unitdir}/openafs-server.service
1249 %endif
1250 %{_mandir}/man5/AuthLog.*
1251 %{_mandir}/man5/BackupLog.*
1252 %{_mandir}/man5/BosConfig.*
1253 %{_mandir}/man5/BosLog.*
1254 %{_mandir}/man5/FORCESALVAGE.*
1255 %{_mandir}/man5/FileLog.*
1256 %{_mandir}/man5/KeyFile.*
1257 %{_mandir}/man5/KeyFileExt.*
1258 %{_mandir}/man5/NetInfo.*
1259 %{_mandir}/man5/NetRestrict.*
1260 %{_mandir}/man5/NoAuth.*
1261 %{_mandir}/man5/PtLog.*
1262 %{_mandir}/man5/SALVAGE.fs.*
1263 %{_mandir}/man5/SalvageLog.*
1264 %{_mandir}/man5/sysid.*
1265 %{_mandir}/man5/UserList.*
1266 %{_mandir}/man5/VLLog.*
1267 %{_mandir}/man5/VolserLog.*
1268 %{_mandir}/man5/bdb.DB0.*
1269 %{_mandir}/man5/fms.log.*
1270 %if %{kauth_support}
1271 %{_mandir}/man5/kaserver.DB0.*
1272 %{_mandir}/man5/kaserverauxdb.*
1273 %endif
1274 %{_mandir}/man5/krb.conf.*
1275 %{_mandir}/man5/krb.excl.*
1276 %{_mandir}/man5/prdb.DB0.*
1277 %{_mandir}/man5/salvage.lock.*
1278 %{_mandir}/man5/tapeconfig.*
1279 %{_mandir}/man5/vldb.DB0.*
1280 %{_mandir}/man8/buserver.*
1281 %{_mandir}/man8/fileserver.*
1282 %{_mandir}/man8/dafileserver.*
1283 %{_mandir}/man8/dasalvager.*
1284 %{_mandir}/man8/davolserver.*
1285 %if %{kauth_support}
1286 %{_mandir}/man8/kadb_check.*
1287 %{_mandir}/man8/ka-forwarder.*
1288 %endif
1289 %{_mandir}/man8/prdb_check.*
1290 %{_mandir}/man8/ptserver.*
1291 %{_mandir}/man8/pt_util.*
1292 %{_mandir}/man8/salvager.*
1293 %{_mandir}/man8/salvageserver.*
1294 %{_mandir}/man8/state_analyzer.*
1295 %{_mandir}/man8/upclient.*
1296 %{_mandir}/man8/upserver.*
1297 %{_mandir}/man8/vldb_check.*
1298 %{_mandir}/man8/vldb_convert.*
1299 %{_mandir}/man8/vlserver.*
1300 %{_mandir}/man8/voldump.*
1301 %{_mandir}/man8/volinfo.*
1302 %{_mandir}/man8/volscan.*
1303 %{_mandir}/man8/volserver.*
1304
1305 %if %{build_authlibs}
1306 %files authlibs
1307 %defattr(-,root,root)
1308 %{_libdir}/libafsauthent.so.*
1309 %{_libdir}/libafsrpc.so.*
1310 %{_libdir}/libkopenafs.so.*
1311 %endif
1312
1313 %files authlibs-devel
1314 %defattr(-,root,root)
1315 %{_includedir}/kopenafs.h
1316 %{_libdir}/libafsauthent.a
1317 %{_libdir}/libafscp.a
1318 %{_libdir}/libafsrpc.a
1319 %{_libdir}/libafsauthent_pic.a
1320 %{_libdir}/libafsrpc_pic.a
1321 %{_libdir}/libkopenafs.a
1322 %if %{build_authlibs}
1323 %{_libdir}/libafsauthent.so
1324 %{_libdir}/libafsrpc.so
1325 %{_libdir}/libkopenafs.so
1326 %endif
1327
1328 %files devel
1329 %defattr(-,root,root)
1330 %{_bindir}/afs_compile_et
1331 %{_bindir}/rxgen
1332 %{_includedir}/afs
1333 %{_includedir}/lock.h
1334 %{_includedir}/lwp.h
1335 %{_includedir}/rx
1336 %{_includedir}/timer.h
1337 %{_includedir}/ubik.h
1338 %{_includedir}/ubik_int.h
1339 %{_includedir}/opr/queue.h
1340 %{_libdir}/afs
1341 %{_libdir}/libafshcrypto.a
1342 %{_libdir}/libafshcrypto.so
1343 %{_libdir}/libafsrfc3961.a
1344 %{_libdir}/liblwp.a
1345 %{_libdir}/libopr.a
1346 %{_libdir}/librokenafs.a
1347 %{_libdir}/librokenafs.so
1348 %{_libdir}/librx.a
1349 %{_libdir}/librxkad.a
1350 %{_libdir}/librxstat.a
1351 %{_libdir}/libubik.a
1352 %{_mandir}/man1/rxgen.*
1353 %{_mandir}/man1/afs_compile_et.*
1354
1355 %if %{build_dkmspkg}
1356 %files -n dkms-%{name}
1357 %defattr(-,root,root)
1358 %{_prefix}/src/%{name}-%{dkms_version}
1359 %endif
1360
1361 %files kernel-source
1362 %defattr(-,root,root)
1363 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1364 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1365 %{_prefix}/src/openafs-kernel-%{afsvers}/README
1366 %{_prefix}/src/openafs-kernel-%{afsvers}/src
1367
1368 %files compat
1369 %defattr(-,root,root)
1370 %{_prefix}/afsws
1371
1372 %if %{kauth_support}
1373 %files kpasswd
1374 %defattr(-,root,root)
1375 %{_bindir}/kapasswd
1376 %{_bindir}/kpwvalid
1377 %{_mandir}/man1/kapasswd.*
1378 %{_mandir}/man8/kpwvalid.*
1379 %endif
1380
1381 %if %{krb5support}
1382 %files krb5
1383 %defattr(-,root,root)
1384 %{_bindir}/aklog
1385 %{_bindir}/klog.krb5
1386 %{_sbindir}/akeyconvert
1387 %{_sbindir}/asetkey
1388 %{_mandir}/man1/aklog.*
1389 %{_mandir}/man1/klog.krb5.*
1390 %{_mandir}/man8/akeyconvert.*
1391 %{_mandir}/man8/asetkey.*
1392 %endif
1393
1394 %endif
1395 ##############################################################################
1396 ###
1397 ### openafs.spec change log
1398 ###
1399 ##############################################################################
1400 %changelog
1401 * Wed Dec 12 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1402 - Make the RPM mockable
1403
1404 * Mon Oct 29 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1405 - Update to match the shipped 1.4.5 RPMS
1406 - Fix the kvariant stuff to only configure the 'standard' case once
1407 - Add openafs-kvers.sh back in
1408
1409 * Wed Oct 10 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
1410 - Use Fedora style kmods, which allows us to install multiple kernel types
1411
1412 * Thu Jun 07 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.4-3
1413 - Use distributed files, rather than those in packager's SOURCE directory
1414 - Remove SuidCells stuff, which was unused
1415
1416 * Fri Dec 01 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-2
1417 - integrate s390x changes
1418 - allow for building libafs*.a and not libafs*.so into packages, for platforms
1419   that won't build the .so files.
1420
1421 * Wed Aug 23 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-1
1422 - update to 1.4.2
1423 - use installed aklog manpage.
1424 - moduleparam patch obsoleted.
1425
1426 * Tue Aug 22 2006  Derek Atkins <warlord@MIT.EDU> 1.4.2-0.1.rc1
1427 - update to 1.4.2-rc1
1428 - hand-apply lee damon's changes to support largesmp kernels from RHEL4
1429   (but only add support for 2.6 kernels.  No need for the 2.4 kernels).
1430 - don't need the posixlock patch anymore.
1431
1432 * Wed Jul 12 2006  Derek Atkins <warlord@MIT.EDU> 1.4.2-0.beta2
1433 - update to 1.4.2-beta2
1434 - add linux2.4 posixlock API patch
1435
1436 * Mon Jun 26 2006  Derek Atkins <warlord@MIT.EDU>
1437 - moduleparam and krb524 patches no longer required in OA-CVS
1438
1439 * Wed May 17 2006  Derek Atkins <warlord@MIT.EDU>
1440 - change non-target-cpu kernel dep to a file dep
1441 - make sure we use the proper kernel version for the dependency.
1442
1443 * Tue May 16 2006  Derek Atkins <warlord@MIT.EDU>
1444 - allow users to specify local CellServDB and SuidCells entries
1445   don't overwrite user's changes.  Provide a .dist an let users
1446   make entries in a ".local"
1447 - build the CellServDB and SuidCells at client startup and at
1448   client install-time
1449 - add provideskernelarch functionality to openafs-kvers-is.sh
1450 - use that functionality to Require kernel{,-<type>}-targetcpu
1451   to get better package safety due to RPM bugs where the kernel
1452   release isn't used so you can install the kernel module against
1453   any kernel of the same major version.
1454
1455 * Mon May 15 2006  Derek Atkins <warlord@MIT.EDU>
1456 - update the README in openafs-kernel-source
1457 - fix openafs-kvers-is.sh from Alexander Bergolth's patch.
1458 - move kernel module from .../kernel/fs/openafs to .../fs/openafs/
1459
1460 * Fri Apr 21 2006  Derek Atkins <warlord@MIT.EDU>
1461 - build requires autoconf and automake for krb5support
1462   and autoconf for standard package
1463 - dont setup the krb5 migration kit (or patches) if we don't care.
1464 - require ncurses-devel to build
1465
1466 * Wed Apr 19 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-3
1467 - look for krb524 functions in libkrb524 if we can't find them
1468   in the standard locations.
1469
1470 * Tue Apr 18 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-2
1471 - fix the module_param_array macro for Linux 2.6.9.
1472
1473 * Sat Apr 15 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-1
1474 - update to 1.4.1 release.
1475 - distribute asetkey from openafs instead of krb5-migration kit
1476 - don't need to apply the FC5 patches because they are part of the distro.
1477 - install asetkey into the "proper" place
1478 - dont list a manpage twice.
1479 - package asetkey man page.  delete it when not needed.
1480
1481 * Thu Apr  6 2006  Derek Atkins <warlord@MIT.EDU>
1482 - turn authlibs back on, because RT #18767 was applied to CVS.
1483
1484 * Wed Mar 29 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1rc10-1
1485 - update to 1.4.1rc10, build on FC5
1486 - fix the man pages (distribute into various packages)
1487 - include patches for FC5, RT #29112 and #29122
1488
1489 * Mon Dec 19 2005  Derek Atkins <warlord@MIT.EDU>
1490 - openafs-server shouldn't depend on the kernel module.
1491
1492 * Thu Nov 17 2005  Derek Atkins <warlord@MIT.EDU>
1493 - patch from Mike Polek <mike at pictage.com> to run depmod for
1494   the target kernel and not the running kernel.
1495
1496 * Tue Nov  8 2005  Derek Atkins <warlord@MIT.EDU>
1497 - build aklog from the openafs sources, not from the krb5 migration kit.
1498
1499 * Fri Nov  4 2005  Derek Atkins <warlord@MIT.EDU>
1500 - set openafs-kernel-source to Provide openafs-kernel
1501
1502 * Thu Oct 20 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0-1
1503 - update afs-krb5 res_search patch: look for res_search and __res_search
1504 - update to 1.4.0 final
1505
1506 * Mon Oct 10 2005  Derek Atkins <warlord@MIT.EDU>
1507 - remove all kdump builds.
1508
1509 * Thu Oct  6 2005  Derek Atkins <warlord@MIT.EDU>
1510 - fix openafs-kernel-version.sh so it will build an RPM for the
1511   currently-running kernel even if it's smp on 2.6.
1512
1513 * Tue Sep 27 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc5-1
1514 - upgrade to 1.4.0rc5
1515 - turn off authlibs packages
1516
1517 * Fri Sep 23 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-2
1518 - add kmodule26 patch: fix the kernel module name on 2.6 kernels so
1519   it's called "openafs" and not "libafs".  This fixes the shutdown
1520   problem.
1521
1522 * Thu Sep 22 2005  Derek Atkins <warlord@MIT.EDU>
1523 - update kversis script, add 'kvers' operation
1524 - fix bug that 2.6 smp/hugemem kernels don't provide
1525   kernel-foo = %{kernvers} with 'smp', 'hugemem', etc.
1526 - add patch to remove res_search from the afs-krb5 configure
1527
1528 * Thu Sep 15 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-1
1529 - Update to 1.4.0rc4
1530 - Update the afs-krb5 krb524 patch so it actually works on
1531   some older systems like RHEL3 that still need -lkrb524.
1532 - Update the buildall script so choose better architecture support,
1533   e.g. don't build i586 on RHEL.
1534 - Update the rebuild information in the SPEC file.
1535 - Add support for finding .EL kernels in openafs-kvers-is.sh
1536 - Add additional error messages when kernel version/type parsing fails.
1537 - Update the buildall script to use the kernel srcdir directly.
1538
1539 * Wed Sep 14 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-2
1540 - Add "hugemem" to 2.4 configs
1541 - Add checks to support scripts to determine whether to build
1542   the bigmem and/or hugemem kernels for 2.4.
1543
1544 * Mon Sep 12 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-1
1545 - Added some afs-krb5 patches to get the migration kit to build
1546   on modern AFS and modern Kerberos.
1547 - Added authlibs and authlibs-devel packages as per UMich changes.
1548
1549 * Sun Sep 11 2005  Derek Atkins <warlord@MIT.EDU>
1550 - Merged in some of the 2.6 changes from wingc@engin.umich.edu
1551
1552 * Sat Sep 10 2005  Derek Atkins <warlord@MIT.EDU>
1553 - Merged in lots of changes from David Howells and Nalin Dahyabhai
1554   from Red Hat.   Initial attempt at a release of 1.4.  Still need
1555   to work in a 2.6 build system.