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