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