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