[LON-CAPA-cvs] cvs: modules /matthew/LON-CAPA_rpm buildnew.pl

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 23 Mar 2005 23:25:09 -0000


matthew		Wed Mar 23 18:25:09 2005 EDT

  Modified files:              
    /modules/matthew/LON-CAPA_rpm	buildnew.pl 
  Log:
  Keep the srpm around as well.
  
  
Index: modules/matthew/LON-CAPA_rpm/buildnew.pl
diff -u modules/matthew/LON-CAPA_rpm/buildnew.pl:1.2 modules/matthew/LON-CAPA_rpm/buildnew.pl:1.3
--- modules/matthew/LON-CAPA_rpm/buildnew.pl:1.2	Fri Aug  6 11:48:02 2004
+++ modules/matthew/LON-CAPA_rpm/buildnew.pl	Wed Mar 23 18:25:07 2005
@@ -14,6 +14,7 @@
 my $rpmbuilddir = '/usr/src/redhat/';
 my $srcdir = $rpmbuilddir.'SOURCES/';
 my $rpmdir = $rpmbuilddir.'RPMS/i386/';
+my $srpmdir = $rpmbuilddir.'SRPMS/';
 my $specdir = $rpmbuilddir.'SPECS/';
 
 my $name = 'LONCAPA-prerequisites';
@@ -28,11 +29,13 @@
 my $dirname = $name.'-'.$version;
 my $rpmname = $name.'-'.$version.'-'.$release.'.i386.rpm';
 my $rpmfile = $rpmdir.$rpmname;
+
+my $srcname = $name.'-'.$version.'-'.$release.'.src.rpm';
+my $srcrpm  = $srpmdir.$srcname;
 my $tarball = $dirname.'.tar.gz';
 
-if (-e $rpmfile) {
-    unlink($rpmfile);
-}
+if (-e $rpmfile) { unlink($rpmfile); }
+if (-e $srcrpm ) { unlink($srcrpm); }
 
 if (-e $dirname) {
     if (-l $dirname) {
@@ -48,6 +51,8 @@
 copy($tarball,$srcdir);
 
 system("rpmbuild -bb $specfile");
+system("rpmbuild -bs $specfile");
 copy($rpmfile,'.');
 unlink($rpmfile);
-
+copy($srcrpm,'.');
+print $srcrpm.$/;