1 # Building RPM packages for OpenAFS
3 This pages describes how to build OpenAFS client and server packages for RHEL
4 and CentOS using the contributed RPM spec file available in the OpenAFS source
5 tree. Packages may be built from the OpenAFS release tar files or from a clone
6 of the OpenAFS git repository.
8 ## How to build release packages from an OpenAFS source distribution
10 The OpenAFS project provides releases as [source code distributions][3]. A
11 source RPM (src.rpm) file can easily be built from a source distribution
12 release, which can then be used to build rpm packages.
14 Step 1. Download the source distribution files.
16 Four files are provided in a release; source tarball, documentation tarball,
17 release notes, and a change log.
19 $ wget https://www.openafs.org/dl/openafs/1.8.5/openafs-1.8.5-src.tar.bz2
20 $ wget https://www.openafs.org/dl/openafs/1.8.5/openafs-1.8.5-doc.tar.bz2
21 $ wget https://www.openafs.org/dl/openafs/1.8.5/RELNOTES-1.8.5
22 $ wget https://www.openafs.org/dl/openafs/1.8.5/ChangeLog
24 Step 2. Extract the packaging files.
26 Extract packaging files contained in the source tarball.
28 $ tar xf openafs-1.8.5-src.tar.bz2 openafs-1.8.5/src/packaging/RedHat
30 Step 3. Run build the source rpm.
32 Run the provided `makesrpm.pl` script to build the source rpm files from the
35 $ ./openafs-1.8.5/src/packaging/RedHat/makesrpm.pl \
36 openafs-1.8.5-src.tar.bz2 \
37 openafs-1.8.5-doc.tar.bz2 \
41 SRPM is openafs-1.8.5-1.src.rpm
43 Step 4: Build the rpm packages.
45 $ rpmbuild --rebuild -bb --define "_topdir $(pwd)/rpmbuild" openafs-1.8.5-1.src.rpm
48 ## How to build release packages from git
50 The following commands show how to build RPM packages from a git checkout of a
51 released version of OpenAFS. The following commands build RPM packages from a
54 $ git clone git://git.openafs.org/openafs.git
56 $ git checkout <openafs-release-tag> # e.g., openafs-stable-1_8_5
59 $ ./configure # configure options are not required here.
60 $ make dist # creates the source distribution in ./packages
61 $ make srpm # get the source rpm name from the output
63 $ rpmbuild --rebuild -ba --define "_topdir $(pwd)/packages/rpmbuild" packages/<name>.src.rpm
65 The RPM packages will be created in the `packages/rpmbuild/RPMS` directory. See
66 the RPM spec file in src/packaging/RedHat for `--define` options for optional
67 features and packages.
69 Note: One downside to this method is the RELNOTES and ChangeLog from the
70 OpenAFS release download page are not included in the built packages.
72 ## How to build release packages with afsutil
74 The contributed `afsutil`[1] script can be used to build packages from a git
75 checkout. This tool is a front-end with various options to support building
76 client and server packages from release tags as well as non-release commits.
77 `afsutil` is available on [PyPI][2] and [github][1]
82 $ git clone git://git.openafs.org/openafs.git
84 $ git checkout <tag> # e.g., openafs-stable-1_8_5
86 $ afsutil package [options]
88 The RPM packages will be created in the `packages/rpmbuild/RPMS` directory.
90 Some commonly used `afsutil package` options are:
92 --version=<custom-version> # for testing or building custom versions
93 --csdb=<path-to-custom-CellServDB-file>
94 --spec=<path-to-custom-openafs-spec-file>
95 --build=<what to build, one of: all, sources, srpm, userspace, kmods>
96 --kernel-version=<kernel-version> # may be given more than once
98 See `afsutil package --help` for a complete list of options.
101 ## A note about version strings
103 RPM packages require a valid version string and package release number. If you
104 are building packages for a non-release version (or not a pre-release), you
105 will need to set a customized version string in the spec file.
107 For example, perhaps you want to make changes and build packages for testing,
108 or perhaps you wish to deploy packages with custom changes or fixes. In these
109 cases you will need to provide a customized version string.
111 Specify your customer version string in the `.version` file to generate a
112 `openafs.spec` file with your desired version. If you are using the `afsutil
113 package` contributed script, use the `--version` option to specify your custom
117 [1]: https://github.com/openafs-contrib/afsutil
118 [2]: https://pypi.org/project/afsutil/
119 [3]: https://www.openafs.org/release/