none
[openafs-wiki.git] / AFSLore / HowToBuildOpenAFSFromSource.mdwn
index aedefa6..eeba0a7 100644 (file)
@@ -19,49 +19,30 @@ These are notes on how to build [[OpenAFS]] from source code. Note that [[OpenAF
 - ncurses
 - kernel headers
 
-The Kerberos development libraries are required if you are going to build with Kerberos 5 support. The [[OpenAFS]] legacy kaserver is deprecated.
-
-If you are building on Debian, you can get the required software with the following apt-get commands.
+The required packages to build [[OpenAFS]] on Debian-based linux distributions can be installed with,
 
       apt-get install cvs autoconf automake make gcc flex bison
       apt-get install libc6-dev libkrb5-dev libncurses5-dev linux-headers-$(uname -r)
 
-### <a name="Getting the Source Code from CVS"></a> Getting the Source Code from CVS
-
-You can get development snapshots from the [[OpenAFS]] CVS repository . The CVS tree may not always have code which can currently be built. While every effort is made to keep the head of the tree buildable, you may at any time find yourself between commits and hence have a tree which does not build, or worse, causes more serious problems.
-
-First you need to run cvs login. This step is normally only done once. A ~/.cvspass file will be created for additional checkouts.
-
-       cvs -d :pserver:anonymous@cvs.openafs.org:/cvs  login
-       password is anonymous
-
-Before doing a CVS check out, you'll need to decide which branch you want to check out. The trunk is for bleeding edge development and may not even build. The current stable series is openafs-stable-1\_4\_x and the current development work is going on the openafs-devel-1\_5\_x branch.
-
-See the CVSWeb interface at <http://www.openafs.org/frameset/cgi-bin/cvsweb.cgi/openafs/> for the full list of available branches and tags.
-
-To check out the stable branch:
-
-       cvs -d :pserver:anonymous@cvs.openafs.org:/cvs checkout -r openafs-stable-1_4_x -d openafs-stable-1_4_x openafs
-
-This will create a source tree in a directory named openafs-stable-1\_4\_x.
-
-To check out the development branch:
+On RPM based linux distributions, the packages required are,
 
-       cvs -d :pserver:anonymous@cvs.openafs.org:/cvs checkout -r openafs-devel-1_5_x -d openafs-devel-1_5_x openafs
+     yum install gcc autoconf automake make flex bison rpm-build
+     yum install glibc-devel krb5-devel ncurses-devel pam-devel kernel-devel
 
-This will create a source tree in a directory named openafs-devel-1\_5\_x.
+### <a name="Getting the Source Code"></a> Getting the Source Code
 
-Next, step into your sandbox and run the regen.sh script to create the configure script.
+Snapshots of the [[OpenAFS]] source code is made available for each stable and each development release at <http://openafs.org>.
 
-       cd openafs-stable-1_4_x.
-       ./regen.sh
+The [[OpenAFS]] code base is now available from a Git repository. See [[GitDevelopers]] for more information.
 
 ### <a name="Building the Binaries"></a> Building the Binaries
 
 #### <a name="Modern Paths"></a> Modern Paths
 
-To build [[OpenAFS]] with Kerberos 5 support, and with a custom install path,
+To build [[OpenAFS]] with Kerberos 5 support, and with a custom install path. Be sure to run ./regen.sh to generate the configure script.
 
+       cd openafs-stable-1_4_x.
+       ./regen.sh
        ./configure --prefix=/usr/local/openafs --with-krb5-conf=(full path to krb5-config script)
        make
        sudo make install
@@ -95,9 +76,19 @@ The 'make install' command does not work with Transarc paths. You will have to m
       # cp -r i386_linux26/dest/lib /usr/afsws
       # cp -r i386_linux26/dest/root.server/usr/afs/* /usr/afs
 
+#### <a name="Building RPMs"></a> Building RPMs
+
+The makesrpm.pl script, available in the directory src/packaging/RedHat, is used to build [[OpenAFS]] rpm packages. First build a srpm file using makesrpm.pl, then run rpmbuild to build and package the binaries. makesrpm.pl builds a srpm from the source and document tar files,
+
+    makesrpm.pl openafs-<version>-src.tar.bz2 openafs-<version>-doc.tar.bz2
+
+This will create the srpm file openafs-.src.rpm. Use rpmbuld with the --rebuild option, which will run configure and then make to build the binaries, and create the rpm files. The rpm files will be placed into /usr/src/redhat/
+
+    rpmbuild --rebuild openafs-<version>.src.rpm
+
 ### <a name="Running the Test Suite"></a> Running the Test Suite
 
-[[OpenAFS]] includes a suite of basic test scripts in the src/tests directory. The tests directory also contains a utility called afs-newcell.pl to create a test cell on a single host. You will need to already have a kerberos server running with an AFS principal and an admin principal. You should also have a separate partition mounted as /vicepa for the test volumes. See the src/tests/afs-newcell.pl for details.
+[[OpenAFS]] includes a suite of basic test scripts in the src/tests directory. The tests directory also contains a utility called afs-newcell.pl to create a test cell on a single host. You will need to already have a kerberos server running with an AFS principal and an admin principal. You should also have a partitions mounted as /vicepa and /vicepb for the test volumes. See the src/tests/afs-newcell.pl for details.
 
 The paths to the binaries and AFS configuration is are written to src/tests/OpenAFS/Dirpaths.pm when the tests are built. This means you must run 'make all' in src/tests before attempting to use afs-newcell.pl. The afs-newcell.pl program must be run as root.
 
@@ -105,7 +96,9 @@ The paths to the binaries and AFS configuration is are written to src/tests/Open
       make all
       sudo perl afs-newcell.pl
 
-The afs-newcell.pl program will prompt for the required cell configuration unless started with the --batch options. You will need to specify the name of your new cell, the host name of this machine, the target partition id (a for /vicepa), and the username of the AFS administrator (which is admin by default). You will also need to provide the type of Kerberos server to be used, the name of the Kerberos realm (which can be different than the AFS cell name), and the location of the keytab file that contains the AFS server encryption key and the admin's encryption key. Finally, you may provide any server options for the AFS database and fileservers.
+The afs-newcell.pl program will prompt for the required cell configuration unless started with the --batch options. You will need to specify the name of your new cell, the host name of this machine, the target partition id (a for /vicepa), and the username of the AFS administrator (which must be named 'admin' for the current pts tests).
+
+You will also need to provide the type of Kerberos server, the name of the Kerberos realm (which can be different than the AFS cell name), and the location of the keytab file that contains the AFS server encryption key and the admin's encryption key. Finally, you may provide any server options for the AFS database and fileservers.
 
     Server options:
     What server name should be used? [host.domain.com]
@@ -146,4 +139,4 @@ The output will look something like this,
     -----------------------------------------------------------
     Failed test(s) were:  write-large write-ro ...
 
--- [[MichaelMeffie]] - 09 Oct 2007
+-- [[MichaelMeffie]] - 26 Mar 2008