12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

142CHAPTER 5Working with RPM SoftwareAdditional parameters that can be set in the spec file include%buildBuildRequiresPatch0Obsoletes%pre%post%preun%postunInstructions for building the package. Usually the make command is used to runthe default target of the Makefile, or the %configure macro is used if automakeand autoconf are used. For our example, this parameter is not used since theprogram being installed is a script and does not need to be compiled.If a package such as one that provides a compiler or a library necessary to buildthe package is needed, use this field to list them. Each package should be listedon its own line with the BuildRequires keyword. If a package is required to runthe software after it is installed, use the Requires field instead.If a patch should be applied to the source code during the build process, list itwith this field. If more than one patch is necessary, list them separate and incrementthe patch number in the field name such as Patch0, Patch1, Patch2, andso on.If the package name has changed, this field can be used to list the old packagename. When performing a package update, if the old package is installed, it willbe removed and replaced with the updated package with the new package name.Command that needs to be run before the package is installed.Command run immediately after the package is installed. For example, an initializationscript to start a daemon.Commands run right before the package is removed.Commands run right after a package is removed.In the sections %pre, %post, %preun, and %postun, always use the full path to commands,never output messages to standard out, and never make the scripts interactive. If the RPMinstallation, upgrade, or removal is part of a bigger script run or is performed from agraphical interface, messages to standard out are not seen, including prompts for the userto interact with the script.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!