rpms/accrete/devel accrete-1.0-savetofile.patch, NONE, 1.1 accrete.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Marek Mahut (mmahut) fedora-extras-commits at redhat.com
Mon Nov 26 18:15:35 UTC 2007


Author: mmahut

Update of /cvs/pkgs/rpms/accrete/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17325/devel

Modified Files:
	.cvsignore sources 
Added Files:
	accrete-1.0-savetofile.patch accrete.spec 
Log Message:
Initial import.


accrete-1.0-savetofile.patch:

--- NEW FILE accrete-1.0-savetofile.patch ---
Marek Mahut <mmahut at fedoraproject.org>: this patch add more interactive support

diff -Naur ./accrete-1.0-original/display.c ./accrete-1.0/display.c
--- ./accrete-1.0-original/display.c	2007-11-24 22:37:57.000000000 +0100
+++ ./accrete-1.0/display.c	2007-11-25 15:03:44.000000000 +0100
@@ -1,13 +1,13 @@
 #include "structs.h"
 
 void 
-display_system (void)
+display_system (char *filename)
 {
      planet_pointer node1; 
      int counter; 
 
      FILE *f;
-     f = fopen("New.System", "w");
+     f = fopen(filename, "w");
 
      fprintf(f,"                         SYSTEM  CHARACTERISTICS\n");
      fprintf(f,"Mass of central star:          %6.3f solar masses\n", stellar_mass_ratio);
@@ -105,5 +105,6 @@
 	  counter++;
 	  node1 = node1->next_planet;
      }
+	printf("\nResult saved in %s.\n", filename);
         fclose(f);
 }
diff -Naur ./accrete-1.0-original/main.c ./accrete-1.0/main.c
--- ./accrete-1.0-original/main.c	2007-11-24 22:37:57.000000000 +0100
+++ ./accrete-1.0/main.c	2007-11-25 15:05:30.000000000 +0100
@@ -22,6 +22,7 @@
   init_genrand(time(NULL));
 }
 
+
 void 
 generate_stellar_system (void)
 {
@@ -87,10 +88,17 @@
 
 
 int 
-main (void)
+main (int argc, char **argv)
 {
+
+  if (argc != 2) {
+	printf("Usage: %s FILE\n", argv[0]);
+	printf("Save the result of simulation of solar system planet formation in FILE.\n");
+       exit(0);
+   }
+
   init();
   generate_stellar_system();
-  display_system();
+  display_system(argv[1]);
   return 0;
 }
diff -Naur ./accrete-1.0-original/proto.h ./accrete-1.0/proto.h
--- ./accrete-1.0-original/proto.h	2007-11-24 22:37:57.000000000 +0100
+++ ./accrete-1.0/proto.h	2007-11-25 14:57:16.000000000 +0100
@@ -17,7 +17,7 @@
 void coalesce_planetesimals(double a, double e, double mass, double crit_mass, double stellar_luminosity_ratio, double body_inner_bound, double body_outer_bound);
 planet_pointer distribute_planetary_masses(double stellar_mass_ratio, double stellar_luminosity_ratio, double inner_dust, double outer_dust);
 /* display.c */
-void display_system(void);
+void display_system(char *filename);
 /* enviro.c */
 double luminosity(double mass_ratio);
 int orbital_zone(double orbital_radius);
@@ -48,7 +48,7 @@
 /* main.c */
 void init(void);
 void generate_stellar_system(void);
-int main(void);
+int main(int argc, char *argv[]);
 /* mtrng.c */
 void init_genrand(unsigned long s);
 void init_by_array(unsigned long init_key[], unsigned long key_length);


--- NEW FILE accrete.spec ---
Name:		accrete
Version:	1.0
Release:	2%{?dist}
Summary:	Accrete is a physical simulation of solar system planet formation

License:	Public Domain
Group:		Applications/Engineering
URL:		http://sourceforge.net/projects/accrete
Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch0:		accrete-1.0-savetofile.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
Accrete is a physical simulation of solar system planet formation,
by modelling a dust cloud around a Sun-like star, injecting a series
of masses which collect dust, and form planets. The simulation then
determines what the planetary environments will be like in terms
of temperature, atmospheric composition, and other factors.

%prep
%setup -q -n %{name}-%{version}
%patch0 -p2 -b .filetosave

%build
make 'CFLAGS=%{optflags}' %{_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
install -Dm 755 accrete $RPM_BUILD_ROOT%{_bindir}/accrete

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc README ChangeLog
%{_bindir}/accrete

%changelog
* Sat Nov 24 2007 Marek Mahut <mmahut at fedoraproject.org> - 1.0-2
- Initial build.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/accrete/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	26 Nov 2007 17:43:46 -0000	1.1
+++ .cvsignore	26 Nov 2007 18:15:02 -0000	1.2
@@ -0,0 +1 @@
+accrete-1.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/accrete/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	26 Nov 2007 17:43:46 -0000	1.1
+++ sources	26 Nov 2007 18:15:02 -0000	1.2
@@ -0,0 +1 @@
+a8586ec1682cb9545ea380d78a8e83d1  accrete-1.0.tar.gz




More information about the fedora-extras-commits mailing list