Changeset 2223

Show
Ignore:
Timestamp:
08/21/08 23:29:05 (3 months ago)
Author:
mbr
Message:

added --no-deps support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psad/trunk/packaging/cd_rpmbuilder

    r2072 r2223  
    1010# Author: Michael Rash 
    1111# 
    12 # Copyright (C) 2006 Michael Rash (mbr@cipherdyne.org) 
    13 # 
    14 # License (GNU Public License): 
     12# Copyright (C) 2006-2008 Michael Rash (mbr@cipherdyne.org) 
     13# 
     14# License (GNU Public License - GPLv2): 
    1515# 
    1616#    This program is distributed in the hope that it will be useful, 
     
    2626############################################################################# 
    2727# 
    28 # $Id: cd_rpmbuilder 698 2007-06-06 05:26:21Z mbr $ 
     28# $Id: cd_rpmbuilder 1864 2008-08-22 03:16:19Z mbr $ 
    2929# 
    3030 
     
    4848my $build_version = ''; 
    4949my $print_version = 0; 
     50my $nodeps = 0; 
    5051my $verbose = 0; 
    5152my $help = 0; 
     
    6869    'build-version=s' => \$build_version, 
    6970    'rpm-build-dir=s' => \$rpm_root_dir, 
     71    'no-deps' => \$nodeps, 
    7072    'verbose' => \$verbose, 
    7173    'Version' => \$print_version, 
     
    101103} 
    102104 
     105my $spec_file = "$project-$build_version.spec"; 
     106my $tar_file  = "$project-$build_version.tar.gz"; 
     107 
     108if ($nodeps) { 
     109    $spec_file = "$project-nodeps-$build_version.spec"; 
     110    $tar_file  = "$project-nodeps-$build_version.tar.gz"; 
     111} 
     112 
    103113### remove old RPMS 
    104114&find_rpms($RM); 
    105115 
    106116### get the remote spec file 
    107 &download_file("$project-$build_version.spec"); 
    108 &md5_check("$project-$build_version.spec"); 
     117&download_file($spec_file); 
     118&md5_check($spec_file); 
    109119 
    110120### get the remote source tarball and md5 sum file 
    111 &download_file("$project-$build_version.tar.gz"); 
    112 &md5_check("$project-$build_version.tar.gz"); 
    113  
    114 move "$project-$build_version.tar.gz", '../SOURCES' or die $!; 
     121&download_file($tar_file); 
     122&md5_check($tar_file); 
     123 
     124if ($nodeps) { 
     125    move $tar_file, "../SOURCES/$project-$build_version.tar.gz" or die $!; 
     126} else { 
     127    move $tar_file, '../SOURCES' or die $!; 
     128
    115129 
    116130### build the rpm 
     
    196210"[+] Building RPM, this may take a little while (try -v if you want\n", 
    197211"    to see all of the steps)...\n\n"; 
    198     my $cmd = "$rpmbuildCmd -ba $project-$build_version.spec"; 
     212    my $cmd = "$rpmbuildCmd -ba $spec_file"; 
    199213    unless ($verbose) { 
    200214        $cmd .= ' > /dev/null 2>&1'; 
     
    231245[+] By Michael Rash (mbr\@cipherdyne.org, http://www.cipherdyne.org) 
    232246 
    233 Usage: cd_rpmbuilder -p <project> [-b <version>] [-r <dir>] [-v] [-V] [-h
     247Usage: cd_rpmbuilder -p <project> [options
    234248 
    235249Options: 
     
    239253    -r, --rpm-build-dir <dir>  - Change the RPM build directory from the 
    240254                                 default of $rpm_root_dir. 
     255    -n, --no-deps              - Build the specified project without any 
     256                                 dependencies (such as perl modules). 
    241257    -v, --verbose              - Run in verbose mode. 
    242258    -V, --Version              - Print version and exit.