RPM::Make::Simple - simple interface to RPM::Make
use RPM::Make::Simple; # define some important build data my $rpm = RPM::Make::Simple->new(name => 'RPM_Name', #mandatory arch => 'i386', # mandatory version => '0.01', release => '1', build_root => './build', temp_build_loc => 'temp_build_loc'); # 'From_File' => 'To_File_or_Dir' $rpm->Files('./scripts/some_script.pl' => '/usr/bin/some_script', './docs/some_document' => '/usr/man/man3/some_document', './config/some_config' => '/etc/some_config', './config/keep_config' => '/etc/keep_config'); # tell RPM::Make this is a document (optional) $rpm->Doc('/usr/man/man3/some_document'); # this is a config file (optional) $rpm->Conf('/etc/some_config'); # config file we don't want to replace if it's there (optional) $rpm->ConfNoReplace('/etc/keep_config'); # Some pre-requisites $rpm->Requires('perl(RPM::Make)' => 0.9); # Some more metadata, summary, post installation etc. $rpm->MetaData('summary' => 'package for blah blah', 'description' => 'longer than the summary', 'post' => $post_install_script, 'AutoReqProv' => 'no', 'vendor' => 'Bob Co.', 'group' => 'Bob RPMS'); # build the RPM! woo! $rpm->Build(); # clean up the temporary files $rpm->Clean();
Generates an RPM from a given list of files.
I wrote this as a 'dumb' RPM builder. An understanding of how an RPM is built (with spec files and whatnot) is desirable before using this. It's basically a wrapper for RPM::Make where the most important difference is how files are chosen and organised, using a simple 'from_file => to_file' syntax.
The Files and MetaData methods can be called more than once.
See RPM::Make for more info.
RPM::Make::Simple constructor. Takes the following mandatory parameters (as a hash):
Optional parameters (defaults in brackets):
version number of package (0.01)
release number of package (1)
directory the RPMs will be built in (./build)
directory where the files for the RPM will be copied whilst building (temp_build_loc)
List of files that will be installed, using a hash you can set the current location of a file and it's installation destination. For example, if I want to install a file called 'bob.pl' from '/home/bob/scripts/bob.pl' to '/usr/local/bin/bob' (notice you can rename the file during this phase) I would do the following:
$rpm->Files('/home/bob/scripts/bob.pl' => '/usr/local/bin/bob')
List of documents (as an array), such as man pages etc. Files in this list must already have been passed to the 'Files' function and always use the 'to' location.
List of config files, again it's an array. Files in this list must already have been passed to the 'Files' function and always use the 'to' location.
Array of config files that shouldn't be replaced. Files in this list must already have been passed to the 'Files' function and always use the 'to' location.
List of requirements as a hash, where the key is the required package and the value is the version. For example, if I want to have a requirement of the package 'tim' verion '6' I would do the following:
$rpm->Requires('tim' => '6');
Metadata not covered by the other functions (although you can overwrite here if you know about RPM::Make). Example of a summary being added:
$rpm->MetaData('summary' => 'blah blah blah');
It requires the following hash keys as its parameters:
Summary - A short summary of the RPM Description - A description of the RPM AutoReqProv - Automatic dependency processing, either "yes" or "no" Vendor - The RPM vendor Group - The name of the RPM group that this RPM is part of
The AutoReqProv is case sensitive, the other parameters aren't.
Invokes the build, no arguments required. Returns true if it succeeeds.
Removes temporary build directories.
Disused. Method left in for legacy reasons.
RPM::Make, rpmbuild etc.
RPM::Make 0.8 does not support certain RPM features such as post installation scripts. Althought most features will work fine, it is recommended that you use version 0.9.
Stephen Hardisty, <firstname.lastname@example.org>
Copyright (C) 2004 MessageLabs.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.