Quick Start for FC4 or FC5

From Codawiki

Table of contents

Assumptions

You have a non-root user with which to build the RPM packages. The coda kernel module should already be included in all recent kernels.

If you'd prefer to work from CVS, look here: http://www.coda.cs.cmu.edu/rt/Ticket/Display.html?id=1529

Goal

The basic plan follows:

  • Download and install the SRPM files
  • Patch them to compile nicely on FC4/5
  • Build them into normal RPMs and install them in order

We assume you have a ~/.rpmmacros file. If not, create one with contents like the following:

%packager First Last (username@example.com)
%_topdir /home/username/rpm

We also assume you have a place for RPM files to be processed. If not, create them, thusly:

mkdir $HOME/rpm
mkdir $HOME/rpm/BUILD
mkdir $HOME/rpm/SOURCES
mkdir $HOME/rpm/SPECS
mkdir $HOME/rpm/SRPMS
mkdir $HOME/rpm/RPMS
mkdir $HOME/rpm/RPMS/i386

Build the Coda client

  • Login as yourself, or the user doing the build and download the SRPMS from Coda mirror site (http://www.coda.cs.cmu.edu/mirrors.html). coda-debug-6.0.14-1.src.rpm, lwp-2.1-1.src.rpm, rpc2-1.28-1.src.rpm and rvm-1.11-1.src.rpm.
  • Save the following text to ~/coda-fedora.patch:
diff -Naur rpm-coda/SOURCES/coda-6.0.14-1-FC5.patch rpm-fixed/SOURCES/coda-6.0.14-1-FC5.patch
--- rpm-coda/SOURCES/coda-6.0.14-1-FC5.patch    1969-12-31 19:00:00.000000000 -0500
+++ rpm-fixed/SOURCES/coda-6.0.14-1-FC5.patch   2006-04-04 20:32:15.000000000 -0400
@@ -0,0 +1,84 @@
+diff -Naur coda-6.0.14/coda-src/venus/comm.h coda-6.0.14-2/coda-src/venus/comm.h
+--- coda-6.0.14/coda-src/venus/comm.h  2005-06-15 22:05:27.000000000 -0400
++++ coda-6.0.14-2/coda-src/venus/comm.h        2006-04-04 20:31:01.000000000 -0400
+@@ -316,7 +316,7 @@
+     virtual void main(void); /* entry point */
+ 
+   public:
+-    probeslave::probeslave(ProbeSlaveTask, void *, void *, char *);
++    probeslave(ProbeSlaveTask, void *, void *, char *);
+ };
+ 
+ /*  *****  Variables  *****  */
+diff -Naur coda-6.0.14/coda-src/venus/fso.h coda-6.0.14-2/coda-src/venus/fso.h
+--- coda-6.0.14/coda-src/venus/fso.h   2005-08-29 16:58:43.000000000 -0400
++++ coda-6.0.14-2/coda-src/venus/fso.h 2006-04-04 20:31:01.000000000 -0400
+@@ -692,7 +692,7 @@
+     void RemoveShadow();
+     void CacheReport(int, int);
+ 
+-    int /*(secs)*/ fsobj::EstimatedFetchCost(int =1);  /* 0 = status; 1 = data (default) */
++    int /*(secs)*/ EstimatedFetchCost(int =1);  /* 0 = status; 1 = data (default) */
+     void RecordReplacement(int, int);
+ 
+     void print() { print(stdout); }
+diff -Naur coda-6.0.14/coda-src/venus/mgrp.h coda-6.0.14-2/coda-src/venus/mgrp.h
+--- coda-6.0.14/coda-src/venus/mgrp.h  2003-05-23 14:27:11.000000000 -0400
++++ coda-6.0.14-2/coda-src/venus/mgrp.h        2006-04-04 20:31:01.000000000 -0400
+@@ -24,6 +24,9 @@
+ #include <vcrcommon.h>
+ #include "refcounted.h"
+ 
++void Mgrp_Wait(void);
++void Mgrp_Signal(void);
++
+ class mgrpent;
+ class fsobj;
+ class repvol;
+diff -Naur coda-6.0.14/coda-src/venus/vsg.h coda-6.0.14-2/coda-src/venus/vsg.h
+--- coda-6.0.14/coda-src/venus/vsg.h   2004-05-07 14:19:17.000000000 -0400
++++ coda-6.0.14-2/coda-src/venus/vsg.h 2006-04-04 20:31:01.000000000 -0400
+@@ -38,6 +38,7 @@
+ class vsgent : private RefCountedObject {
+     friend class vsgdb;
+     friend class mgrpent;
++    friend void Mgrp_Wait();
+ 
+ private:
+     unsigned int nhosts; /* number of replica servers in this VSG */
+diff -Naur coda-6.0.14/coda-src/venus/worker.h coda-6.0.14-2/coda-src/venus/worker.h
+--- coda-6.0.14/coda-src/venus/worker.h        2003-05-23 14:27:21.000000000 -0400
++++ coda-6.0.14-2/coda-src/venus/worker.h      2006-04-04 20:31:01.000000000 -0400
+@@ -52,6 +52,7 @@
+ #include "fso.h"
+ #include "vproc.h"
+ 
++int WorkerCloseMuxfd();
+ 
+ class msgent;
+ class msg_iterator;
+diff -Naur coda-6.0.14/coda-src/vice/Makefile.in coda-6.0.14-2/coda-src/vice/Makefile.in
+--- coda-6.0.14/coda-src/vice/Makefile.in      2005-06-15 22:05:28.000000000 -0400
++++ coda-6.0.14-2/coda-src/vice/Makefile.in    2006-04-04 20:31:01.000000000 -0400
+@@ -63,7 +63,8 @@
+       clientproc.o    \
+       vicecb.o        \
+       smon.o          \
+-      ViceErrorMsg.o
++      ViceErrorMsg.o  \
++      ../vicedep/voldump.client.o
+ 
+ codasrv: ${objects} srv.o ${DEPLIBS}
+       $(CXX) $(LDFLAGS) srv.o ${objects} ${SRVLIBS} -o codasrv
+diff -Naur coda-6.0.14/coda-src/volutil/readstuff.cc coda-6.0.14-2/coda-src/volutil/readstuff.cc
+--- coda-6.0.14/coda-src/volutil/readstuff.cc  2005-08-29 16:58:46.000000000 -0400
++++ coda-6.0.14-2/coda-src/volutil/readstuff.cc        2006-04-04 20:31:01.000000000 -0400
+@@ -71,7 +71,7 @@
+ #include <vutil.h>
+ #include <partition.h>
+ #include "dump.h"
+-#include "voldump.h"
++#include "../vicedep/voldump.h"
+ 
+ /* Facts: if (offset = 0), the buffer hasn't been filled yet.
+  * If DumpBufPtr+size >= BufEnd, need to refill the buffer.
diff -Naur rpm-coda/SPECS/coda-debug-6.0.14-1.spec rpm-fixed/SPECS/coda-debug-6.0.14-1.spec
--- rpm-coda/SPECS/coda-debug-6.0.14-1.spec     2005-10-28 11:46:10.000000000 -0400
+++ rpm-fixed/SPECS/coda-debug-6.0.14-1.spec    2006-04-04 20:34:26.000000000 -0400
@@ -5,7 +5,8 @@
 Version: %{version}
 Release: 1
 Source: ftp://ftp.coda.cs.cmu.edu/pub/coda/src/coda-%{version}.tar.gz
-Copyright: GPL
+Patch0: coda-6.0.14-1-FC5.patch
+License: GPL
 BuildRoot: %{_builddir}/coda-build
 #BuildRequires: lwp-devel >= 2.0, ncurses-devel, rpc2-devel, rvm-devel, libtermcap-devel
 Group: Networking/Daemons
@@ -15,7 +16,6 @@
 you must install a kernel module, or have a Coda enabled kernel, and 
 you should get the Coda documentation package.
 
-
 %package client
 Summary: Coda client
 Group: Networking/Daemons
@@ -71,9 +71,9 @@
        
 %prep
 %setup -n coda-%{version}
+%patch0 -p1
 
 %build
-chown -R root.bin $RPM_BUILD_DIR/coda-%{version}
 cd $RPM_BUILD_DIR/coda-%{version}
 [ -x configure ] || ./bootstrap.sh
 rm -rf $RPM_BUILD_DIR/obj-%{version}
@@ -113,7 +113,7 @@
    strip $RPM_BUILD_ROOT/usr/bin/* $RPM_BUILD_ROOT/vice/bin/* $RPM_BUILD_ROOT/usr/sbin/* || :
 fi
 
-chown -R root.root $RPM_BUILD_ROOT
+#chown -R root.root $RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -160,6 +160,7 @@
 /sbin/chkconfig --del codasrv.init
 
 %files client
+%defattr(-,root,root)
 %dir /usr/coda
 %dir /usr/coda/etc
 %dir /usr/coda/venus.cache
@@ -211,6 +212,7 @@
 /usr/share/man/man8/volmunge.8.gz
 
 %files server  
+%defattr(-,root,root)
 /etc/coda/server.conf.ex
 /usr/sbin/auth2
 /usr/sbin/bldvldb.sh
@@ -272,6 +274,7 @@
 /etc/rc.d/init.d/update.init
 
 %files backup
+%defattr(-,root,root)
 /usr/sbin/auth2
 /usr/sbin/backup
 /usr/sbin/backup.sh
@@ -289,4 +292,5 @@
 /usr/share/man/man8/readdump.8.gz
 
 %files vcodacon
+%defattr(-,root,root)
 /usr/bin/vcodacon
diff -Naur rpm-coda/SPECS/lwp.spec rpm-fixed/SPECS/lwp.spec
--- rpm-coda/SPECS/lwp.spec     2005-09-15 11:50:06.000000000 -0400
+++ rpm-fixed/SPECS/lwp.spec    2006-04-04 07:23:05.000000000 -0400
@@ -3,7 +3,7 @@
 Version: 2.1
 Release: 1
 Source: ftp://ftp.coda.cs.cmu.edu/pub/coda/src/lwp-2.1.tar.gz
-Copyright: LGPL
+License: LGPL
 Group: Development/Libraries
 BuildRoot: %{_builddir}/lwp-2.1/Root
 %description
@@ -46,7 +46,7 @@
 
 %files
 %attr(-,root,root)
-/usr/lib/liblwp.so.2.0.5
+/usr/lib/liblwp.so.2*
 
 %files devel
 %attr(-,root,root)
diff -Naur rpm-coda/SPECS/rpc2.spec rpm-fixed/SPECS/rpc2.spec
--- rpm-coda/SPECS/rpc2.spec    2005-09-15 11:57:20.000000000 -0400
+++ rpm-fixed/SPECS/rpc2.spec   2006-04-04 08:14:49.000000000 -0400
@@ -3,8 +3,8 @@
 Version: 1.28
 Release: 1
 Source: ftp://ftp.coda.cs.cmu.edu/pub/coda/src/rpc2-1.28.tar.gz
-Copyright: LGPL
-BuildRoot: %{_buildroot}/rpc2-1.28/Root
+License: LGPL
+BuildRoot: %{_builddir}/rpc2-1.28/Root
 Group: Development/Libraries
 %description
 The RPC2 library.
@@ -46,9 +46,9 @@
 %files
 %defattr(-,root,root)
 /usr/bin/filcon
-/usr/lib/libfail.so.4.2.7
-/usr/lib/librpc2.so.4.2.7
-/usr/lib/libse.so.4.2.7
+/usr/lib/libfail.so.4*
+/usr/lib/librpc2.so.4*
+/usr/lib/libse.so.4*
 
 %files devel
 %defattr(-,root,root)
diff -Naur rpm-coda/SPECS/rvm.spec rpm-fixed/SPECS/rvm.spec
--- rpm-coda/SPECS/rvm.spec     2005-04-25 14:29:26.000000000 -0400
+++ rpm-fixed/SPECS/rvm.spec    2006-04-04 08:02:06.000000000 -0400
@@ -3,7 +3,7 @@
 Version: 1.11
 Release: 1
 Source: ftp://ftp.coda.cs.cmu.edu/pub/coda/src/rvm-1.11.tar.gz
-Copyright: LGPL
+License: LGPL
 BuildRoot: %{_builddir}/rvm-1.11/Root
 Group: Development/Libraries
 %description
@@ -53,11 +53,11 @@
 
 %files
 %defattr(-,root,root)
-/usr/lib/librvm.so.1.2.1
-/usr/lib/librvmlwp.so.1.2.1
-/usr/lib/libseg.so.1.2.1
-/usr/lib/librds.so.1.2.1
-/usr/lib/librdslwp.so.1.2.1
+/usr/lib/librvm.so.1*
+/usr/lib/librvmlwp.so.1*
+/usr/lib/libseg.so.1*
+/usr/lib/librds.so.1*
+/usr/lib/librdslwp.so.1*
 
 %files tools
 %defattr(-,root,root)

Then,

rpm -ivh coda-debug-6.0.14-1.src.rpm lwp-2.1-1.src.rpm rpc2-1.28-1.src.rpm rvm-1.11-1.src.rpm
cd ~/rpm
patch -p1 < coda-fedora.patch

Then,

cd ~/rpm/SPECS
rpmbuild -ba lwp.spec
  • As root, go to where the the finished RPM is (probably ~username/rpm/RPMS/i386/ or /usr/src/redhat/RPMS/i386), then
rpm -ivh lwp-*.i386.rpm lwp-devel-*.i386.rpm
  • Back as username,
rpmbuild -ba rvm.spec
  • As root,
rpm -ivh rvm-*.i386.rpm rvm-tools-*.i386.rpm rvm-devel-*.i386.rpm
  • Back as username,
rpmbuild -ba rpc2.spec
  • As root,
rpm -ivh rpc2-*.i386.rpm rpc2-devel-*.i386.rpm
  • Back as username,
rpmbuild -ba coda-debug-6.0.14-1.spec

Install and initialize the Coda client

  • As root,
rpm -ivh coda-debug-client-*.i386.rpm
venus-setup "example.org"

(replacing example.org with your Coda domain, of course!)