--- loncom/build/make_rpm.pl 2002/01/09 22:16:14 1.14 +++ loncom/build/make_rpm.pl 2002/02/16 19:53:46 1.15 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # make_rpm.pl - make RedHat package manager file (A CLEAN AND CONFIGURABLE WAY) # -# $Id: make_rpm.pl,v 1.14 2002/01/09 22:16:14 harris41 Exp $ +# $Id: make_rpm.pl,v 1.15 2002/02/16 19:53:46 harris41 Exp $ # # Written by Scott Harrison, harris41@msu.edu # @@ -32,32 +32,13 @@ # YEAR=2001 # 1/8,1/10,1/13,1/23,5/16 - Scott Harrison # YEAR=2002 -# 1/4,1/8,1/9 - Scott Harrison +# 1/4,1/8,1/9,2/13 - Scott Harrison # ### -# Automatically generate RPM files -# from file listing. - -# 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. +# make_rpm.pl automatically generate RPM software packages +# from a target image directory and file listing. POD +# documentation is at the end of this file. ############################################################################### ## ## @@ -75,7 +56,9 @@ ## 10. mirror copy (BinaryRoot) files under a temporary directory ## ## 11. roll everything into an rpm ## ## 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 ## ## ## ############################################################################### @@ -103,8 +86,10 @@ if (!$version) { print < [CONFIGURATION_FILES] +Usage: + | perl make_rpm.pl [CONFIGURATION_FILES] [DOCUMENTATION_FILES] [PATHPREFIX] [CUSTOMIZATION_XML] + Standard input provides the list of files to work with. TAG, required descriptive tag. For example, a kerberos software package might be tagged as "krb4". @@ -369,9 +354,9 @@ print `$command`; print `cd $invokingdir; rm -Rf $tag`; +# ----------------------------------------------------------------- SUBROUTINES # ----- Subroutine: find_info - recursively gather information from a directory sub find_info { - # only look for my ($file)=@_; my $line; if (($line=`find $file -type f -prune`)=~/^$file\n/) { @@ -386,7 +371,7 @@ sub find_info { $line=`find $file -type l -prune -printf "\%l\t\%m\t\%u\t\%g"`; 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 @@ -512,28 +497,67 @@ regular expressions.) Here are example Automatically generate an RPM software package from a list of files. 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 -files (and binary root directory tree) to build an RPM with. -It is designed to work cleanly and independently from pre-existing +files needed to build an RPM with. +It works cleanly and independently from pre-existing directory trees such as /usr/src/redhat/*. -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 +The script is also simple. It accepts four kinds of information, +two of which are mandatory: + +=over 4 + +=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. +make_rpm.pl is compatible with both rpm version 3.* and rpm version 4.*. + =head1 README Automatically generate an RPM software package from a list of files. 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 files (and binary root directory tree) to build an RPM with. @@ -546,7 +570,7 @@ This script requires the C modul =pod OSNAMES -any +Linux =pod SCRIPT CATEGORIES