[OpenAFS] OpenAFS on Fedora Core 1 [working RPMs]

Jack Neely slack@quackmaster.net
Mon, 17 Nov 2003 11:00:18 -0500


--GZVR6ND4mMseVXL/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Its difficult to do that.  My RPMs are not a fork or the RPMS form the
OpenAFS folks.  That have been built up from scatch over the years.  You
folks are welcome to take a look.  I'll attach the spec file.

Jack Neely

-- 
Jack Neely <slack@quackmaster.net>
Realm Linux Administration and Development
PAMS Computer Operations at NC State University
GPG Fingerprint: 1917 5AC1 E828 9337 7AA4  EA6B 213B 765F 3B6A 5B89

--GZVR6ND4mMseVXL/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="openafs.spec"

%define thiscell unity.ncsu.edu
%{!?ksource_dir: %define ksource_dir /lib/modules/%(uname -r)/build}
%define uts_release %( gcc -E -D__BOOT_KERNEL_H_ -dM %{ksource_dir}/include/linux/version.h | grep UTS | sed 's/^#define UTS_RELEASE //;s/"//g' )

%ifarch i386 i586 i686 athlon
%define sysname i386_linux24
%else
%ifarch alpha
%define sysname alpha_linux24
%endif
%else
%ifarch ia64
%define sysname ia64_linux24
%endif
%else
%ifarch ppc ppc64
%define sysname ppc_linux24
%endif
%ifarch s390
%define sysname s390_linux24
%endif
%endif

%define basearchs i386 alpha ia64 ppc s390
%define build_enterprise 0

Summary: OpenAFS Enterprise Network File System
Name: openafs
Version: 1.2.10
Release: 2
License: IBM Public License
Group: System Environment/Daemons
URL: http://oss.software.ibm.com/developerworks/opensource/afs/downloads.html
Source0: http://www.openafs.org/dl/openafs/%{version}/%{name}-%{version}-src.tar.bz2
Source1: /afs/transarc.com/service/CellServDB
Source2: cacheinfo
Source3: openafs.init
Source4: afs.conf
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: kernel-source = %{uts_release}, kernel = %{uts_release}, 
BuildRequires: pam-devel

%description
The AFS distributed filesystem.  AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.

This package provides common files shared across all the various
OpenAFS packages but are not necessarily tied to a client or server.


%package client
Summary: OpenAFS Filesystem client
Group: System Environment/Daemons
Prereq: bash, fileutils, chkconfig
Requires: openafs, openafs-kernel = %{PACKAGE_VERSION}
Obsoletes: afs-client
Conflicts: arla

%description client
The AFS distributed filesystem.  AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.

This package provides basic client support to mount and manipulate
AFS.  


%package devel
Summary: OpenAFS development header files and static libraries
Group: Development/Libraries
Obsoletes: afs-devel
Conflicts: arla-devel
Requires: openafs
Prereq: /sbin/ldconfig
 
%description devel
The AFS distributed filesystem.  AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.

This package provides static development libraries and headers needed
to compile AFS applications.  Note: AFS currently does not provide
shared libraries.

 
%package server
Summary: OpenAFS Filesystem Server
Group: System Environment/Daemons
Requires: openafs-client = %{PACKAGE_VERSION}, openafs = %{PACKAGE_VERSION}
Prereq: openafs-client
Obsoletes: afs-server
Conflicts: milko
 
%description server
The AFS distributed filesystem.  AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.

This package provides basic server support to host files in an AFS
Cell.

%package kernel
Summary: OpenAFS Filesystem Kernel Modules
Group: System Environment/Daemons
Requires: openafs = %{PACKAGE_VERSION}, kernel = %{uts_release}
Obsoletes: afs-modules afs-module
Conflicts: arla

%description kernel
The AFS distributed filesystem.  AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.

This package provides the kernel modules for use with OpenAFS. The
package was built for kernel versions %{uts_release} and
%{uts_release}smp.

%package kernel-source
Summary: OpenAFS Filesystem Kernel Modules Source
Group: Development/System
Requires: openafs = %{PACKAGE_VERSION}, kernel = %{uts_release}

%description kernel-source
The AFS distributed filesystem.  AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.

This package provides source to build OpenAFS kernel modules for a
different kernel.  Largely useful if you build custom kernels from
scratch; with rpm-based kernels, you are likely better off just
rebuilding the source RPM with the command 
"rpm --rebuild --target=arch openafs-%{PACKAGE_VERSION}.src.rpm" 
where arch is the architecture of the kernel you are running (eg. i686)


%prep
%setup -q 

