binaries.txt: converted to markdown
[citadel.git] / citadel / docs / binaries.md
1
2 # BUILDING THE CITADEL SYSTEM WITH PRIVATE LIBRARIES
3
4 This method is known to work on Linux and FreeBSD systems.  It is a way of
5 building the Citadel system with its own private copy of Berkeley DB.  This
6 avoids conflicts with any other version of these libraries which may already
7 exist on your host system.
8
9 You can perform your builds in any directory (such as `/usr/src` or even your
10 home directory).  The target directories will be:
11
12 * `/usr/local/citadel`           (Citadel server, text client, utilities)
13 * `/usr/local/webcit`            (the WebCit front end)
14 * `/usr/local/ctdlsupport`       (libdb, libcitadel, and their headers, etc.)
15
16 If you're running the containerized distribution of Citadel, or have done
17 the Easy Install script, your installation is based on this methodology.
18
19 1. Unpack the Berkeley DB tarball.  chdir to the `build_unix` directory
20    and build the package with these commands:
21  ```
22  ../dist/configure --prefix=/usr/local/ctdlsupport
23  make
24  make install
25  ```
26
27 2. Unpack the libical tarball and build it with these commands:
28  ```
29  ./configure --prefix=/usr/local/ctdlsupport
30  make
31  make install
32  ```
33  
34 3. Set these environment variables for the rest of the build.
35    (This assumes you're using the 'bash' shell.  Otherwise you're on your own.)
36 ```
37 export CFLAGS='-I/usr/local/ctdlsupport/include'
38 export CPPFLAGS='-I/usr/local/ctdlsupport/include'
39 export LDFLAGS='-L/usr/local/ctdlsupport/lib -Wl,--rpath -Wl,/usr/local/ctdlsupport/lib'
40  ```
41  
42 `-L` tells the build system where to find libraries during the build process,
43 while `-Wl,--rpath` inserts that same library path into the Citadel binaries
44 so they know where to find the libs at runtime.  Since we can't depend on
45 the correct version of Berkeley DB already being on the system, this is how
46 we carry our own along.  It's better than static linking everything.
47
48 4. If LDAP support is required, unpack the OpenLDAP tarball and build with:
49 ```
50 ./configure --prefix=/usr/local/ctdlsupport --with-db=/usr/local/ctdlsupport
51 make
52 make depend
53 make install
54 ```
55
56 5. Now you're ready to build the Citadel server.  Unpack the Citadel tarball
57    and build it with these commands:
58 ```
59 ./configure --prefix=/usr/local/citadel --with-db=/usr/local/ctdlsupport
60 make
61 make install
62  ```
63  
64 *NOTE:* if you already have a Citadel server in `/usr/local/citadel`, change
65 the `make install` to `make upgrade`.  And I'm sure you remembered to shut
66 down your Citadel service and make a backup before starting, right?
67
68 6. Finally, unpack the WebCit tarball and build it with these commands:
69 ```
70 ./configure --prefix=/usr/local/webcit
71 make
72 make install
73 ```
74
75 All of your software is now in place.  Run `/usr/local/citadel/setup` to configure
76 the Citadel server, and `/usr/local/webcit/setup` to configure WebCit.  If you are
77 on a Linux machine, setup will tweak /etc/inittab to automatically start the
78 services.  If you are on a FreeBSD machine, you will need to manually configure
79 your startup scripts to start the services.