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