redhat-packaging-updates-20071112
[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 %if %{build_modules}
812        --with-linux-kernel-headers=%{ksrc} \
813 %endif
814 %if %{krb5support}
815         --with-krb5-conf \
816 %endif
817        $config_opts \
818        || exit 1
819
820 # Build the libafs tree
821 make only_libafs_tree || exit 1
822
823 # Configure each of our kernel modules
824
825 %if %{fedorakmod} && %{build_modules}
826 for kvariant in %{kvariants} ; do
827   if [ -n "${kvariant}" ] ; then
828     cp -R libafs_tree _kmod_build_${kvariant}
829     pushd _kmod_build_${kvariant}
830     ./configure --with-afs-sysname=${sysname} \
831         --prefix=%{_prefix} \
832         --libdir=%{_libdir} \
833         --bindir=%{_bindir} \
834         --sbindir=%{_sbindir} \
835         --with-linux-kernel-headers=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} \
836 %if %{krb5support}
837         --with-krb5-conf \
838 %endif
839         $config_opts \
840         || exit 1
841     popd
842   fi
843 done
844 %endif
845
846 %if %{build_userspace}
847 # Build the user-space AFS stuff
848 make dest_nolibafs || exit 1
849 %endif
850
851 %if %{build_modules}
852 %if %{fedorakmod}
853 for kvariant in %{kvariants}
854 do
855   if [ -n "${kvariant}" ] ; then
856     pushd _kmod_build_$kvariant;
857     make all MPS=SP
858     popd
859   else
860     make dest_only_libafs MPS=SP
861   fi
862 done
863
864 %else
865 # Begin legacy kernel module building code
866
867 %if %{kvers_is_24}
868 # Build all the kernel modules for linux 2.4.x
869 for variation in %{kvariations}
870 do
871     if [ ${variation} = up ]
872     then
873        local_smp_def=-DREDHAT_FIX
874        suffix=
875     else
876        local_smp_def="-DAFS_SMP -DREDHAT_FIX"
877        suffix=${variation}
878     fi
879
880     PrintRedhatKernelFix %{_target_cpu} $variation src/config/redhat-fix.h
881     make dest_only_libafs LOCAL_SMP_DEF="${local_smp_def}" \
882         LINUX_MODULE_NAME="${suffix}" MPS=SP
883
884 done
885 rm -f src/config/redhat-fix.h
886
887 %elseif %{kvers_is_26}
888 # Build the kernel module for this version of linux 2.6.x
889 # Notice how much easier this is than 2.4.  On the other hand,
890 # we require much more external support to build multiple modules.
891
892   # the MPS=SP just means that we don't add a '.mp' to the name.
893   make dest_only_libafs MPS=SP
894
895 %endif
896 # End legacy kernel module building code
897 %endif
898 %endif
899
900
901 ##############################################################################
902 #
903 # installation
904 #
905 ##############################################################################
906 %install
907
908 export DONT_GPRINTIFY=1
909
910 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
911
912 case %{kernvers} in
913    2.4.*)
914        kv='24'
915        kmodend=.o
916        ;;
917    2.6.*)
918        kv='26'
919        kmodend=.ko
920        ;;
921    *)
922        echo "I don't know how to build linux-`expr ${kernvers} : \(^[0-9]*[.][0-9]*\)`"
923        exit 1
924        ;;
925 esac
926
927 case %{_arch} in
928        x86_64)                         sysname=amd64_linux${kv}        ;;
929        alpha*)                         sysname=alpha_linux_${kv}       ;;
930        i386|i486|i586|i686|athlon)     sysname=i386_linux${kv}         ;;
931        *)                              sysname=%{_arch}_linux${kv}     ;;
932 esac
933
934 # Build install tree
935 %if %{build_userspace}
936 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
937 mkdir -p $RPM_BUILD_ROOT%{_libdir}
938 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
939 mkdir -p $RPM_BUILD_ROOT%{initdir}
940 mkdir -p $RPM_BUILD_ROOT/etc/openafs
941 mkdir -p $RPM_BUILD_ROOT%{pamdir}
942 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
943 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/logs
944 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/etc
945 mkdir -p $RPM_BUILD_ROOT%{_prefix}/vice/cache
946 chmod 700 $RPM_BUILD_ROOT%{_prefix}/vice/cache
947 mkdir -p $RPM_BUILD_ROOT%{_mandir}
948
949 # Copy files from dest to the appropriate places in BuildRoot
950 tar cf - -C ${sysname}/dest bin include | tar xf - -C $RPM_BUILD_ROOT%{_prefix}
951 tar cf - -C ${sysname}/dest/lib . | tar xf - -C $RPM_BUILD_ROOT%{_libdir}
952 tar cf - -C ${sysname}/dest/etc . | tar xf - -C $RPM_BUILD_ROOT%{_sbindir}
953 tar cf - -C ${sysname}/dest/root.server%{_prefix}/afs bin | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/afs
954 tar cf - -C ${sysname}/dest/root.client%{_prefix}/vice/etc afsd | tar xf - -C $RPM_BUILD_ROOT%{_prefix}/vice/etc
955
956 # Link kpasswd to kapasswd
957 ln -f $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
958
959 # Copy root.client config files
960 install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
961 install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
962 install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
963
964 # Copy PAM modules
965 install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
966
967 # PAM symlinks
968 ln -sf pam_afs.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.so
969 ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT%{pamdir}/pam_afs.krb.so
970
971 # Populate /usr/vice/etc
972 uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
973 install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
974 install -p -m 644 %{SOURCE20} $uve/CellServDB.dist
975 install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
976
977 #
978 # install kernel-source
979 #
980
981 # Install the kernel module source tree
982 mkdir -p $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
983 tar cf - -C libafs_tree . | \
984         tar xf - -C $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/src
985
986 # Next, copy the LICENSE Files, README
987 install -m 644 src/LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
988 install -m 644 src/packaging/RedHat/openafs-LICENSE.Sun $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
989 install -m 644 src/packaging/RedHat/openafs-README $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
990
991 #
992 # Install DOCUMENTATION
993 #
994
995 # Build the DOC directory
996 mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
997 tar cf - -C doc LICENSE html pdf | \
998     tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
999 install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1000 install -m 644 %{SOURCE11} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
1001
1002 #
1003 # man pages
1004 #
1005 tar cf - -C doc/man-pages man1 man5 man8 | \
1006     tar xf - -C $RPM_BUILD_ROOT%{_mandir}
1007
1008 # Copy the uninstalled krb5 files (or delete the unused krb5 files)
1009 %if %{krb5support}
1010 mv $RPM_BUILD_ROOT%{_prefix}/afs/bin/asetkey $RPM_BUILD_ROOT%{_sbindir}/asetkey
1011 %else
1012 rm -f $RPM_BUILD_ROOT%{_mandir}/man8/asetkey.*
1013 %endif
1014
1015 # remove unused man pages
1016 for x in afs_ftpd afs_inetd afs_login afs_rcp afs_rlogind afs_rsh \
1017     dkload knfs package runntp; do
1018         rm -f $RPM_BUILD_ROOT%{_mandir}/man1/${x}.1
1019 done
1020
1021 # rename kpasswd to kapasswd
1022 mv $RPM_BUILD_ROOT%{_mandir}/man1/kpasswd.1 $RPM_BUILD_ROOT%{_mandir}/man1/kapasswd.1
1023
1024 # gzip man pages
1025 gzip -9 $RPM_BUILD_ROOT%{_mandir}/man*/*
1026
1027 # create list of man pages that go in the 'openafs' package
1028 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man1 \
1029         |egrep '^afs|^fs|^kas|^klog|kapasswd|pagsh|^pts|^rxdebug|scout|^sys|tokens|translate|udebug|unlog|^uss|^vos' \
1030         >openafs-man1files
1031
1032 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man5 \
1033         |egrep 'CellServDB|ThisCell|afsmonitor|^butc|^uss' \
1034         >openafs-man5files
1035
1036 /bin/ls $RPM_BUILD_ROOT%{_mandir}/man8 \
1037         |egrep '^backup|^bos|^butc|^fms|^fstrace|^kas|^uss' \
1038         >openafs-man8files
1039
1040 #
1041 # create filelist
1042 #
1043 grep -v "^#" >openafs-file-list <<EOF-openafs-file-list
1044 %{_bindir}/afsmonitor
1045 %{_bindir}/bos
1046 %{_bindir}/fs
1047 %{_bindir}/kapasswd
1048 %{_bindir}/kpasswd
1049 %{_bindir}/klog
1050 %{_bindir}/klog.krb
1051 %{_bindir}/pagsh
1052 %{_bindir}/pagsh.krb
1053 %{_bindir}/pts
1054 %{_bindir}/scout
1055 %{_bindir}/sys
1056 %{_bindir}/tokens
1057 %{_bindir}/tokens.krb
1058 %{_bindir}/translate_et
1059 %{_bindir}/udebug
1060 %{_bindir}/unlog
1061 %{_sbindir}/backup
1062 %{_sbindir}/butc
1063 %{_sbindir}/copyauth
1064 %{_sbindir}/fms
1065 %{_sbindir}/fstrace
1066 %{_sbindir}/kas
1067 %{_sbindir}/read_tape
1068 %{_sbindir}/restorevol
1069 %{_sbindir}/rxdebug
1070 %{_sbindir}/uss
1071 %{_sbindir}/vos
1072 %{_sbindir}/vsys
1073 EOF-openafs-file-list
1074
1075 # add man pages to the list
1076 cat openafs-man1files \
1077         | ( while read x; do echo "%{_mandir}/man1/$x"; done ) \
1078         >>openafs-file-list
1079 cat openafs-man5files \
1080         | ( while read x; do echo "%{_mandir}/man5/$x"; done ) \
1081         >>openafs-file-list
1082 cat openafs-man8files \
1083         | ( while read x; do echo "%{_mandir}/man8/$x"; done ) \
1084         >>openafs-file-list
1085
1086 #
1087 # Install compatiblity links
1088 #
1089 for d in bin:bin etc:sbin; do
1090   olddir=`echo $d | sed 's/:.*$//'`
1091   newdir=`echo $d | sed 's/^.*://'`
1092   mkdir -p $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir
1093   for f in `cat openafs-file-list`; do
1094     if echo $f | grep -q /$newdir/; then
1095       fb=`basename $f`
1096       ln -sf %{_prefix}/$newdir/$fb $RPM_BUILD_ROOT%{_prefix}/afsws/$olddir/$fb
1097     fi
1098   done
1099 done
1100
1101 #
1102 # Remove files we're not installing
1103 #
1104
1105 # remove duplicated files from /usr/afs/bin
1106 for f in bos fs kas klog klog.krb kpwvalid pts tokens tokens.krb udebug vos ; do
1107   rm -f $RPM_BUILD_ROOT%{_prefix}/afs/bin/$f
1108 done
1109
1110 # compile_et is duplicated in e2fsprogs
1111 # the rest are not needed.
1112 for f in compile_et dlog dpass install knfs livesys xstat_cm_test xstat_fs_test ; do
1113   rm -f $RPM_BUILD_ROOT%{_bindir}/$f
1114 done
1115
1116 # not supported on Linux or duplicated
1117 for f in kdb rmtsysd kpwvalid ; do
1118   rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
1119 done
1120 # sometimes install sucks and puts down a directory. kill it all.
1121 rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
1122
1123 # remove man pages from programs deleted above
1124 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
1125   rm -f $RPM_BUILD_ROOT%{_mandir}/man$f.*
1126 done
1127
1128 # PAM modules are doubly-installed  Remove the version we don't need
1129 for f in pam_afs.krb.so.1 pam_afs.so.1 ; do
1130   rm -f $RPM_BUILD_ROOT%{_libdir}/$f
1131 done
1132
1133 # Remove empty files from the krb5 migration
1134 for f in afs2k5db fakeka ; do
1135   rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
1136 done
1137
1138 %if !%{build_authlibs}
1139 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
1140 rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
1141 %endif
1142
1143 %endif
1144
1145 %if %{build_modules}
1146 %if %{fedorakmod}
1147 for kvariant in %{kvariants}
1148 do
1149   if [ -n "$kvariant" ] ; then
1150     srcdir=_kmod_build_$kvariant/src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
1151   else
1152     srcdir=${sysname}/dest/root.client%{_prefix}/vice/etc/modload
1153   fi
1154
1155   dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
1156   mkdir -p ${dstdir}
1157   install -m 744 ${srcdir}/libafs-%{kverrel}${kvariant}.ko $dstdir/openafs.ko
1158 done
1159 %else
1160 # Install the kernel modules
1161 for variation in %{kvariations}
1162 do
1163     if [ ${variation} = up ]
1164     then
1165        kvar=%{kxmoddir}
1166        modname=libafs-%{kernvers}${kmodend}
1167     else
1168        kvar=%{kxmoddir}${variation}
1169        modname=libafs-%{kernvers}${variation}${kmodend}
1170     fi
1171
1172     srcdir=${sysname}/dest/root.client%{_prefix}/vice/etc/modload
1173     dstdir=$RPM_BUILD_ROOT${kvar}/fs/openafs
1174
1175     mkdir -p ${dstdir}
1176
1177     # Mark kernel modules as executable; otherwise they won't get stripped 
1178     # by /usr/lib/rpm/brp-strip
1179     install -m 644 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
1180 done
1181 %endif
1182 %endif
1183
1184 ##############################################################################
1185 ###
1186 ### clean
1187 ###
1188 ##############################################################################
1189 %clean
1190 rm -f openafs-file-list
1191 [ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
1192         rm -fr $RPM_BUILD_ROOT
1193
1194
1195 ##############################################################################
1196 ###
1197 ### scripts
1198 ###
1199 ##############################################################################
1200 %if %{build_userspace}
1201
1202 %pre compat
1203 if [ -e %{_prefix}/afsws ]; then
1204         /bin/rm -fr %{_prefix}/afsws
1205 fi
1206
1207 %post client
1208 chkconfig --add openafs-client
1209 if [ ! -d /afs ]; then
1210         mkdir /afs
1211         chown root.root /afs
1212         chmod 0755 /afs
1213 fi
1214
1215 # Create the CellServDB
1216 [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
1217
1218 ( cd /usr/vice/etc ; \
1219   cat CellServDB.local CellServDB.dist > CellServDB ; \
1220   chmod 644 CellServDB )
1221
1222 echo
1223 echo The AFS cache is configured for 100 MB. Edit the
1224 echo /usr/vice/etc/cacheinfo file to change this before
1225 echo running AFS for the first time. You should also
1226 echo set your home cell in /usr/vice/etc/ThisCell.
1227 echo
1228 echo Also, you may want to edit /etc/pam.d/login and
1229 echo possibly others there to get an AFS token on login.
1230 echo Put the line:
1231 echo 
1232 echo    auth       sufficient   %{pamdir}/pam_afs.so try_first_pass ignore_root
1233 echo
1234 echo before the one for pwdb.
1235 echo
1236
1237 %post server
1238 chkconfig --add openafs-server
1239 %{initdir}/openafs-server condrestart
1240
1241 %if %{build_authlibs}
1242 %post authlibs
1243 /sbin/ldconfig
1244
1245 %postun authlibs
1246 /sbin/ldconfig
1247 %endif
1248
1249 %preun
1250 if [ $1 = 0 ] ; then
1251         [ -d /afs ] && rmdir /afs
1252 fi
1253
1254 %preun client
1255 if [ $1 = 0 ] ; then
1256         %{initdir}/openafs-client stop
1257         chkconfig --del openafs-client
1258 fi
1259
1260 %preun server
1261 if [ $1 = 0 ] ; then
1262         %{initdir}/openafs-server stop
1263         chkconfig --del openafs-server
1264 fi
1265
1266 %endif
1267
1268 %if %{build_modules}
1269 %if !%{fedorakmod}
1270 %if %{up_package}
1271 %post kernel
1272 /sbin/depmod -ae %{kernvers}
1273
1274 %postun kernel
1275 /sbin/depmod -ae %{kernvers}
1276
1277 %endif
1278
1279 %if %{smp_package}
1280 %post kernel-smp
1281 /sbin/depmod -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1282
1283 %postun kernel-smp
1284 /sbin/depmod -ae %{kernvers}%{?smp_ext:%{smp_ext}}
1285 %endif
1286
1287 %if %{largesmp_package}
1288 %post kernel-largesmp
1289 /sbin/depmod -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1290
1291 %postun kernel-largesmp
1292 /sbin/depmod -ae %{kernvers}%{?largesmp_ext:%{largesmp_ext}}
1293 %endif
1294  
1295 %if %{bigmem_package}
1296 %post kernel-bigmem
1297 /sbin/depmod -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1298
1299 %postun kernel-bigmem
1300 /sbin/depmod -ae %{kernvers}%{?bigmem_ext:%{bigmem_ext}}
1301 %endif
1302
1303 %if %{hugemem_package}
1304 %post kernel-hugemem
1305 /sbin/depmod -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1306
1307 %postun kernel-hugemem
1308 /sbin/depmod -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
1309 %endif
1310 %endif
1311 %endif
1312
1313
1314 ##############################################################################
1315 ###
1316 ### file lists
1317 ###
1318 ##############################################################################
1319 %if %{build_userspace}
1320
1321 %files -f openafs-file-list
1322 %defattr(-,root,root)
1323 %config /etc/sysconfig/openafs
1324 %doc %{_docdir}/openafs-%{afsvers}/LICENSE
1325
1326 %files docs
1327 %defattr(-,root,root)
1328 %doc %{_docdir}/openafs-%{afsvers}
1329
1330 %files client
1331 %defattr(-,root,root)
1332 %dir %{_prefix}/vice
1333 %dir %{_prefix}/vice/cache
1334 %dir %{_prefix}/vice/etc
1335 %{_prefix}/vice/etc/CellServDB.dist
1336 %config %{_prefix}/vice/etc/ThisCell
1337 %config %{_prefix}/vice/etc/cacheinfo
1338 %{_bindir}/cmdebug
1339 %{_bindir}/up
1340 %{_prefix}/vice/etc/afsd
1341 %{pamdir}/pam_afs.krb.so.1
1342 %{pamdir}/pam_afs.krb.so
1343 %{pamdir}/pam_afs.so.1
1344 %{pamdir}/pam_afs.so
1345 %{initdir}/openafs-client
1346 %{_mandir}/man1/cmdebug.*
1347 %{_mandir}/man1/up.*
1348 %{_mandir}/man5/afs*
1349 %{_mandir}/man5/cacheinfo.*
1350 %{_mandir}/man8/afsd.*
1351 %{_mandir}/man5/CellAlias.*
1352
1353 %files server
1354 %defattr(-,root,root)
1355 %dir %{_prefix}/afs
1356 %dir %{_prefix}/afs/bin
1357 %dir %{_prefix}/afs/etc
1358 %dir %{_prefix}/afs/logs
1359 %{_prefix}/afs/bin/bosserver
1360 %{_prefix}/afs/bin/bos_util
1361 %{_prefix}/afs/bin/buserver
1362 %{_prefix}/afs/bin/fileserver
1363 # Should we support KAServer?
1364 %{_prefix}/afs/bin/kaserver
1365 %{_prefix}/afs/bin/ka-forwarder
1366 %{_prefix}/afs/bin/pt_util
1367 %{_prefix}/afs/bin/ptserver
1368 %{_prefix}/afs/bin/salvager
1369 %{_prefix}/afs/bin/upclient
1370 %{_prefix}/afs/bin/upserver
1371 %{_prefix}/afs/bin/vlserver
1372 %{_prefix}/afs/bin/volinfo
1373 %{_prefix}/afs/bin/volserver
1374 %{_sbindir}/kadb_check
1375 %{_sbindir}/prdb_check
1376 %{_sbindir}/vldb_check
1377 %{_sbindir}/vldb_convert
1378 %{_sbindir}/voldump
1379 %{initdir}/openafs-server
1380 %{_mandir}/man5/AuthLog.*
1381 %{_mandir}/man5/BackupLog.*
1382 %{_mandir}/man5/BosConfig.*
1383 %{_mandir}/man5/BosLog.*
1384 %{_mandir}/man5/FORCESALVAGE.*
1385 %{_mandir}/man5/FileLog.*
1386 %{_mandir}/man5/KeyFile.*
1387 %{_mandir}/man5/NetInfo.*
1388 %{_mandir}/man5/NetRestrict.*
1389 %{_mandir}/man5/NoAuth.*
1390 %{_mandir}/man5/SALVAGE.fs.*
1391 %{_mandir}/man5/SalvageLog.*
1392 %{_mandir}/man5/sysid.*
1393 %{_mandir}/man5/UserList.*
1394 %{_mandir}/man5/VLLog.*
1395 %{_mandir}/man5/VolserLog.*
1396 %{_mandir}/man5/bdb.DB0.*
1397 %{_mandir}/man5/fms.log.*
1398 %{_mandir}/man5/kaserver.DB0.*
1399 %{_mandir}/man5/kaserverauxdb.*
1400 %{_mandir}/man5/prdb.DB0.*
1401 %{_mandir}/man5/salvage.lock.*
1402 %{_mandir}/man5/tapeconfig.*
1403 %{_mandir}/man5/vldb.DB0.*
1404 %{_mandir}/man8/buserver.*
1405 %{_mandir}/man8/fileserver.*
1406 %{_mandir}/man8/kadb_check.*
1407 %{_mandir}/man8/ka-forwarder.*
1408 %{_mandir}/man8/prdb_check.*
1409 %{_mandir}/man8/ptserver.*
1410 %{_mandir}/man8/pt_util.*
1411 %{_mandir}/man8/salvager.*
1412 %{_mandir}/man8/upclient.*
1413 %{_mandir}/man8/upserver.*
1414 %{_mandir}/man8/vldb_check.*
1415 %{_mandir}/man8/vlserver.*
1416 %{_mandir}/man8/voldump.*
1417 %{_mandir}/man8/volinfo.*
1418 %{_mandir}/man8/volserver.*
1419 #%{_mandir}/man8/vldb_convert.*
1420
1421 %if %{build_authlibs}
1422 %files authlibs
1423 %defattr(-,root,root)
1424 %{_libdir}/libafsauthent.so.*
1425 %{_libdir}/libafsrpc.so.*
1426 %endif
1427
1428 %files authlibs-devel
1429 %defattr(-,root,root)
1430 %{_libdir}/libafsauthent.a
1431 %{_libdir}/libafsrpc.a
1432 %if %{build_authlibs}
1433 %{_libdir}/libafsauthent.so
1434 %{_libdir}/libafsrpc.so
1435 %endif
1436
1437 %files devel
1438 %defattr(-,root,root)
1439 %{_bindir}/rxgen
1440 %{_includedir}/afs
1441 %{_includedir}/des.h
1442 %{_includedir}/des_conf.h
1443 %{_includedir}/des_odd.h
1444 %{_includedir}/des_prototypes.h
1445 %{_includedir}/lock.h
1446 %{_includedir}/lwp.h
1447 %{_includedir}/mit-cpyright.h
1448 %{_includedir}/potpourri.h
1449 %{_includedir}/preempt.h
1450 %{_includedir}/rx
1451 %{_includedir}/timer.h
1452 %{_includedir}/ubik.h
1453 %{_includedir}/ubik_int.h
1454 %{_libdir}/afs
1455 %{_libdir}/libdes.a
1456 %{_libdir}/liblwp.a
1457 %{_libdir}/librx.a
1458 %{_libdir}/librxkad.a
1459 %{_libdir}/librxstat.a
1460 %{_libdir}/libubik.a
1461 %{_mandir}/man1/rxgen.*
1462
1463 %files kernel-source
1464 %defattr(-,root,root)
1465 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
1466 %{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
1467 %{_prefix}/src/openafs-kernel-%{afsvers}/README
1468 %{_prefix}/src/openafs-kernel-%{afsvers}/src
1469
1470 %files compat
1471 %defattr(-,root,root)
1472 %{_prefix}/afsws
1473
1474 %files kpasswd
1475 %defattr(-,root,root)
1476 %{_bindir}/kpasswd
1477 %{_bindir}/kpwvalid
1478
1479 %if %{krb5support}
1480 %files krb5
1481 %defattr(-,root,root)
1482 %{_bindir}/aklog
1483 %{_sbindir}/asetkey
1484 %{_mandir}/man1/aklog.*
1485 %{_mandir}/man8/asetkey.*
1486 %endif
1487
1488 %endif
1489
1490 %if %{build_modules}
1491
1492 %if !%{fedorakmod}
1493 %if %{up_package}
1494 %files kernel
1495 %defattr(-,root,root)
1496 %{kxmoddir}/fs/openafs/openafs.*
1497 %endif
1498
1499 %if %{smp_package}
1500 %files kernel-smp
1501 %defattr(-,root,root)
1502 %{kxmoddir}%{?smp_ext:%{smp_ext}}/fs/openafs/openafs.*
1503 %endif
1504
1505 %if %{largesmp_package}
1506 %files kernel-largesmp
1507 %defattr(-,root,root)
1508 %{kxmoddir}%{?largesmp_ext:%{largesmp_ext}}/fs/openafs/openafs.*
1509 %endif
1510  
1511 %if %{bigmem_package}
1512 %files kernel-bigmem
1513 %defattr(-,root,root)
1514 %{kxmoddir}%{?bigmem_ext:%{bigmem_ext}}/fs/openafs/openafs.*
1515 %endif
1516
1517 %if %{hugemem_package}
1518 %files kernel-hugemem
1519 %defattr(-,root,root)
1520 %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/fs/openafs/openafs.*
1521 %endif
1522 %endif
1523
1524 %endif
1525
1526 ##############################################################################
1527 ###
1528 ### openafs.spec change log
1529 ###
1530 ##############################################################################
1531 %changelog
1532 * Tue Oct 29 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5
1533 - Update to match the shipped 1.4.5 RPMS
1534 - Fix the kvariant stuff to only configure the 'standard' case once
1535 - Add openafs-kvers.sh back in
1536
1537 * Wed Oct 10 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
1538 - Use Fedora style kmods, which allows us to install multiple kernel types
1539
1540 * Thu Jun 07 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.4-3
1541 - Use distributed files, rather than those in packager's SOURCE directory
1542 - Remove SuidCells stuff, which was unused
1543
1544 * Fri Dec 01 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-2
1545 - integrate s390x changes
1546 - allow for building libafs*.a and not libafs*.so into packages, for platforms
1547   that won't build the .so files.
1548
1549 * Wed Aug 23 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-1
1550 - update to 1.4.2
1551 - use installed aklog manpage.
1552 - moduleparam patch obsoleted.
1553
1554 * Tue Aug 22 2006  Derek Atkins <warlord@MIT.EDU> 1.4.2-0.1.rc1
1555 - update to 1.4.2-rc1
1556 - hand-apply lee damon's changes to support largesmp kernels from RHEL4
1557   (but only add support for 2.6 kernels.  No need for the 2.4 kernels).
1558 - don't need the posixlock patch anymore.
1559
1560 * Wed Jul 12 2006  Derek Atkins <warlord@MIT.EDU> 1.4.2-0.beta2
1561 - update to 1.4.2-beta2
1562 - add linux2.4 posixlock API patch
1563
1564 * Mon Jun 26 2006  Derek Atkins <warlord@MIT.EDU>
1565 - moduleparam and krb524 patches no longer required in OA-CVS
1566
1567 * Wed May 17 2006  Derek Atkins <warlord@MIT.EDU>
1568 - change non-target-cpu kernel dep to a file dep
1569 - make sure we use the proper kernel version for the dependency.
1570
1571 * Tue May 16 2006  Derek Atkins <warlord@MIT.EDU>
1572 - allow users to specify local CellServDB and SuidCells entries
1573   don't overwrite user's changes.  Provide a .dist an let users
1574   make entries in a ".local"
1575 - build the CellServDB and SuidCells at client startup and at
1576   client install-time
1577 - add provideskernelarch functionality to openafs-kvers-is.sh
1578 - use that functionality to Require kernel{,-<type>}-targetcpu
1579   to get better package safety due to RPM bugs where the kernel
1580   release isn't used so you can install the kernel module against
1581   any kernel of the same major version.
1582
1583 * Mon May 15 2006  Derek Atkins <warlord@MIT.EDU>
1584 - update the README in openafs-kernel-source
1585 - fix openafs-kvers-is.sh from Alexander Bergolth's patch.
1586 - move kernel module from .../kernel/fs/openafs to .../fs/openafs/
1587
1588 * Fri Apr 21 2006  Derek Atkins <warlord@MIT.EDU>
1589 - build requires autoconf and automake for krb5support
1590   and autoconf for standard package
1591 - dont setup the krb5 migration kit (or patches) if we don't care.
1592 - require ncurses-devel to build
1593
1594 * Wed Apr 19 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-3
1595 - look for krb524 functions in libkrb524 if we can't find them
1596   in the standard locations.
1597
1598 * Tue Apr 18 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-2
1599 - fix the module_param_array macro for Linux 2.6.9.
1600
1601 * Sat Apr 15 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-1
1602 - update to 1.4.1 release.
1603 - distribute asetkey from openafs instead of krb5-migration kit
1604 - don't need to apply the FC5 patches because they are part of the distro.
1605 - install asetkey into the "proper" place
1606 - dont list a manpage twice.
1607 - package asetkey man page.  delete it when not needed.
1608
1609 * Thu Apr  6 2006  Derek Atkins <warlord@MIT.EDU>
1610 - turn authlibs back on, because RT #18767 was applied to CVS.
1611
1612 * Wed Mar 29 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1rc10-1
1613 - update to 1.4.1rc10, build on FC5
1614 - fix the man pages (distribute into various packages)
1615 - include patches for FC5, RT #29112 and #29122
1616
1617 * Mon Dec 19 2005  Derek Atkins <warlord@MIT.EDU>
1618 - openafs-server shouldn't depend on the kernel module.
1619
1620 * Thu Nov 17 2005  Derek Atkins <warlord@MIT.EDU>
1621 - patch from Mike Polek <mike at pictage.com> to run depmod for
1622   the target kernel and not the running kernel.
1623
1624 * Tue Nov  8 2005  Derek Atkins <warlord@MIT.EDU>
1625 - build aklog from the openafs sources, not from the krb5 migration kit.
1626
1627 * Fri Nov  4 2005  Derek Atkins <warlord@MIT.EDU>
1628 - set openafs-kernel-source to Provide openafs-kernel
1629
1630 * Thu Oct 20 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0-1
1631 - update afs-krb5 res_search patch: look for res_search and __res_search
1632 - update to 1.4.0 final
1633
1634 * Mon Oct 10 2005  Derek Atkins <warlord@MIT.EDU>
1635 - remove all kdump builds.
1636
1637 * Thu Oct  6 2005  Derek Atkins <warlord@MIT.EDU>
1638 - fix openafs-kernel-version.sh so it will build an RPM for the
1639   currently-running kernel even if it's smp on 2.6.
1640
1641 * Tue Sep 27 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc5-1
1642 - upgrade to 1.4.0rc5
1643 - turn off authlibs packages
1644
1645 * Fri Sep 23 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-2
1646 - add kmodule26 patch: fix the kernel module name on 2.6 kernels so
1647   it's called "openafs" and not "libafs".  This fixes the shutdown
1648   problem.
1649
1650 * Thu Sep 22 2005  Derek Atkins <warlord@MIT.EDU>
1651 - update kversis script, add 'kvers' operation
1652 - fix bug that 2.6 smp/hugemem kernels don't provide
1653   kernel-foo = %{kernvers} with 'smp', 'hugemem', etc.
1654 - add patch to remove res_search from the afs-krb5 configure
1655
1656 * Thu Sep 15 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc4-1
1657 - Update to 1.4.0rc4
1658 - Update the afs-krb5 krb524 patch so it actually works on
1659   some older systems like RHEL3 that still need -lkrb524.
1660 - Update the buildall script so choose better architecture support,
1661   e.g. don't build i586 on RHEL.
1662 - Update the rebuild information in the SPEC file.
1663 - Add support for finding .EL kernels in openafs-kvers-is.sh
1664 - Add additional error messages when kernel version/type parsing fails.
1665 - Update the buildall script to use the kernel srcdir directly.
1666
1667 * Wed Sep 14 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-2
1668 - Add "hugemem" to 2.4 configs
1669 - Add checks to support scripts to determine whether to build
1670   the bigmem and/or hugemem kernels for 2.4.
1671
1672 * Mon Sep 12 2005  Derek Atkins <warlord@MIT.EDU> 1.4.0rc3-1
1673 - Added some afs-krb5 patches to get the migration kit to build
1674   on modern AFS and modern Kerberos.
1675 - Added authlibs and authlibs-devel packages as per UMich changes.
1676
1677 * Sun Sep 11 2005  Derek Atkins <warlord@MIT.EDU>
1678 - Merged in some of the 2.6 changes from wingc@engin.umich.edu
1679
1680 * Sat Sep 10 2005  Derek Atkins <warlord@MIT.EDU>
1681 - Merged in lots of changes from David Howells and Nalin Dahyabhai
1682   from Red Hat.   Initial attempt at a release of 1.4.  Still need
1683   to work in a 2.6 build system.