r14654@tombo: nickm | 2007-11-02 12:05:39 -0400
[tor.git] / doc / tor-rpm-creation.txt
blob9597cca5f6ea8c38de2c372163a0d3820f7f6fb3
1 ## Instructions for building the official rpms.
2 ## 
3 These are instructions for building Tor binaries in the rpm format on
4 various cpu architectures and operating systems.  Each rpm will require
5 glibc on the target system.  It is believed that any rpm-based linux
6 distribution should have semi-current glibc installed by default.
7 If you run into a distribution that does not work with glibc, or does
8 not contain it, please let us know the details.
10 These are the exact steps used to build the official rpms of Tor.
12 If you wish to further tune Tor binaries in rpm format beyond this list,
13 see the GCC doc page for further options:
14 http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/
16 The tor.spec.in file contains the basic info needed to tune the binaries
17 produced in rpm format. The key parameters to tune are located in the
18 third section of the tor.spec.in file.  Locate the section similar to
19 this:
21 ## Target a specific arch and OS
23 # default is i386 linux
24 %define target gnu
25 %define target_cpu i386
26 %define target_os linux
28 The three parameters: target, target_cpu, and target_os are used
29 throughout the "make dist-rpm" process.  They control the parameters
30 passed to "configure" and the final tuning of the binaries produced.
31 The default settings, as shown above, create binaries for the widest
32 range of Intel x86 or x86-compatible architectures.
34 The parameters can be set as follows:
36 The "target" parameter:
37 This should be "gnu", "redhat", or the short name of your linux distribution.
38 Other possibilities are "mandrake" or "suse".  This is passed to
39 "configure" through the --host, --build, and --target parameters.
40 Therefore, this "target" parameter must be a valid OS for "configure" as
41 well.
43 The "target_cpu" parameter:
44 This parameter controls the optimization and tuning of your binaries via
45 gcc and "configure".  This parameter is passed to gcc via the -mtune= or
46 -mcpu= options.  The "configure" script will also receive this parameter
47 through the --host, --build, and --target parameters.  Therefore, this
48 "target_cpu" parameter must be valid for both gcc and "configure".  A
49 few common options for this parameter may be "athlon64, i686, pentium4" or
50 others.
52 The "target_os" parameter:
53 This parameter controls the target operating system.  Normally, this is
54 only "linux".  If you wish to build rpms for a non-linux operating
55 system, you can replace "linux" with your operating system.