4 # Define your particular Red Hat and kernel versions:
11 # This is where to look for kernel-build includes files.
12 # Most likely you don't want to change this, but
13 # depending on your situation you may want:
15 # kbase = /usr/src/linux-
18 # kbase = /lib/modules/
21 %define kbase /usr/src/linux-
24 # Set 'debugspec' to 1 if you want to debug the spec file. This will
25 # not remove the installed tree as part of the %clean operation
28 # Set 'enterprisekernelsupport' to 1 if you want to build the
29 # kernel module for the enterprise kernel
30 # Note: This will only work for kernvers == 24 on i686
31 %define enterprisekernelsupport 1
33 # Set 'bigmemkernelsupport' to 1 if you want to build the
34 # kernel module for the bigmem kernel
35 # Note: This will only work for kernvers == 24 on i686
36 %define bigmemkernelsupport 1
38 # Set 'krb5support' to 1 if you want to build the openafs-krb5 package
39 # to distribute aklog and asetkey
42 # OpenAFS configuration options
43 %define enable_bitmap_later 0
44 %define enable_bos_restricted_mode 0
45 %define enable_fast_restart 0
47 #######################################################################
48 # You probably don't need to change anything beyond this line
49 # NOTE: If you do, please email me!!!
51 Summary: OpenAFS distributed filesystem
54 Release: %{osvers}.%{pkgrel}
56 BuildRoot: %{_tmppath}/%{name}-%{version}-root
57 Packager: Derek Atkins <warlord@MIT.EDU>
58 Group: Networking/Filesystems
59 BuildRequires: kernel-source
60 %if "%{osvers}" != "rh6.2"
61 # Newer versions of Red Hat require pam-devel in order to build
62 BuildRequires: pam-devel
65 Source0: http://www.openafs.org/dl/openafs/${afsvers}/openafs-%{afsvers}-src.tar.gz
66 Source1: http://www.openafs.org/dl/openafs/${afsvers}/openafs-%{afsvers}-doc.tar.gz
67 Source2: openafs-ThisCell
68 # http://grand.central.org/dl/cellservdb/CellServDB
69 Source3: openafs-CellServDB
70 Source4: openafs-SuidCells
71 Source5: openafs-cacheinfo
72 Source6: openafs-afsmodname
73 Source7: openafs-LICENSE.Sun
74 Source8: openafs-README
75 Source10: http://www.openafs.org/dl/openafs/${afsvers}/RELNOTES-%{afsvers}
76 Source11: http://www.openafs.org/dl/openafs/${afsvers}/ChangeLog
78 Source20: openafs-krb5-1.3.tar.gz
80 Patch0: openafs-%{afsvers}-rc.patch
82 Patch20: openafs-krb5-1.3-1.2.1.diff.gz
83 Patch21: openafs-krb5-1.3-configure.patch
86 The AFS distributed filesystem. AFS is a distributed filesystem
87 allowing cross-platform sharing of files among multiple computers.
88 Facilities are provided for access control, authentication, backup and
89 administrative management.
91 This package provides common files shared across all the various
92 OpenAFS packages but are not necessarily tied to a client or server.
95 Requires: binutils, openafs-kernel, openafs = %{PACKAGE_VERSION}
96 Summary: OpenAFS Filesystem Client
97 Group: Networking/Filesystem
100 The AFS distributed filesystem. AFS is a distributed filesystem
101 allowing cross-platform sharing of files among multiple computers.
102 Facilities are provided for access control, authentication, backup and
103 administrative management.
105 This package provides basic client support to mount and manipulate
109 Requires: openafs-kernel, openafs = %{PACKAGE_VERSION}
110 Summary: OpenAFS Filesystem Server
111 Group: Networking/Filesystems
114 The AFS distributed filesystem. AFS is a distributed filesystem
115 allowing cross-platform sharing of files among multiple computers.
116 Facilities are provided for access control, authentication, backup and
117 administrative management.
119 This package provides basic server support to host files in an AFS
123 Summary: OpenAFS Development Libraries and Headers
124 Group: Development/Filesystems
127 The AFS distributed filesystem. AFS is a distributed filesystem
128 allowing cross-platform sharing of files among multiple computers.
129 Facilities are provided for access control, authentication, backup and
130 administrative management.
132 This package provides static development libraries and headers needed
133 to compile AFS applications. Note: AFS currently does not provide
137 Summary: OpenAFS Kernel Module(s)
138 Requires: openafs = %{PACKAGE_VERSION}
139 Group: Networking/Filesystems
142 The AFS distributed filesystem. AFS is a distributed filesystem
143 allowing cross-platform sharing of files among multiple computers.
144 Facilities are provided for access control, authentication, backup and
145 administrative management.
147 This package provides precompiled AFS kernel modules for various
150 %package kernel-source
151 Summary: OpenAFS Kernel Module source tree
152 Group: Networking/Filesystems
154 %description kernel-source
155 The AFS distributed filesystem. AFS is a distributed filesystem
156 allowing cross-platform sharing of files among multiple computers.
157 Facilities are provided for access control, authentication, backup and
158 administrative management.
160 This package provides the source code to build your own AFS kernel
164 Summary: OpenAFS client compatibility symlinks
165 Requires: openafs = %{PACKAGE_VERSION}, openafs-client = %{PACKAGE_VERSION}
166 Group: Networking/Filesystems
167 Obsoletes: openafs-client-compat
170 The AFS distributed filesystem. AFS is a distributed filesystem
171 allowing cross-platform sharing of files among multiple computers.
172 Facilities are provided for access control, authentication, backup and
173 administrative management.
175 This package provides compatibility symlinks in /usr/afsws. It is
176 completely optional, and is only necessary to support legacy
177 applications and scripts that hard-code the location of AFS client
181 Summary: OpenAFS KA kpasswd support
183 Group: Networking/Filesystems
186 The AFS distributed filesystem. AFS is a distributed filesystem
187 allowing cross-platform sharing of files among multiple computers.
188 Facilities are provided for access control, authentication, backup and
189 administrative management.
191 This package provides the compatibility symlink for kpasswd, in case
192 you are using KAserver instead of Krb5.
196 Summary: OpenAFS programs to use with krb5
197 Requires: openafs = %{PACKAGE_VERSION}
198 Group: Networking/Filesystems
199 BuildRequires: krb5-devel
202 The AFS distributed filesystem. AFS is a distributed filesystem
203 allowing cross-platform sharing of files among multiple computers.
204 Facilities are provided for access control, authentication, backup and
205 administrative management.
207 This package provides compatibility programs so you can use krb5
208 to authenticate to AFS services, instead of using AFS's homegrown
209 krb4 lookalike services.
218 %setup -q -T -D -a 20
229 %ifarch i386 i486 i586 i686 athlon
231 sysname=${sysbase}_linux%{kernvers}
234 sysname=${sysbase}_linux%{kernvers}
237 if [ %{kernvers} = 22 ]; then
239 elif [ %{kernvers} = 24 ]; then
242 echo "I don't know how to build $sysname"
246 %ifarch i386 i486 i586 i686 athlon
247 archlist="i386 i586 i686 athlon"
253 # PrintDefine var value statements file
258 echo "#ifndef $1" >> $4
263 echo "#undef $1" >> $4
268 echo "#define $1 $2" >> $4
278 echo "#include $1" >> $4
290 # PrintRedhatKernelFix arch mp file
291 PrintRedhatKernelFix() {
297 if [ "$2" = "MP" ]; then
299 elif [ "$2" = "EP" ]; then
301 elif [ "$2" = "BM" ]; then
308 # deal with the various boot kernels
312 # arch of 'BOOT' == 386
313 if [ "$arch" = "BOOT" ]; then
314 if [ "$up" = 1 ]; then
317 elif [ "$smp" = 1 ]; then
327 PrintDefine "REDHAT_FIX_H" "" ifn,def,nl $file
329 PrintDefine "__BOOT_KERNEL_ENTERPRISE" $ent und,def,nl $file
330 PrintDefine "__BOOT_KERNEL_BIGMEM" $bm und,def,nl $file
331 PrintDefine "__BOOT_KERNEL_SMP" $smp und,def,nl $file
332 PrintDefine "__BOOT_KERNEL_UP" $up und,def,nl $file
333 PrintDefine "__BOOT_KERNEL_BOOT" $boot und,def,nl $file
334 PrintDefine "__BOOT_KERNEL_BOOTSMP" $bootsmp und,def,nl $file
336 PrintDefine \"/boot/kernel.h\" "" inc,nl $file # include file
338 for ar in $archlist ; do
339 if [ "$ar" = "$arch" ]; then
340 PrintDefine "__MODULE_KERNEL_$ar" "1" ifn,def,end $file
342 PrintDefine "__MODULE_KERNEL_$ar" "" und $file # undef
347 PrintDefine "" "" end $file
349 if [ %{debugspec} = 1 ] ; then
350 echo "Kernel Configuration File for Red Hat kernels:"
355 # Pick up all the 'appropriate' kernels
356 kvers=`ls -d %{kbase}* | sed 's^%{kbase}^^g' | grep $kv`
358 # Choose the last one for now.. It doesn't really matter, really.
359 hdrdir=`ls -d %{kbase}*%{kend} | grep $kv | tail -1`
361 config_opts="--enable-redhat-buildsys \
362 %if %{enable_bitmap_later}
363 --enable-bitmap-later \
365 %if %{enable_bos_restricted_mode}
366 --enable-bos-restricted-mode \
368 %if %{enable_fast_restart}
369 --enable-fast-restart \
371 --enable-transarc-paths"
374 ./configure --with-afs-sysname=${sysname} \
375 --with-linux-kernel-headers=$hdrdir $config_opts
377 # Build the user-space AFS stuff
380 # Build the libafs tree
381 make only_libafs_tree
383 # Now build all the kernel modules
384 for vers in $kvers ; do
386 # Reconfigure sources for this kernel version, to catch various
387 # kernel params in the configure script. Yes. this takes more time,
388 # but it's worth it in the long run.. But first remove config.cache
389 # to be sure we get a clean configuration.
391 ./configure --with-afs-sysname=${sysname} \
392 --with-linux-kernel-headers=%{kbase}$vers%{kend} \
396 %if %{enterprisekernelsupport}
397 # See if we should build EP support
398 if grep -q -r __BOOT_KERNEL_ENTERPRISE %{kbase}$vers%{kend}/include
403 %if %{bigmemkernelsupport}
404 # See if we should build BM support
405 if grep -q -r __BOOT_KERNEL_BIGMEM %{kbase}$vers%{kend}/include
412 # ... for all appropriate 'architectures'...
413 if [ %{kernvers} = 22 ]; then
414 # For 2.2 kernels, just do MP and SP kernels; force EP into i686
417 if [ $mp = EP -a ${sysbase} = i386 ]; then
421 PrintRedhatKernelFix $arch $mp src/config/redhat-fix.h
422 make dest_only_libafs LOCAL_SMP_DEF=-DREDHAT_FIX MPS=$mp
424 elif [ %{kernvers} = 24 ]; then
425 # For 2.4 kernels, need to build modules for each architecture!
427 for arch in $archlist ; do
429 # build SP and MP on all architectures.
430 # build EP and BM only on i686
431 if [ $mp = SP -o $mp = MP -o \
432 \( $mp = EP -a $arch = i686 \) -o \
433 \( $mp = BM -a $arch = i686 \) ]; then
434 PrintRedhatKernelFix $arch $mp src/config/redhat-fix.h
435 make dest_only_libafs LOCAL_SMP_DEF=-DREDHAT_FIX \
436 LINUX_MODULE_NAME="-$arch" MPS=$mp
441 echo "I don't know how to build $sysname"
447 rm -f src/config/redhat-fix.h
450 # Now build aklog/asetkey
451 (cd openafs-krb5-1.3/src &&
453 ./configure --prefix=/usr --with-krb5=/usr/kerberos \
454 --with-afs=`pwd`/../../${sysname}/dest/ && \
456 make install DESTDIR=`pwd`/../../${sysname}/dest/ INSTALL_BIN=/bin \
464 [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
466 %ifarch i386 i486 i586 i686 athlon
468 sysname=${sysbase}_linux%{kernvers}
471 sysname=${sysbase}_linux%{kernvers}
475 mkdir -p $RPM_BUILD_ROOT/usr/sbin
476 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
477 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
478 mkdir -p $RPM_BUILD_ROOT/etc/openafs
479 mkdir -p $RPM_BUILD_ROOT/lib/security
480 mkdir -p $RPM_BUILD_ROOT/usr/afs/logs
481 mkdir -p $RPM_BUILD_ROOT/usr/vice/etc
482 mkdir -p $RPM_BUILD_ROOT/usr/vice/cache
483 chmod 700 $RPM_BUILD_ROOT/usr/vice/cache
485 # Copy files from dest to the appropriate places in BuildRoot
486 tar cf - -C ${sysname}/dest bin include lib | tar xf - -C $RPM_BUILD_ROOT/usr
487 tar cf - -C ${sysname}/dest/etc . | tar xf - -C $RPM_BUILD_ROOT/usr/sbin
488 tar cf - -C ${sysname}/dest/root.server/usr/afs bin | tar xf - -C $RPM_BUILD_ROOT/usr/afs
489 tar cf - -C ${sysname}/dest/root.client/usr/vice/etc afsd modload | tar xf - -C $RPM_BUILD_ROOT/usr/vice/etc
491 # Link kpasswd to kapasswd
492 ln -f $RPM_BUILD_ROOT/usr/bin/kpasswd $RPM_BUILD_ROOT/usr/bin/kapasswd
494 # Copy root.client config files
495 install -m 755 ${sysname}/dest/root.client/usr/vice/etc/afs.conf $RPM_BUILD_ROOT/etc/sysconfig/afs
496 install -m 755 ${sysname}/dest/root.client/usr/vice/etc/afs.rc $RPM_BUILD_ROOT/etc/rc.d/init.d/afs
499 install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT/lib/security
502 ln -sf pam_afs.so.1 $RPM_BUILD_ROOT/lib/security/pam_afs.so
503 ln -sf pam_afs.krb.so.1 $RPM_BUILD_ROOT/lib/security/pam_afs.krb.so
505 # Populate /usr/vice/etc
506 uve=$RPM_BUILD_ROOT/usr/vice/etc
507 install -p -m 644 $RPM_SOURCE_DIR/openafs-CellServDB $uve/CellServDB
508 install -p -m 644 $RPM_SOURCE_DIR/openafs-SuidCells $uve/SuidCells
509 install -p -m 644 $RPM_SOURCE_DIR/openafs-ThisCell $uve/ThisCell
510 install -p -m 644 $RPM_SOURCE_DIR/openafs-cacheinfo $uve/cacheinfo
511 install -p -m 755 $RPM_SOURCE_DIR/openafs-afsmodname $uve/afsmodname
515 symtable=$RPM_BUILD_ROOT/usr/vice/etc/modload/SymTable
517 echo "# SymTable, automatically generated" > $symtable
518 echo "# symbol version cpu module" >> $symtable
521 $RPM_BUILD_ROOT/usr/vice/etc/afsmodname -x -f $symtable \
522 $RPM_BUILD_ROOT/usr/vice/etc/modload/libafs*.o
525 # install kernel-source
528 # Install the kernel module source tree
529 mkdir -p $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/src
530 tar cf - -C libafs_tree . | \
531 tar xf - -C $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/src
533 # Next, copy the LICENSE Files, README
534 install -m 644 src/LICENSE $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/LICENSE.IBM
535 install -m 644 $RPM_SOURCE_DIR/openafs-LICENSE.Sun $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/LICENSE.Sun
536 install -m 644 $RPM_SOURCE_DIR/openafs-README $RPM_BUILD_ROOT/usr/src/openafs-kernel-%{afsvers}/README
539 # Install DOCUMENTATION
542 # Build the DOC directory
543 mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
544 tar cf - -C doc LICENSE html pdf | \
545 tar xf - -C $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
546 install -m 644 $RPM_SOURCE_DIR/RELNOTES-%{afsvers} $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
547 install -m 644 $RPM_SOURCE_DIR/ChangeLog $RPM_BUILD_ROOT/$RPM_DOC_DIR/openafs-%{afsvers}
552 grep -v "^#" >openafs-file-list <<EOF-openafs-file-list
567 /usr/bin/translate_et
580 EOF-openafs-file-list
583 # Install compatiblity links
585 for d in bin:bin etc:sbin; do
586 olddir=`echo $d | sed 's/:.*$//'`
587 newdir=`echo $d | sed 's/^.*://'`
588 mkdir -p $RPM_BUILD_ROOT/usr/afsws/$olddir
589 for f in `cat openafs-file-list`; do
590 if echo $f | grep -q /$newdir/; then
592 ln -sf /usr/$newdir/$fb $RPM_BUILD_ROOT/usr/afsws/$olddir/$fb
602 rm -f openafs-file-list
603 [ "$RPM_BUILD_ROOT" != "/" -a "x%{debugspec}" != "x1" ] && \
604 rm -fr $RPM_BUILD_ROOT
611 if [ -e /usr/afsws ]; then
612 /bin/rm -fr /usr/afsws
619 if [ ! -d /afs ]; then
626 echo The AFS cache is configured for 100 MB. Edit the
627 echo /usr/vice/etc/cacheinfo file to change this before
628 echo running AFS for the first time. You should also
629 echo set your home cell in /usr/vice/etc/ThisCell.
631 echo Also, you may want to edit /etc/pam.d/login and
632 echo possibly others there to get an AFS token on login.
635 echo auth sufficient /lib/security/pam_afs.so try_first_pass ignore_root
637 echo before the one for pwdb.
641 if [ -f /etc/sysconfig/afs ] ; then
642 srv=`grep ^AFS_SERVER /etc/sysconfig/afs | sed 's/^AFS_SERVER[\s]*=[\s]*//'`
643 if [ "x$srv" = "xon" ] ; then
649 echo Be sure to edit /etc/sysconfig/afs and turn AFS_SERVER on
654 /etc/rc.d/init.d/afs stop
656 [ -d /afs ] && rmdir /afs
662 %files -f openafs-file-list
663 %defattr(-,root,root)
664 %config /etc/sysconfig/afs
665 %doc %{_docdir}/openafs-%{afsvers}
669 %defattr(-,root,root)
673 %dir /usr/vice/etc/modload
674 %config /usr/vice/etc/CellServDB
675 %config /usr/vice/etc/SuidCells
676 %config /usr/vice/etc/ThisCell
677 %config /usr/vice/etc/cacheinfo
681 /usr/vice/etc/afsmodname
682 /lib/security/pam_afs.krb.so.1
683 /lib/security/pam_afs.krb.so
684 /lib/security/pam_afs.so.1
685 /lib/security/pam_afs.so
688 %defattr(-,root,root)
692 /usr/afs/bin/bosserver
693 /usr/afs/bin/buserver
694 /usr/afs/bin/fileserver
695 # Should we support KAServer?
696 /usr/afs/bin/kaserver
697 /usr/afs/bin/kpwvalid
699 /usr/afs/bin/ptserver
700 /usr/afs/bin/salvager
701 /usr/afs/bin/upclient
702 /usr/afs/bin/upserver
703 /usr/afs/bin/vlserver
705 /usr/afs/bin/volserver
708 /usr/sbin/vldb_convert
711 %defattr(-,root,root)
715 /usr/include/des_conf.h
716 /usr/include/des_odd.h
719 /usr/include/mit-cpyright.h
720 /usr/include/potpourri.h
721 /usr/include/preempt.h
725 /usr/include/ubik_int.h
727 /usr/lib/libafsauthent.a
737 %defattr(-,root,root)
738 /usr/vice/etc/modload/libafs*.o
739 /usr/vice/etc/modload/SymTable
742 %defattr(-,root,root)
743 /usr/src/openafs-kernel-%{afsvers}/LICENSE.IBM
744 /usr/src/openafs-kernel-%{afsvers}/LICENSE.Sun
745 /usr/src/openafs-kernel-%{afsvers}/README
746 /usr/src/openafs-kernel-%{afsvers}/src
749 %defattr(-,root,root)
753 %defattr(-,root,root)
759 %defattr(-,root,root)