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