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