version 1.14, 2002/01/09 22:16:14
|
version 1.15, 2002/02/16 19:53:46
|
Line 32
|
Line 32
|
# YEAR=2001 |
# YEAR=2001 |
# 1/8,1/10,1/13,1/23,5/16 - Scott Harrison |
# 1/8,1/10,1/13,1/23,5/16 - Scott Harrison |
# YEAR=2002 |
# YEAR=2002 |
# 1/4,1/8,1/9 - Scott Harrison |
# 1/4,1/8,1/9,2/13 - Scott Harrison |
# |
# |
### |
### |
|
|
# Automatically generate RPM files |
# make_rpm.pl automatically generate RPM software packages |
# from file listing. |
# from a target image directory and file listing. POD |
|
# documentation is at the end of this file. |
# This script builds the RPM. |
|
|
|
# This script also generates and then deletes temporary |
|
# files (and binary root directory tree) to build an RPM with. |
|
# It is designed to work cleanly and independently from pre-existing |
|
# directory trees such as /usr/src/redhat/*. |
|
|
|
# I still need to implement the CONFIGURATION_FILES and |
|
# DOCUMENTATION_FILES portion of the command line interface to this |
|
# script. |
|
|
|
# Take in a file list (from standard input), |
|
# a description tag and version tag from command line argument |
|
# and temporarily generate a: |
|
# RPM .spec file |
|
# RPM Makefile |
|
# SourceRoot |
|
|
|
# A resulting .rpm file is generated. |
|
|
|
############################################################################### |
############################################################################### |
## ## |
## ## |
Line 75
|
Line 56
|
## 10. mirror copy (BinaryRoot) files under a temporary directory ## |
## 10. mirror copy (BinaryRoot) files under a temporary directory ## |
## 11. roll everything into an rpm ## |
## 11. roll everything into an rpm ## |
## 12. clean everything up ## |
## 12. clean everything up ## |
## 13. find_info - recursively gather information from a directory ## |
## 13. subroutines ## |
|
## 13a. find_info - recursively gather information from a directory ## |
|
## 13b. grabtag - grab a tag from an XML string ## |
## 14. Plain Old Documentation ## |
## 14. Plain Old Documentation ## |
## ## |
## ## |
############################################################################### |
############################################################################### |
Line 103 if (!$version) {
|
Line 86 if (!$version) {
|
print <<END; |
print <<END; |
See "perldoc make_rpm.pl" for more information. |
See "perldoc make_rpm.pl" for more information. |
|
|
Usage: <TAG> <VERSION> [CONFIGURATION_FILES] |
Usage: |
|
<STDIN> | perl make_rpm.pl <TAG> <VERSION> [CONFIGURATION_FILES] |
[DOCUMENTATION_FILES] [PATHPREFIX] [CUSTOMIZATION_XML] |
[DOCUMENTATION_FILES] [PATHPREFIX] [CUSTOMIZATION_XML] |
|
|
Standard input provides the list of files to work with. |
Standard input provides the list of files to work with. |
TAG, required descriptive tag. For example, a kerberos software |
TAG, required descriptive tag. For example, a kerberos software |
package might be tagged as "krb4". |
package might be tagged as "krb4". |
Line 369 print `$command`;
|
Line 354 print `$command`;
|
|
|
print `cd $invokingdir; rm -Rf $tag`; |
print `cd $invokingdir; rm -Rf $tag`; |
|
|
|
# ----------------------------------------------------------------- SUBROUTINES |
# ----- Subroutine: find_info - recursively gather information from a directory |
# ----- Subroutine: find_info - recursively gather information from a directory |
sub find_info { |
sub find_info { |
# only look for |
|
my ($file)=@_; |
my ($file)=@_; |
my $line; |
my $line; |
if (($line=`find $file -type f -prune`)=~/^$file\n/) { |
if (($line=`find $file -type f -prune`)=~/^$file\n/) { |
Line 386 sub find_info {
|
Line 371 sub find_info {
|
$line=`find $file -type l -prune -printf "\%l\t\%m\t\%u\t\%g"`; |
$line=`find $file -type l -prune -printf "\%l\t\%m\t\%u\t\%g"`; |
return ("links",split(/\t/,$line)); |
return ("links",split(/\t/,$line)); |
} |
} |
|
die("**** ERROR **** $file is neither a directory, soft link, or file"); |
} |
} |
|
|
# ------------------------- Subroutine: grabtag - grab a tag from an xml string |
# ------------------------- Subroutine: grabtag - grab a tag from an xml string |
Line 512 regular expressions.) Here are example
|
Line 497 regular expressions.) Here are example
|
Automatically generate an RPM software package from a list of files. |
Automatically generate an RPM software package from a list of files. |
|
|
This script builds the RPM in a very clean and configurable fashion. |
This script builds the RPM in a very clean and configurable fashion. |
(Finally! Making RPMs the simple way!) |
(Finally! Making RPMs outside of /usr/src/redhat without a zillion |
|
file intermediates left over!) |
|
|
This script generates and then deletes temporary |
This script generates and then deletes temporary |
files (and binary root directory tree) to build an RPM with. |
files needed to build an RPM with. |
It is designed to work cleanly and independently from pre-existing |
It works cleanly and independently from pre-existing |
directory trees such as /usr/src/redhat/*. |
directory trees such as /usr/src/redhat/*. |
|
|
Take in a file list (from standard input), |
The script is also simple. It accepts four kinds of information, |
a description tag and version tag from command line argument |
two of which are mandatory: |
and temporarily generate a: |
|
RPM .spec file |
=over 4 |
RPM Makefile |
|
SourceRoot |
=item * |
|
|
|
a list of files that are to be part of the software package; |
|
|
|
=item * |
|
|
|
the location of these files; |
|
|
|
=item * |
|
|
|
(optional) a descriptive tag and a version tag; |
|
|
|
=item * |
|
|
|
and (optional) an XML file that defines the additional metadata |
|
associated with the RPM software package. |
|
|
|
=back |
|
|
|
The following items are initially and temporarily generated during the |
|
construction of an RPM: |
|
|
|
=over 4 |
|
|
|
=item * |
|
|
|
RPM .spec file |
|
|
|
=item * |
|
|
|
RPM Makefile |
|
|
|
=item * |
|
|
|
SourceRoot |
|
|
|
=back |
|
|
A resulting .rpm file is generated. |
A resulting .rpm file is generated. |
|
|
|
make_rpm.pl is compatible with both rpm version 3.* and rpm version 4.*. |
|
|
=head1 README |
=head1 README |
|
|
Automatically generate an RPM software package from a list of files. |
Automatically generate an RPM software package from a list of files. |
|
|
This script builds the RPM in a very clean and configurable fashion. |
This script builds the RPM in a very clean and configurable fashion. |
(Finally! Making RPMs the simple way!) |
(Making RPMs the simple and right way!) |
|
|
This script generates and then deletes temporary |
This script generates and then deletes temporary |
files (and binary root directory tree) to build an RPM with. |
files (and binary root directory tree) to build an RPM with. |
Line 546 This script requires the C<strict> modul
|
Line 570 This script requires the C<strict> modul
|
|
|
=pod OSNAMES |
=pod OSNAMES |
|
|
any |
Linux |
|
|
=pod SCRIPT CATEGORIES |
=pod SCRIPT CATEGORIES |
|
|