%build
# this used to be very very disgusting, but it is nice and clean now
buildKernelModules() {
EXTRAKDEFS="-D__BOOT_KERNEL_H_ -D__MODULE_KERNEL_%{_target_cpu}=1"

# UP first 
make LOCAL_SMP_DEF="$EXTRAKDEFS -D__BOOT_KERNEL_UP=1" MPS=UP only_libafs 

# then SMP
make LOCAL_SMP_DEF="$EXTRAKDEFS -D__BOOT_KERNEL_SMP=1" MPS=MP only_libafs

%if %{build_enterprise}
# enterprise kernel only exists for i686
%ifarch i686
make LOCAL_SMP_DEF="$EXTRAKDEFS -D__BOOT_KERNEL_ENTERPRISE=1" MPS=ET only_libafs
%endif
%endif
}

# do the main build
buildIt() {
./regen.sh
%configure --with-afs-sysname=%{sysname} --with-linux-kernel-headers=%{ksource_dir} --enable-redhat-buildsys --enable-kernel-module 

# build the user-space bits for base architectures
%ifarch %{basearchs}
make all_nolibafs
%endif

# libafs has to be built on all of them though
make only_libafs_tree

# and now for the mess of doing kernel modules
%ifnarch i386
   buildKernelModules
%endif

# now create the tree for our module source
make libafs_tree
}

buildIt

%install
rm -rf ${RPM_BUILD_ROOT}
# only run make install on "primary" architectures
%ifarch %{basearchs}
%makeinstall

# install config info
mkdir -p ${RPM_BUILD_ROOT}/etc/openafs
install -p -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}/etc/openafs
install -p -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}/etc/openafs
echo %{thiscell} > ${RPM_BUILD_ROOT}/etc/openafs/ThisCell

# install the init script
mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
install -m 755 %{SOURCE3} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/afs

# sysconfig file
mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}/etc/sysconfig/afs

# create the cache dir
mkdir -m 700 -p $RPM_BUILD_ROOT/var/cache/openafs

# install the kernel module source
mkdir -p ${RPM_BUILD_ROOT}/usr/src/openafs-kernel-%{version}-%{release}
(cd libafs_tree; find . | cpio -pmd ${RPM_BUILD_ROOT}/usr/src/openafs-kernel-%{version}-%{release})
%endif # primary architecture install


# install kernel modules in /lib/modules/$(uname -r)/kernel/fs/
%ifnarch i386
mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{uts_release}/kernel/fs/ 
install -m 644 src/libafs/MODLOAD-%{uts_release}-UP/libafs-%{uts_release}.o ${RPM_BUILD_ROOT}/lib/modules/%{uts_release}/kernel/fs/openafs.o

mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{uts_release}smp/kernel/fs/ 
install -m 644 src/libafs/MODLOAD-%{uts_release}-MP/libafs-%{uts_release}.mp.o ${RPM_BUILD_ROOT}/lib/modules/%{uts_release}smp/kernel/fs/openafs.o
%endif

%if %{build_enterprise}
%ifarch i686
mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{uts_release}enterprise/kernel/fs/ 
install -m 644 src/libafs/MODLOAD-%{uts_release}-ET/libafs-%{uts_release}.o ${RPM_BUILD_ROOT}/lib/modules/%{uts_release}enterprise/kernel/fs/openafs.o
%endif
%endif

# don't restart in %post because kernel modules could well have changed
%post
if [ $1 = 1 ]; then
        /sbin/chkconfig --add afs
fi

%post client
# if this is owned by the package, upgrades with afs running can't work
if [ ! -d /afs ] ; then
        mkdir -m 700 /afs
fi 
exit 0

