none
[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 Run the regen.sh script to create the configure script.
53
54        cd openafs
55        ./regen.sh
56
57 ### <a name="Building the Binaries"></a> Building the Binaries
58
59 #### <a name="Transarc Paths"></a> Transarc Paths
60
61 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. To build with the Transarc paths, specify --enable-transarc-paths as a configure option.
62
63 There are a couple of side effects that you need need to be aware of when building with the --enable-transarc-paths mode. First of all, the typical make install target does not work in this mode. Instead the 'make dest' target is used to build a directory of the binaries to be copied to the target system. Secondly, the packaging targets are not executed, so for example the redhat spec file is not generated to build the rpms.
64
65 To build with Keberos support (recommended), you'll need to have the Keberos development libraries, and if available for your platform, the krb5-config. You will need the full path the the krb5-config script. For example
66
67        which krb5-config
68        /user/bin/krb5-config
69
70 To build [[OpenAFS]] with Kerberos 5 support and the Transarc path conventions:
71
72        ./configure  --enable-transarc-paths --with-krb5-conf=/usr/bin/krb5-config
73        make
74        make dest
75
76 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'.
77
78 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.
79
80       # cp -r i386_linux26/dest/root.client/usr/vice/etc/modload /usr/vice/etc
81       # cp i386_linux26/dest/root.client/usr/vice/etc/afsd /usr/vice/etc
82       # cp -r i386_linux26/dest/bin /usr/afsws
83       # cp -r i386_linux26/dest/etc /usr/afsws
84       # cp -r i386_linux26/dest/include /usr/afsws
85       # cp -r i386_linux26/dest/lib /usr/afsws
86       # cp -r i386_linux26/dest/root.server/usr/afs/* /usr/afs
87
88 #### <a name="Stardard Paths"></a> Stardard Paths
89
90 To build [[OpenAFS]] with Kerberos 5 support, and with a custom install path,
91
92        ./configure --prefix=/usr/local/openafs --with-krb5-conf=(full path to krb5-config script)
93        make
94        sudo make install
95
96 ### <a name="Initial testing"></a> Initial testing
97
98 -- [[MichaelMeffie]] - 09 Oct 2007