perfsonar-dev - perfsonar: r3040 - in branches/rpm: . geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf
Subject: perfsonar development work
List archive
perfsonar: r3040 - in branches/rpm: . geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf
Chronological Thread
- From:
- To:
- Subject: perfsonar: r3040 - in branches/rpm: . geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf
- Date: Thu, 15 Nov 2007 20:04:11 -0500
Author: fernandes
Date: 2007-11-15 20:04:10 -0500 (Thu, 15 Nov 2007)
New Revision: 3040
Modified:
branches/rpm/geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf/service.properties
branches/rpm/rpm_maker.pl
Log:
Modified:
branches/rpm/geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf/service.properties
===================================================================
---
branches/rpm/geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf/service.properties
2007-11-14 14:44:14 UTC (rev 3039)
+++
branches/rpm/geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf/service.properties
2007-11-16 01:04:10 UTC (rev 3040)
@@ -1,13 +1,13 @@
-#Fri Nov 09 11:45:19 EST 2007
+#Thu Nov 15 16:20:31 EST 2007
service.r.service_type=ma
component.ma.xmldb.db_uri=xmldb\:exist\://localhost\:8080/exist/xmlrpc/db/rrdmaconfig
service.ma.rrd.rrd_storage_manager_rrd_step_default=300
-component.ma.xmldb.db_password=admin
+component.ma.xmldb.db_password=perfsonar
service.r.service_description=perfSONAR service
component.ma.xmldb.db_status=on
component.ma.xmldb.db_uri.xmlrpc=xmldb\:exist\://localhost\:8080/exist/xmlrpc/db/rrdmaconfig
service.ma.rrd.rrd_storage_manager_rrd_DS_type_default=COUNTER\:1800\:0\:10000000000000
-component.ma.xmldb.db_adminpassword=admin
+component.ma.xmldb.db_adminpassword=perfsonar
service.log.log4j.config=/home/perfsonar/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf/log4j.properties
service.r.type=ma
component.registrator.scheduler_component=ma_scheduler
@@ -19,7 +19,7 @@
service.ma.rrd.rrd_storage_manager_rrd_RRA_default=MAX\:0.5\:1\:600,MAX\:0.5\:6\:600,MAX\:0.5\:24\:600,AVERAGE\:0.5\:288\:600,AVERAGE\:0.5\:1\:600,AVERAGE\:0.5\:24\:600,MAX\:0.5\:288\:600,AVERAGE\:0.5\:6\:600
service.r.organization_name=
service.sax_parser.config=/home/perfsonar/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf/objects.config
-component.ma.xmldb.db_username=root
+component.ma.xmldb.db_username=perfsonar
service.ma.rrd.xmldb.db_store.data_dir=/home/perfsonar/webapps//
component.ma.xmldb.db_access=xmlrpc
service.r.service_version=2.3.1
Modified: branches/rpm/rpm_maker.pl
===================================================================
--- branches/rpm/rpm_maker.pl 2007-11-14 14:44:14 UTC (rev 3039)
+++ branches/rpm/rpm_maker.pl 2007-11-16 01:04:10 UTC (rev 3040)
@@ -13,36 +13,113 @@
print "-- perfSONAR web services RPM maker --\n";
+getLastServiceInfo();
getServiceInfo();
+writeLastServiceInfo();
getFilesListing();
+createRpmBuildTree();
+chdir("rpm");
createSpecFile();
createSourceFile();
-createRpmBuildTree();
-putFilesInPlace();
-#buildRpm();
+#putFilesInPlace();
+buildRpm();
+sub getLastServiceInfo(){
+ open(INFOFILE, "< .rpm_maker.info") or return;
+ my $readingServiceMessage;
+ while(<INFOFILE>){
+ if($readingServiceMessage){
+ if(/^\.$/){
+ undef $readingServiceMessage;
+ }else{
+ chomp($_);
+ push(@serviceMessage, $_);
+ }
+ }elsif(/^serviceSummary=(.*)$/){
+ $serviceSummary = $1;
+ }elsif(/^serviceName=(.*)$/){
+ $serviceName = $1;
+ }elsif(/^serviceVersion=(.*)$/){
+ $serviceVersion = $1;
+ }elsif(/^serviceDependencies=(.*)$/){
+ $serviceDependencies = $1;
+ }elsif(/^serviceDescription=(.*)$/){
+ $serviceDescription = $1;
+ }elsif(/^serviceMessage=(.*)$/){
+ $readingServiceMessage = '1';
+ }
+ }
+ close(INFOFILE);
+}
+
+sub writeLastServiceInfo(){
+ open(INFOFILE, "> .rpm_maker.info");
+ select INFOFILE;
+ print "serviceSummary=$serviceSummary\n";
+ print "serviceName=$serviceName\n";
+ print "serviceVersion=$serviceVersion\n";
+ print "serviceDependencies=$serviceDependencies\n";
+ print "serviceDescription=$serviceDescription\n";
+ print "serviceMessage=\n";
+ for my $line (@serviceMessage){
+ print $line."\n";
+ }
+ print ".";
+ close(INFOFILE);
+ select STDOUT;
+}
+
sub getServiceInfo(){
- print "Enter service summary: ";
- $serviceSummary = <STDIN>;
- chomp $serviceSummary;
- print "Enter service name: ";
- $serviceName = <STDIN>;
- chomp $serviceName;
- print "Enter service version: ";
- $serviceVersion = <STDIN>;
- chomp $serviceVersion;
- print "Enter service dependencies: ";
- $serviceDependencies = <STDIN>;
- chomp $serviceDependencies;
- print "Enter service description: ";
- $serviceDescription = <STDIN>;
- chomp $serviceDescription;
- print "Enter message to user after installation (end with a single dot):
\n";
- while ( <STDIN> ) {
- last if /^.$/;
- chomp $_;
- push @serviceMessage, $_;
+ my $answer;
+ print "Enter service summary [$serviceSummary]: ";
+ $answer = <STDIN>;
+ chomp($answer);
+ if($answer){
+ $serviceSummary = $answer;
}
+
+ print "Enter service name [$serviceName]: ";
+ $answer = <STDIN>;
+ chomp($answer);
+ if($answer){
+ $serviceName = $answer;
+ }
+
+ print "Enter service version [$serviceVersion]: ";
+ $answer = <STDIN>;
+ chomp($answer);
+ if($answer){
+ $serviceVersion = $answer;
+ }
+
+ print "Enter service dependencies [$serviceDependencies]: ";
+ $answer = <STDIN>;
+ chomp($answer);
+ if($answer){
+ $serviceDependencies = $answer;
+ }
+
+ print "Enter service description [$serviceDescription]: ";
+ $answer = <STDIN>;
+ chomp($answer);
+ if($answer){
+ $serviceDescription = $answer;
+ }
+
+ print "Last entered message to user after installation: \n";
+ for my $line (@serviceMessage){
+ print $line . "\n";
+ }
+ print "Use that one (y/n) [n]?";
+ $answer = <STDIN>;
+ if (!($answer =~ /^y$/)){
+ print "Enter message to user after installation (end with a single
dot): \n";
+ while ( <STDIN> ) {
+ last if /^.$/;
+ chomp $_;
+ push @serviceMessage, $_;
+ }
+ }
}
sub getFilesListing(){
@@ -51,7 +128,7 @@
}
sub createSpecFile(){
- open( SPECFILE, "> $serviceName-$serviceVersion.spec" );
+ open( SPECFILE, "> SPECS/$serviceName-$serviceVersion.spec" );
select SPECFILE;
print "Summary: $serviceSummary\n";
@@ -123,7 +200,16 @@
}
sub createSourceFile(){
- if( system("tar -zcvf $serviceName-$serviceVersion.tar.gz webapps") != 0
){
+ if( system("mkdir $serviceName-$serviceVersion") != 0 ){
+ print "There was a problem creating the source file directory (which
will have the webapps directory inside it).\n";
+ print "Try doing it manually (mkdir $serviceName-$serviceVersion)
and check what's wrong.\n";
+ exit;
+ }
+ #if( system("cp -R ../webapps $serviceName-$serviceVersion/") != 0 ){
+ # print "There was a problem copying the webapps directory.\n";
+ # exit;
+ #}
+ if( system("tar -zcvf SOURCES/$serviceName-$serviceVersion.tar.gz
$serviceName-$serviceVersion") != 0 ){
print "There was a problem creating the source file (it is a tar.gz
of the webapps directory)\n";
print "Try doing it manually (tar -zcvf
$serviceName-$serviceVersion.tar.gz webapps) and check what's wrong.\n";
exit;
@@ -132,7 +218,7 @@
sub createRpmBuildTree(){
open( RPMMACROS, "> .rpmmacros");
- print RPMMACROS "\%_topdir /home/perfsonar/rpm";
+ print RPMMACROS "\%_topdir /home/perfsonar/rpm\n";
print RPMMACROS "\%_tmppath /home/perfsonar/rpm/tmp";
close RPMMACROS;
@@ -150,6 +236,5 @@
}
sub buildRpm(){
- chdir("rpm/SPECS");
- `rpmbuild -ba $serviceName-$serviceVersion.spec`;
+ `rpmbuild -ba SPECS/$serviceName-$serviceVersion.spec`;
}
- perfsonar: r3040 - in branches/rpm: . geant2_java-rrd-ma/webapps/geant2_java-rrd-ma-2.3.1/WEB-INF/classes/perfsonar/conf, svnlog, 11/15/2007
Archive powered by MHonArc 2.6.16.