wiki:doc/packaging/redhat
Last modified 12 years ago Last modified on 07/23/09 05:32:36

Building binary packages for Fedora/RHEL/CentOS

NOTE: RHEL4 does not supported with official repos due lack of slan2/ncursesw and old glib (<2.6).

Agreements and denotes

In order to eliminate the ambiguous interpretations need to determine the terms and symbols:

  • ${SRC_DIR} - directory with source tree;
  • ${RPMBUILD_DIR} - directory for builds rpm-packages by rpmbuild utility. Usually, this ~/rpmbuild, but may be /usr/src/rpmbuild. Also, you may redefine this directory to any other. See. packagin guidelines for more information.

Prepare to build

You must have copy of our repository. For do this, please consult with 'getting sources' page.

In source tree run commands:

cd ${SRC_DIR}
./autogen.sh
./configure
make dist

After all, in root of source tree you will have tarball named mc-<version>.tar.gz

Usage of rpmbuild

You may build binary rpm package with rpmbuild utility. In this case your OS must have all packages and libraryes from requires list.

  1. Copy file ${SRC_DIR}/contrib/dist/redhat/mc.spec into ${RPMBUILD_DIR}/SPECS.
  2. Copy file ${SRC_DIR}/mc-<версия>.tar.gz into ${RPMBUILD_DIR}/SOURCES.
  3. Build a binary package.
  4. Build a source package (src.rpm).

As shell-command look like:

cp ${SRC_DIR}/contrib/dist/redhat/mc.spec ${RPMBUILD_DIR}/SPECS
cp ${SRC_DIR}/mc-*.tar.gz ${RPMBUILD_DIR}/SOURCES
rpmbuild -bb ${RPMBUILD_DIR}/SPECS/mc.spec
rpmbuild -bs ${RPMBUILD_DIR}/SPECS/mc.spec

Build of binary package and source package may be complete with one command:

rpmbuild -ba ${RPMBUILD_DIR}/SPECS/mc.spec

Refer to man rpmbuild for getting more info.

Usage of mock

If you'll use mock utility, not need to install all packages and libraryes required for sucessfull build.

  1. Copy file ${SRC_DIR}/contrib/dist/redhat/mc.spec into ${RPMBUILD_DIR}/SPECS.
  2. Copy file ${SRC_DIR}/mc-<версия>.tar.gz into ${RPMBUILD_DIR}/SOURCES.
  3. Build a source package (src.rpm).
  4. Run mock with specified OS for build.

As shell-command look like:

cp ${SRC_DIR}/contrib/dist/redhat/mc.spec ${RPMBUILD_DIR}/SPECS
cp ${SRC_DIR}/mc-*.tar.gz ${RPMBUILD_DIR}/SOURCES
rpmbuild --nodeps -bs ${RPMBUILD_DIR}/SPECS/mc.spec
mock ${RPMBUILD_DIR}/SRPMS/mc-*.src.rpm -r fedora-11-i386

Refer to man mock for getting more info.

Usage of 'koji' build-farms

TODO. Hubbitus: help, please :)