From edf9eab342fd4f5a39d3f8bcda59a1fc8506796c Mon Sep 17 00:00:00 2001 From: Petr Kovar Date: Mar 01 2012 16:30:34 +0000 Subject: Merge RHDWG content --- diff --git a/en-US/Creating_and_Building_Packages.xml b/en-US/Creating_and_Building_Packages.xml index 63cccd9..6b41b89 100644 --- a/en-US/Creating_and_Building_Packages.xml +++ b/en-US/Creating_and_Building_Packages.xml @@ -2,18 +2,13 @@ Creating and Building Packages - - This chapter shows you how to convert a tarball into an RPM package. - + This chapter shows you how to convert a source archive into an RPM package.
Preparing a Build Environment This section shows how to prepare an environment for building RPM packages on your system.
Creating a Non-Root Buildroot - - Creating a non-root buildroot - - These steps show how to create a non-root buildroot environment. This non-root environment is used to build packages as a normal user, without the need of becoming the root user. Because some of the software source tarballs can contain code in a makefile or script that can possibly damage your system, it is best to build packages as a user that does not have full access to the system. + These steps show how to create a non-root buildroot environment. This non-root environment is used to build packages as a normal user, without the need of becoming the root user. Because some of the software source archives can contain code in a makefile or script that can possibly damage your system, it is highly recommended to build packages as a user that does not have full access to the system. - Creating a non-root buildroot @@ -44,7 +38,7 @@ - As a normal user, run the following command to create a ~/rpmbuild/ directory where packages are built: + As a normal user, run the following command to create the ~/rpmbuild/ directory where packages are built: rpmdev-setuptree @@ -73,21 +67,14 @@ -
Creating a Basic Spec File - - This section shows how to write a basic spec file for your RPM package. - + This section shows how to write a basic spec file for your RPM package.
Creating an Example Spec File for eject - - Creating an example spec file for eject - - These steps show an example of creating a package from the source code tarball of the eject utility. The eject utility is a simple software that ejects removable media using software control so it is an ideal candidate for creating a basic spec file. - + These steps show an example of creating a package from the source code archive of the eject utility. The eject utility is a simple software that ejects removable media using software control so it is an ideal candidate for creating a basic spec file. Creating an example package: eject @@ -206,7 +193,7 @@ Summary: A program that ejects removable media using software control - In the Source tag, fill in the URL of the source tarball for the package: + In the Source tag, fill in the URL of the source archive for the package: Source0: http://www.ibiblio.org/pub/Linux/utils/disk-management/%{name}-%{version}.tar.gz @@ -336,7 +323,6 @@ ln -s ../bin/eject $RPM_BUILD_ROOT/%{_sbindir} -
Building a Package - - This section shows how to build your RPM package with the rpmbuild command. - + This section shows how to build your RPM package with the rpmbuild command. Run rpmbuild as a non-root user It is highly recommended to always run the rpmbuild command as a non-root, normal, user. If you build a package as the root user, possible mistakes in the spec file, for example in the %install section, can cause damage to your system.
Building an Example Package: eject - - Building an example package: eject - These steps show an example of building a package with a previously created spec file of the eject utility. For installation, eject only requires a minimum set of package dependencies. This makes it a good project to examine for package building. - + Before starting with the package building process itself, make sure that you have created a non-root buildroot on your system. Building an example package: eject - Before starting with the package building process itself, make sure that you have created a non-root buildroot on your system. - - - Download the source code tarball for eject and place it in the ~/rpmbuild/SOURCES/ directory. + Download the source code archvive for eject and place it in the ~/rpmbuild/SOURCES/ directory. @@ -566,20 +544,14 @@ If you just want to create a source package (.src.rpm), run This will create the source package in the ~/rpmbuild/SRPMS/ directory, or recreate it if it has been previously created. -
Testing a Package - - This section shows how to use the rpmlint utility to test an RPM package. rpmlint can be used to test spec files, binary packages, and source packages. It is highly recommended to run rpmlint every time you make changes to the package. + This section shows how to use the rpmlint utility to test an RPM package. rpmlint can be used to test spec files, binary packages, and source packages. It is highly recommended to run rpmlint every time you make changes to the package.
Testing a Spec File - - Testing a Spec File - These steps show how to test a spec file of a package with the rpmlint utility. - Testing a spec file with rpmlint @@ -603,15 +575,10 @@ This will create the source package in the ~/rpmbuil Refer to the Fedora Packaging Guidelines for information on what rpmlint errors can be typically ignored. -
Testing a Spec File, Binary, and Source Package - - Testing a Spec File, Binary, and Source Package - These steps show how to test a spec file, a binary package, and a source package with the rpmlint utility. - Testing a spec file, binary, and source package with rpmlint @@ -619,7 +586,7 @@ This will create the source package in the ~/rpmbuil rpmlint package.spec ../RPMS/*/package*.rpm ../SRPMS/package*.rpm - After running the command, rpmlint will build a binary package with debugging information. + After running the command, rpmlint will build binary packages with debugging information. Change to the ~/rpmbuild/RPMS/architecture/ directory to locate the binary packages that were built with rpmlint. @@ -645,15 +612,10 @@ This will create the source package in the ~/rpmbuil -
Testing a Package with Mock - - Testing a Package with Mock - These steps show how to test a package with the help of Mock. Mock creates chroots and builds packages in them. Its only task is to reliably populate a chroot and attempt to build a package in that chroot. Use Mock to test that you have accurate definitions of the build dependencies in your spec file. - Testing a package with Mock + For more information on RPM packaging, refer to the resources listed below. + + Installed Documentation + + + + + rpm(8) – The manual page for the rpm utility for building, installing, querying, verifying, updating, and erasing individual RPM packages. + + + + + rpmbuild(8) – The manual page for the rpmbuild utility for building both binary and source RPM packages. + + + + + rpmlint(1) – The manual page for the rpmlint utility for checking common errors in RPM packages. + + + + +