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