(no commit message)
[openafs-wiki.git] / HowToBuildOpenAfsRpmPackages.mdwn
1 ## Building RPM packages
2  
3 A script called makesrpm.pl is provided to build a source RPM package.  You can
4 use the generated source RPM to build the binaries and create the RPM packages
5 for your source code tree of OpenAFS.
6
7 The first step is to create a source tree of OpenAFS. Run the regen.sh script
8 to build the docs and to generate the configure script. Also, use git describe
9 to make a version stamp file which will be used by the packaging process. This
10 example shows how to get a source tree from a remote git repo.
11
12     $ git clone git://git.openafs.org/openafs.git openafs-<version>
13     $ cd openafs-<version>
14     $ git checkout <tagname>
15     $ git describe >.version
16     $ ./regen.sh
17
18 The _version_ is the dotted OpenAFS version number, such as 1.6.0,
19 and the _tagname_ is the git tag for the version, such as openafs-stable-1_6_0.
20 The _version_ number for pre-releases are suffixed with pre<number>. For example,
21 to build 1.6.0pre5, create a directory called openafs-1.6.0pre5.
22
23 Next, create a source RPM file. This requires creating a tar file for the
24 source files and a tar file for the documents.  Run the makesrpm program
25 to generate an OpenAFS source RPM.
26 [GPS Tracking](http://vamostech.com/gps-tracking), [Sewa Mobil Jakarta](http://www.awanirentcar.com), [Harga Vertical Blind](http://www.tiraimodern.com/product/vertical-blind), [Properti Semarang](http://www.raywhitesemarang.com), [Glutera](http://www.grosir-kosmetik.com/62-glutera.html)
27
28     $ cd .. # move out of the source tree
29     $ tar cjf openafs-<version>-src.tar.bz2 openafs-<version> --exclude .git --exclude doc
30     $ tar cjf openafs-<version>-doc.tar.bz2 openafs-<version>/doc
31     $ openafs-<version>/src/packaging/RedHat/makesrpm.pl openafs-<version>-src.tar.bz2 openafs-<version>-doc.tar.bz2
32
33 At this point you should have a source RPM called `openafs-<version>-1.0.src.rpm`. See the makesrpm.pl for additional options.
34 The source tree and tar files are no longer needed.
35
36 Finally, run rpmbuild to build the build binary RPM packages. If all goes well, the final
37 output will show the destination directory and an exit code of zero.
38
39     $ rpmbuild --rebuild openafs-<version>-1.0.src.rpm
40     ...
41     + cd /usr/src/redhat/BUILD
42     + rm -rf openafs-<version>
43     + exit 0
44
45 Alternatively, the source RPM may be installed, which will place the sources in the
46 rpm SOURCE directory and a spec file in the rpm SPEC directory.