Jump To Close Expand all Collapse all Table of contents Packaging and distributing software Making open source more inclusive Providing feedback on Red Hat documentation 1. Getting started with RPM packaging 2. Preparing software for RPM packaging Expand section "2. Preparing software for RPM packaging" Collapse section "2. Preparing software for RPM packaging" 2.1. What is source code 2.2. How programs are made Expand section "2.2. How programs are made" Collapse section "2.2. How programs are made" 2.2.1. Natively Compiled Code 2.2.2. Interpreted Code Expand section "2.2.2. Interpreted Code" Collapse section "2.2.2. Interpreted Code" 2.2.2.1. Raw-interpreted programs 2.2.2.2. Byte-compiled programs 2.3. Building software from source 2.4. Building software from Natively Compiled Code Expand section "2.4. Building software from Natively Compiled Code" Collapse section "2.4. Building software from Natively Compiled Code" 2.4.1. Manual building 2.4.2. Automated building 2.5. Interpreting code Expand section "2.5. Interpreting code" Collapse section "2.5. Interpreting code" 2.5.1. Byte-compiling code 2.5.2. Raw-interpreting code 2.6. Patching software 2.7. Arbitrary artifacts 2.8. Placing arbitrary artifacts in the system using the install command 2.9. Placing arbitrary artifacts in the system using the make install command 2.10. Preparing source code for packaging 2.11. Putting source code into tarball 3. Packaging software Expand section "3. Packaging software" Collapse section "3. Packaging software" 3.1. RPM packages 3.2. Listing RPM packaging tool’s utilities 3.3. Setting up RPM packaging workspace 3.4. What is a SPEC file Expand section "3.4. What is a SPEC file" Collapse section "3.4. What is a SPEC file" 3.4.1. Preamble items 3.4.2. Body items 3.4.3. Advanced items 3.5. BuildRoots 3.6. RPM macros 3.7. Working with SPEC files 3.8. Creating a new SPEC file with rpmdev-newspec 3.9. Modifying an original SPEC file for creating RPMs 3.10. An example SPEC file for a program written in bash 3.11. An example SPEC file for a program written in Python 3.12. An example SPEC file for a program written in C 3.13. Building RPMs 3.14. Building source RPMs 3.15. Rebuilding a binary RPM from a source RPM 3.16. Building a binary RPM from the SPEC file 3.17. Building binary RPMs from source RPMs 3.18. Checking RPMs for sanity 3.19. Checking bello for sanity Expand section "3.19. Checking bello for sanity" Collapse section "3.19. Checking bello for sanity" 3.19.1. Checking the bello SPEC File 3.19.2. Checking the bello binary RPM 3.20. Checking pello for sanity Expand section "3.20. Checking pello for sanity" Collapse section "3.20. Checking pello for sanity" 3.20.1. Checking the pello SPEC File 3.20.2. Checking the pello binary RPM 3.21. Checking cello for sanity Expand section "3.21. Checking cello for sanity" Collapse section "3.21. Checking cello for sanity" 3.21.1. Checking the cello SPEC File 3.21.2. Checking the cello binary RPM 3.22. Logging RPM activity to syslog 3.23. Extracting RPM content 4. Advanced topics Expand section "4. Advanced topics" Collapse section "4. Advanced topics" 4.1. Signing RPM packages Expand section "4.1. Signing RPM packages" Collapse section "4.1. Signing RPM packages" 4.1.1. Creating a GPG key 4.1.2. Configuring RPM to sign a package 4.1.3. Adding a signature to an RPM package 4.2. More on macros Expand section "4.2. More on macros" Collapse section "4.2. More on macros" 4.2.1. Defining your own macros 4.2.2. Using the %setup macro Expand section "4.2.2. Using the %setup macro" Collapse section "4.2.2. Using the %setup macro" 4.2.2.1. Using the %setup -q macro 4.2.2.2. Using the %setup -n macro 4.2.2.3. Using the %setup -c macro 4.2.2.4. Using the %setup -D and %setup -T macros 4.2.2.5. Using the %setup -a and %setup -b macros 4.2.3. Common RPM macros in the %files section 4.2.4. Displaying the built-in macros 4.2.5. RPM distribution macros 4.2.6. Creating custom macros 4.3. Epoch, Scriptlets and Triggers Expand section "4.3. Epoch, Scriptlets and Triggers" Collapse section "4.3. Epoch, Scriptlets and Triggers" 4.3.1. The Epoch directive 4.3.2. Scriptlets directives 4.3.3. Turning off a scriptlet execution 4.3.4. Scriptlets macros 4.3.5. The Triggers directives 4.3.6. Using non-shell scripts in a SPEC file 4.4. RPM conditionals Expand section "4.4. RPM conditionals" Collapse section "4.4. RPM conditionals" 4.4.1. RPM conditionals syntax 4.4.2. The %if conditionals 4.4.3. Specialized variants of %if conditionals 4.5. Packaging Python 3 RPMs Expand section "4.5. Packaging Python 3 RPMs" Collapse section "4.5. Packaging Python 3 RPMs" 4.5.1. SPEC file description for a Python package 4.5.2. Common macros for Python 3 RPMs 4.5.3. Using automatically generated dependencies for Python RPMs 4.6. Handling interpreter directives in Python scripts Expand section "4.6. Handling interpreter directives in Python scripts" Collapse section "4.6. Handling interpreter directives in Python scripts" 4.6.1. Modifying interpreter directives in Python scripts 4.7. RubyGems packages Expand section "4.7. RubyGems packages" Collapse section "4.7. RubyGems packages" 4.7.1. What RubyGems are 4.7.2. How RubyGems relate to RPM 4.7.3. Creating RPM packages from RubyGems packages Expand section "4.7.3. Creating RPM packages from RubyGems packages" Collapse section "4.7.3. Creating RPM packages from RubyGems packages" 4.7.3.1. RubyGems SPEC file conventions 4.7.3.2. RubyGems macros 4.7.3.3. RubyGems SPEC file example 4.7.3.4. Converting RubyGems packages to RPM SPEC files with gem2rpm Expand section "4.7.3.4. Converting RubyGems packages to RPM SPEC files with gem2rpm" Collapse section "4.7.3.4. Converting RubyGems packages to RPM SPEC files with gem2rpm" 4.7.3.4.1. Installing gem2rpm 4.7.3.4.2. Displaying all options of gem2rpm 4.7.3.4.3. Using gem2rpm to covert RubyGems packages to RPM SPEC files 4.7.3.4.4. gem2rpm templates 4.7.3.4.5. Listing available gem2rpm templates 4.7.3.4.6. Editing gem2rpm templates 4.8. How to handle RPM packages with Perls scripts Expand section "4.8. How to handle RPM packages with Perls scripts" Collapse section "4.8. How to handle RPM packages with Perls scripts" 4.8.1. Common Perl-related dependencies 4.8.2. Using a specific Perl module 4.8.3. Limiting a package to a specific Perl version 4.8.4. Ensuring that a package uses the correct Perl interpreter 5. New features in RHEL 9 Expand section "5. New features in RHEL 9" Collapse section "5. New features in RHEL 9" 5.1. Dynamic build dependencies 5.2. Improved patch declaration Expand section "5.2. Improved patch declaration" Collapse section "5.2. Improved patch declaration" 5.2.1. Optional automatic patch and source numbering 5.2.2. %patchlist and %sourcelist sections 5.2.3. %autopatch now accepts patch ranges 5.3. Other features 6. Additional resources Legal Notice Settings Close Language: 日本語 简体中文 한국어 English Français Language: 日本語 简体中文 한국어 English Français Format: Multi-page Single-page PDF Format: Multi-page Single-page PDF Language and Page Formatting Options Language: 日本語 简体中文 한국어 English Français Language: 日本語 简体中文 한국어 English Français Format: Multi-page Single-page PDF Format: Multi-page Single-page PDF Chapter 6. Additional resources References to various topics related to RPMs, RPM packaging, and RPM building follows. Mock RPM Documentation RPM 4.15.0 Release Notes RPM 4.16.0 Release Notes Fedora Packaging Guidelines Previous Next