X-Git-Url: http://git.openafs.org/?p=openafs-wiki.git;a=blobdiff_plain;f=HowToBuildOpenAfsRpmPackages.mdwn;h=80cb70606ba1193fe0d7235ecbe618d2eb29cb89;hp=819ce8a38472ea8e0e055bbce2edee41c0d0786d;hb=a3f6f7c314daa936a9af8643bc7b2a8a924fc21b;hpb=305e1d6b08fabec00da5004aafd2ee15c3c7a38b diff --git a/HowToBuildOpenAfsRpmPackages.mdwn b/HowToBuildOpenAfsRpmPackages.mdwn index 819ce8a..80cb706 100644 --- a/HowToBuildOpenAfsRpmPackages.mdwn +++ b/HowToBuildOpenAfsRpmPackages.mdwn @@ -1,46 +1,23 @@ -## Building RPM packages - -A script called makesrpm.pl is provided to build a source RPM package. You can -use the generated source RPM to build the binaries and create the RPM packages -for your source code tree of OpenAFS. +# Building RPM packages for OpenAFS -The first step is to create a source tree of OpenAFS. Run the regen.sh script -to build the docs and to generate the configure script. Also, use git describe -to make a version stamp file which will be used by the packaging process. This -example shows how to get a source tree from a remote git repo. +The OpenAFS source tree contains an RPM spec file for building RPM packages. +Recent versions of OpenAFS have makefile targets to build the source +distribution tarballs and a source RPM package (srpm). After creating these +files, run the `rpmbuild` tool to create create the binary RPM packages. - $ git clone git://git.openafs.org/openafs.git openafs- - $ cd openafs- - $ git checkout - $ git describe >.version - $ ./regen.sh - -The _version_ is the dotted OpenAFS version number, such as 1.6.0, -and the _tagname_ is the git tag for the version, such as openafs-stable-1_6_0. -The _version_ number for pre-releases are suffixed with pre. For example, -to build 1.6.0pre5, create a directory called openafs-1.6.0pre5. -[GPS Tracking](http://vamostech.com/gps-tracking), [Sewa Mobil Jakarta](http://www.awanirentcar.com), [Properti Semarang](http://www.raywhitesemarang.com), [Glutera](http://www.grosir-kosmetik.com/62-glutera.html) - -Next, create a source RPM file. This requires creating a tar file for the -source files and a tar file for the documents. Run the makesrpm program -to generate an OpenAFS source RPM. - - $ cd .. # move out of the source tree - $ tar cjf openafs--src.tar.bz2 openafs- --exclude .git --exclude doc - $ tar cjf openafs--doc.tar.bz2 openafs-/doc - $ openafs-/src/packaging/RedHat/makesrpm.pl openafs--src.tar.bz2 openafs--doc.tar.bz2 +The following commands show how to build RPM packages from a git checkout. The +tools will create RPM packages from annotated git tags. Checkout a tag for the +desired version, then generated the source rpm, then run rpmbuild to build the +binaries RPM package files. -At this point you should have a source RPM called `openafs--1.0.src.rpm`. See the makesrpm.pl for additional options. -The source tree and tar files are no longer needed. - -Finally, run rpmbuild to build the build binary RPM packages. If all goes well, the final -output will show the destination directory and an exit code of zero. - - $ rpmbuild --rebuild openafs--1.0.src.rpm - ... - + cd /usr/src/redhat/BUILD - + rm -rf openafs- - + exit 0 + $ git clone git://git.openafs.org/openafs.git + $ cd openafs + $ git checkout openafs-stable- # NOTE: replace dots with underscores in version number + $ ./regen.sh + $ ./configure + $ make dist + $ make srpm + $ rpmbuild --rebuild -ba --define "_topdir $(pwd)/rpmbuild" packages/openafs--1.src.rpm -Alternatively, the source RPM may be installed, which will place the sources in the -rpm SOURCE directory and a spec file in the rpm SPEC directory. +The packages will be created in the `rpmbuild/RPMS` directory. See the RPM +spec file in src/packaging/RedHat for the OpenAFS `--define` options.