Open main menu

CDOT Wiki β

Changes

RPM Packaging Process

1,075 bytes added, 13:18, 17 July 2017
Setting up the Packaging Environment
[[Category:SBR600]][[Category:DPI908]][[Category:RPM]][[Category:SPO600]]
RPM packages are built from the source files plus a spec file, using the ''rpmbuild'' program.
== Needed Packages ==
Install with ''dnf'' (or ''yum''on older versions of Fedora):* "Fedora Packager" (this is a group of packages - use "yum dnf groupinstall" or put an @ sign in front of the group name)
* rpmdevtools
* rpmlint
# Download the source code for an existing RPM: <code>yumdownloader --source ''nameofpackage''</code>
# Install that downloaded SRPM(this does not require root access): <code>rpm -i ''nameofpackage''*.src.rpm</code>
#* Source will be in <code>~/rpmbuild/SOURCES</code>
#* Spec file will be in <code>~/rpmbuild/SPECS</code>
 
After installing the SRPM you can:
 
* Examine the specfile: <code>cd ~/rpmbuild/SPECS; less ''nameofpackage''.spec</code>
* To build Prep the sources (unpack tarballs, apply patches) to see the source code as it will be built: <code>rpmbuild -bp ''nameofpackage''.spec</code> # Results will be in <code>~/rpmbuild/BUILD/</code> (usually in a subdirectory named <code>''nameofpackage''-''version''</code>).* Build from source using the specfile:
*# Build all (binary RPMS plus SRPMS): <code>rpmbuild -ba ''nameofpackage''.spec</code>
*# Build just the spec file: <code>rpmbuild -bs ''nameofpackage''.spec</code>
* add the -i (information) option to the ''rpmlint'' command
* see the [[:fedora:Common Rpmlint issues|Fedora Common Rpmlint issues]] page on the Fedora wiki
 
= Common Challenges =
 
Refer to these documents on the Fedora wiki for help on specific packaging challenges:
* [[:fedora:Packaging:Guidelines|Packaging Guidelines]] - General packaging guidelines for Fedora, including instructions for specific languages and packaging cases
* [[:fedora:Packaging:ScriptletSnippets|Scriptlet Snippets]] - Script(lets) that can be used in RPM packages to solve specific problems
 
In particular, these sections are useful for GNU software:
* [[:fedora:Packaging:ScriptletSnippets#Texinfo|Packaging .info (texinfo) documentation files]]
* [[:fedora:Packaging:Guidelines#Handling_Locale_Files|Handling locale files (message translations)]]