%preun
if [ "$1" = 0 ] ; then
	/sbin/chkconfig --del afs
	/etc/rc.d/init.d/afs stop && rm -fr /var/cache/openafs/* && rmdir /afs
fi
exit 0

%post devel -p /sbin/ldconfig

%postun devel -p /sbin/ldconfig

%post kernel
/sbin/depmod -a -q %{uts_release}
/sbin/depmod -a -q %{uts_release}smp
%if %{build_enterprise}
%ifarch i686
/sbin/depmod -a -q %{uts_release}enterprise 
%endif
%endif

%clean
rm -fr $RPM_BUILD_ROOT

# sigh... this is disgusting, but we only want to include the base
# bits for base architectures
%ifarch %{basearchs}
%files
%defattr(-, root, root)
%doc src/LICENSE README NEWS README.OBSOLETE README.SECURITY
%config /etc/sysconfig/afs
%config /etc/rc.d/init.d/afs
%{_bindir}/bos
%{_bindir}/fs
%{_bindir}/klog
%{_bindir}/klog.krb
%{_bindir}/pagsh
%{_bindir}/pagsh.krb
%{_bindir}/pts
%{_bindir}/sys
%{_bindir}/tokens
%{_bindir}/tokens.krb
%{_bindir}/udebug
%{_bindir}/unlog
%{_bindir}/up
%{_sbindir}/backup
%{_sbindir}/butc
%{_sbindir}/fstrace
%{_sbindir}/restorevol
%{_sbindir}/vos

%files client
%defattr(-, root, root)
%dir /etc/openafs
%config /etc/openafs/CellServDB
%config /etc/openafs/ThisCell
%config /etc/openafs/cacheinfo
%dir /var/cache/openafs
#/usr/vice/etc
%{_bindir}/cmdebug
%{_bindir}/xstat_cm_test
%{_sbindir}/afsd

%files server
%defattr(-,root,root)
%{_bindir}/afsmonitor
%{_bindir}/scout
%{_bindir}/udebug
%{_bindir}/xstat_fs_test
%{_libexecdir}/openafs
%{_sbindir}/bosserver
%{_sbindir}/copyauth
%{_sbindir}/fms
%{_sbindir}/kseal
%{_sbindir}/prdb_check
%{_sbindir}/pt_util
%{_sbindir}/read_tape
%{_sbindir}/restorevol
%{_sbindir}/uss
%{_sbindir}/vldb_check
%{_sbindir}/vldb_convert
%{_sbindir}/volinfo
# added 3/26/03 -- new afs bins?
%{_sbindir}/bos_util
%{_sbindir}/kadb_check
%{_sbindir}/kas
%{_sbindir}/kdb
%{_sbindir}/kpwvalid
%{_sbindir}/rmtsysd

%files devel
%defattr(-,root,root)
%{_bindir}/rxgen
%{_includedir}/afs
%{_includedir}/rx
%{_includedir}/*.h
%{_libdir}/afs
%{_libdir}/lib*.a
%{_sbindir}/rxdebug
%{_sbindir}/vsys

%files kernel-source
%defattr(-,root,root)
/usr/src/openafs-kernel-%{version}-%{release}
%endif

# include the kernel modules for all architectures
%ifnarch i386
%files kernel
%defattr(-,root,root)
/lib/modules/%{uts_release}/kernel/fs/openafs.o
/lib/modules/%{uts_release}smp/kernel/fs/openafs.o
%endif
%if %{build_enterprise}
%ifarch i686 
/lib/modules/%{uts_release}enterprise/kernel/fs/openafs.o
%endif
%endif

%changelog
* Fri Nov 07 2003 Jack Neely <jjneely@pams.ncsu.edu>
- No longer build i386 kernel modules
- Only build enterprise kernel modules when build_enterprise is true
- Upgraded to Openafs 1.2.10

* Wed Apr 23 2003 Jack Neely <slack@quackmaster.net>
- Upgraded to OpenAFS 1.2.9 final

* Wed Mar 26 2003 Jack Neely <slack@quackmaster.net>
- Built for RHL9

* Fri Jan 10 2003 Jack Neely <slack@quackmaster.net
- Build OpenAFS 1.2.8
- We can now define our sysname list in /etc/sysconfig/afs
- the init script will set above sysname list

* Wed Oct 09 2002 Jack Neely <slack@quackmaster.net>
- Build of OpenAFS 1.2.7
- Incorperated pcb's spec file changes so we now have builds for
  multiple archs, up and smp
- Build for RHL 8.0

* Tue May 28 2002 Jack Neely <slack@quackmaster.net>
- Build of OpenAFS 1.2.4

* Wed May 08 2002 Jack Neely <jjneely@pams.ncsu.edu>
- rebuilt on 2.4.18-3

* Fri Mar 21 2002 Jack Neely <slack@quackmaster.net>
- upgraded to openafs-1.2.3
- rebuilt on 2.4.18-0.4

* Thu Mar 13 2002 Jack Neely <slack@quackmaster.net>
- rebuild on 2.4.9-31
- Added kernel depend on the kernel package

* Sun Oct 21 2001 Jeremy Katz <katzj@redhat.com>
- rebuild on 2.4.9-7
- make kernel subpackage require kernel

* Tue Oct 16 2001 Jeremy Katz <katzj@redhat.com>
- update to 1.2.2 which integrates my patches

* Tue Oct  9 2001 Jeremy Katz <katzj@redhat.com>
- minor scriptlet fixes
- update paths for server bins in initscript
- take network_on function from upstream rc script and tweak

* Sat Oct  6 2001 Jeremy Katz <katzj@redhat.com>
- update to 1.2.1
- add config vars in /etc/sysconfig/afs for cachedir and confdir

* Sat Oct  6 2001 Jeremy Katz <katzj@redhat.com>
- use /etc/openafs instead of /etc/afsws
- switch to using a 100M cache in /var/cache/openafs

* Fri Oct  5 2001 Jeremy Katz <katzj@redhat.com>
- update to 1.2.0, wow that build system has changed a lot
- patch configure.in so that makeinstall will work properly
- use redhat fix stuff (adapted from upstream specfile)
- more complete filelist
- macro-ize
- fixups for the %post, %pre scripts to correspond to the right packages
- fix dirpath.h
- kill /usr/vice/etc
- in theory alpha, ia64, ppc, and s390 builds should work now (untested)
- add kernel-source subpackage

* Mon Apr 30 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- update to 1.0.4 final
- for now, you need to actually change /boot/kernel.h to get modules built
  for arch != arch of kernel running on build host

* Thu Apr 26 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- tweak the defines, maybe it'll work right now :-)

* Wed Apr 25 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- apply patches before making links
- added kernel subpackage with kernel module.  Note that you now need to
  rebuild normally which will get you i386 kernel modules and then rebuild
  with --target=i586 and --target=i686 to get i586 and i686 kernel module 
  packages respectively

* Tue Apr 24 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- add more fixes to look for kernel headers in the right place

* Tue Apr 24 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- merge patches up to openafs CVS from 2001-04-24 to see if it fixes SMP
  problems 

* Tue Apr 10 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- rebuild on 2.4.2-2

* Mon Apr  2 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- rebuild on 2.4.2-0.1.49

* Wed Mar 28 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- rebuild on 2.4.2-0.1.40

* Thu Mar 22 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- rebuild on 2.4.2-0.1.32

* Wed Mar 21 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- rebuild on 2.4.2-0.1.29

* Fri Mar  9 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- update to openafs 1.0.3
- modversions patch is merged so we don't need to apply it now
- merge other patches as needed
- rebuild on 2.4.2-0.1.28

* Thu Mar  8 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- fix typo in the initscript
- rebuild on 2.4.2-0.1.22
- let the %post for the client run depmod for the proper kernel version

* Tue Mar  6 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- new initscript that matches Red Hat init scripts better
- minor specfile tweaks
- rebuild on 2.4.2-0.1.19

* Tue Feb 20 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- really fix #153
- add some minor fixes to the init script

* Mon Feb 19 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- ensure network is up to start (#153)
- rebuild on 2.4.1-0.1.9

* Wed Feb 14 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- resolve bug #148 (thanks to Mike Sklar of Morgan Stanley for suggestions)
  run %posts for the proper subpackages (#148)
  add a %pre to rpmsave /usr/vice/etc (#148)
  add $AFS_MOUNT_POINT to /etc/sysconfig/afs 
- minor init script fixes
- rebuild on 2.4.0-0.99.24

* Thu Feb  8 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- fix unresolved symbols on SMP build
- rebuild on 2.4.0-0.99.23

* Tue Jan 30 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- get /usr/vice/etc right
- clean up the %post and %preun

* Tue Jan 30 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- include modversions patch from Michael Duggan <md5i@cs.cmu.edu>

* Tue Jan 30 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- add a new openafs base package which contains common files
- move lots of stuff around; bins now in /usr/bin and /usr/sbin
  for commonly used bins, modules in /lib/modules/$(uname -r)/kernel/fs
  (some of this is from the upstream openafs spec file)
- new init script which tries to be start and do a few retries on shutdown

* Mon Jan 29 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- don't build a lot of the obsolete stuff (ftpd, inetd, etc)

* Sun Jan 28 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- finally get working with ac kernels.  struct vnode is evil
- rebuild on 2.4.0-0.99.11

* Wed Jan 24 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- patch, patch, patch all day long

* Wed Jan 24 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- patch to fix dirents problem and hang on shutdown
- build on 2.4.0-0.99.10

* Fri Jan 19 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- let's try 1.0.2

* Thu Jan 18 2001 Jeremy Katz <jlkatz@eos.ncsu.edu>
- build 1.0.1 with patch from Chas Williams <chas@cmf.nrl.navy.mil> for 2.4
- next step is cleaning up this package

* Mon Nov  6 2000 Jeremy Katz <jlkatz@eos.ncsu.edu>
- patch from Matt Wilson <msw@redhat.com> to clean up the kernel
  version mangling, add prelim alpha_linux22 support, build lwp with
  kgcc to avoid a compiler bug
- make %thiscell definable for easier builds at other sites

* Thu Nov  2 2000 Jeremy Katz <jlkatz@eos.ncsu.edu>
- conflicts with arla and afs packages

* Thu Nov  2 2000 Jeremy Katz <jlkatz@eos.ncsu.edu>
- initial RPM build (largely based off of NCSU's AFS nosrc spec file)

--GZVR6ND4mMseVXL/--