RPM-Specfile-1.51

NAME

RPM::Specfile - Perl extension for creating RPM Specfiles

SYNOPSIS

use RPM::Specfile;

DESCRIPTION

This is a simple module for creation of RPM Spec files. Most of the methods in this module are the same name as the RPM Spec file element they represent but in lower case. Furthermore the the methods are divided into two groups:

Simple Accessors

These methods have the have the exact name as the element they represent (in lower case). If passed no arguments return a scalar representing the element. If an argument is passed they will set the value of the element.

List Accessors

These methods manipulate items in the spec file that are lists (e.g. the list of patches maintained by the spec file). Each element that is represented by a list accessor will have at least three methods associated with it.

A method to directly manipulate individual members of the list. These methods take as a first argument the index into the list, and as a second argument the element value. If no arguments are given it simply returns the list. If only the index is given it returns the list member at that index. If the value is also given it will set the list member associated with the index.

A method to push a member onto the list. Each of these methods have push_ at the begining of their name.

A method to clear the list. Each of these methods have clear_ at the begining of their name.

RPM SPEC FILE ORGANIZATION

This section describes the basic structure of an RPM Spec file and how that applies to RPM::Specfile. It does not attempt to give a full description of RPM Spec file syntax.

RPM Spec files are divided into the following sections:

Preamble

This is where the meta information for the rpm is stored, such as its name version and description. Also, macro definitions are generally put at the top of the preamble. The methods that are used to create this section are listed below:

Many of the elements of the Preamble are required. See Maximum RPM for documentation on which one are required and which ones are not.

Build Scriptlets

When rpms are built the install scriptlets are invoked. These install scriptlets are %prep, %build, %install, and %clean. The contents of these scripts can be set with the following methods:

build(), clean(), install(), prep()

The %prep, %build, and %install scriptlets are required, but may be null.

Install/Erase Scriplets

When an RPM is installed or erased various scriplets may be invoked. These scriplets can be set via the following methods:

post(), postun(), pre(), preun()

The install scriptlets are not required.

Files

The %files section is used to define what files should be delivered to the system. It further defines what the permsisions and ownership of the files should be. The methods that work with the %files sections are:

file(), push_file(), clear_file(), file_param()

Note, a files section is required, but it may contain no entries.

Change Log

The last section in the spec file is the change log. Methods to modify this are: