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