| 1 | = Building binary packages for Fedora/RHEL/CentOS = |
| 2 | |
| 3 | == Agreements and denotes == |
| 4 | |
| 5 | In order to eliminate the ambiguous interpretations need to determine the terms and symbols: |
| 6 | * ${SRC_DIR} - directory with source tree; |
| 7 | * ${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. [https://fedoraproject.org/wiki/PackagingGuidelines packagin guidelines] for more information. |
| 8 | |
| 9 | == Prepare to build == |
| 10 | |
| 11 | You must have copy of our repository. For do this, please consult with '[wiki:doc/getSources getting sources]' page. |
| 12 | |
| 13 | In source tree run commands: |
| 14 | |
| 15 | {{{ |
| 16 | cd ${SRC_DIR} |
| 17 | ./autogen.sh |
| 18 | ./configure |
| 19 | make dist |
| 20 | }}} |
| 21 | |
| 22 | After all, in root of source tree you will have tarball named {{{mc-<version>.tar.gz}}} |
| 23 | |
| 24 | == Usage of rpmbuild == |
| 25 | |
| 26 | You may build binary rpm package with rpmbuild utility. In this case your OS must have all packages and libraryes from [wiki:doc/buildAndInstall/req requires list]. |
| 27 | |
| 28 | 1. Copy file ${SRC_DIR}/contrib/dist/redhat/mc.spec into ${RPMBUILD_DIR}/SPECS. |
| 29 | 1. Copy file ${SRC_DIR}/mc-<версия>.tar.gz into ${RPMBUILD_DIR}/SOURCES. |
| 30 | 1. Build a binary package. |
| 31 | 1. Build a source package (src.rpm). |
| 32 | |
| 33 | As shell-command look like: |
| 34 | {{{ |
| 35 | cp ${SRC_DIR}/contrib/dist/redhat/mc.spec ${RPMBUILD_DIR}/SPECS |
| 36 | cp ${SRC_DIR}/mc-*.tar.gz ${RPMBUILD_DIR}/SOURCES |
| 37 | rpmbuild -bb ${RPMBUILD_DIR}/SPECS/mc.spec |
| 38 | rpmbuild -bs ${RPMBUILD_DIR}/SPECS/mc.spec |
| 39 | }}} |
| 40 | |
| 41 | Build of binary package and source package may be complete with one command: |
| 42 | {{{ |
| 43 | rpmbuild -ba ${RPMBUILD_DIR}/SPECS/mc.spec |
| 44 | }}} |
| 45 | Refer to {{{man rpmbuild}}} for getting more info. |
| 46 | |
| 47 | == Usage of mock == |
| 48 | |
| 49 | If you'll use [https://fedoraproject.org/wiki/Projects/Mock mock] utility, not need to install all packages and libraryes required for sucessfull build. |
| 50 | |
| 51 | 1. Copy file ${SRC_DIR}/contrib/dist/redhat/mc.spec into ${RPMBUILD_DIR}/SPECS. |
| 52 | 1. Copy file ${SRC_DIR}/mc-<версия>.tar.gz into ${RPMBUILD_DIR}/SOURCES. |
| 53 | 1. Build a source package (src.rpm). |
| 54 | 1. Run mock with specified OS for build. |
| 55 | |
| 56 | As shell-command look like: |
| 57 | {{{ |
| 58 | cp ${SRC_DIR}/contrib/dist/redhat/mc.spec ${RPMBUILD_DIR}/SPECS |
| 59 | cp ${SRC_DIR}/mc-*.tar.gz ${RPMBUILD_DIR}/SOURCES |
| 60 | rpmbuild --nodeps -bs ${RPMBUILD_DIR}/SPECS/mc.spec |
| 61 | mock ${RPMBUILD_DIR}/SRPMS/mc-*.src.rpm -r fedora-11-i386 |
| 62 | }}} |
| 63 | Refer to {{{man mock}}} for getting more info. |
| 64 | |
| 65 | == Usage of 'koji' build-farms == |
| 66 | |
| 67 | TODO. Hubbitus: help, please :) |
| 68 | |