db9c63d1a9a22a791472ba6bad217a28aff439a0
[openafs-wiki.git] / AFSLore / HowToBuildOpenAFSFromSource.mdwn
1 This is a guide on how to build [[OpenAFS]] from source code. Note that [[OpenAFS]] pre-built binaries are available on the [[OpenAFS]] site and are available as prebuilt packages for many platforms. These instructions may be useful for you if you need to build [[OpenAFS]] from source.
2
3 ### <a name="Requirements"></a> Requirements
4
5 Tools
6
7 - cvs client
8 - autoconf
9 - automake
10 - perl 5.6
11 - gcc (versions?)
12 - GNU make
13 - lex/yacc (flex/bison)
14
15 Libraries
16
17 - libc
18 - kerberos, optional, but recommended
19 - ncurses
20 - kernel headers
21
22 The Kerberos development libraries are required if you are going to build with Kerberos 5 support. The [[OpenAFS]] legacy kaserver is deprecated.
23
24 If you are building on Debian, you can get the required software with the following apt-get commands.
25
26       apt-get install cvs autoconf automake make gcc flex bison
27       apt-get install libc6-dev libkrb5-dev libncurses5-dev linux-headers-$(uname -r)
28
29 ### <a name="Getting the Source Code from CVS"></a> Getting the Source Code from CVS
30
31 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.
32
33 First you need to run cvs login. This step is normally only done once. A ~/.cvspass file will be created for additional checkouts.
34
35        cvs -d :pserver:anonymous@cvs.openafs.org:/cvs  login
36        password is anonymous
37
38 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.
39
40 See the CVSWeb interface at <http://www.openafs.org/frameset/cgi-bin/cvsweb.cgi/openafs/> for the full list of available branches and tags.
41
42 To check out the stable branch:
43
44        cvs -d :pserver:anonymous@cvs.openafs.org:/cvs checkout -r openafs-stable-1_4_x openafs
45
46 To check out the development branch:
47
48        cvs -d :pserver:anonymous@cvs.openafs.org:/cvs checkout -r openafs-devel-1_5_x openafs
49
50 This will create a source tree in a directory named openafs.
51
52 ### <a name="Building the Binaries"></a> Building the Binaries
53
54 #### <a name="Transarc Paths"></a> Transarc Paths
55
56 By convention, [[OpenAFS]] server binaries and related files are located in /usr/afs, and client binaries and related files are located in /usr/vice. These are known as Transarc paths, so called because that is is the convention used by Transarc, the company that first commercialized AFS.
57
58 To build [[OpenAFS]] with Kerberos 5 support and the traditional, Transarc paths:
59
60        cd openafs
61        ./regen.sh
62        ./configure  --enable-transarc-paths --with-krb5-conf=(full path to krb5-config script)
63        make
64        make dest
65
66 If all goes well, then the binaries are located in a platform sub-directory, the name of which is platform specific, for example 'i386\_linux26/dest'.
67
68 The 'make install' command does not work with Transarc paths. You will have to manually copy the binaries into place after running make dest. For more information, see the Quick Start Guide for Unix on the [[OpenAFS]] documentation page.
69
70       # cp -r i386_linux26/dest/root.client/usr/vice/etc/modload /usr/vice/etc
71       # cp i386_linux26/dest/root.client/usr/vice/etc/afsd /usr/vice/etc
72       # cp -r i386_linux26/dest/bin /usr/afsws
73       # cp -r i386_linux26/dest/etc /usr/afsws
74       # cp -r i386_linux26/dest/include /usr/afsws
75       # cp -r i386_linux26/dest/lib /usr/afsws
76       # cp -r i386_linux26/dest/root.server/usr/afs/* /usr/afs
77
78 #### <a name="Custom Paths"></a> Custom Paths
79
80 To build [[OpenAFS]] with Kerberos 5 support, and with a custom install path,
81
82        cd openafs
83        ./regen.sh
84        ./configure --prefix=/usr/local/openafs --with-krb5-conf=(full path to krb5-config script)
85        make
86        sudo make install
87
88 ### <a name="Initial testing"></a> Initial testing
89
90 -- [[MichaelMeffie]] - 09 Oct 2007