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