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