The package rpms/genesis-simulator.git has added or updated architecture specific content
in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/genesis-simulator.git/commit/?id=....
Change:
+%ifarch x86_64
Thanks.
Full change:
============
commit eec2bf9deabf201e911427e1b4883e1ec2d3167d
Author: Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur(a)gmail.com>
Date: Thu Dec 13 16:22:04 2018 +0000
Initial import
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6c88e36
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/genesis-simulator-374cdbc.tar.gz
diff --git a/0001-Update-for-Wformat-security.patch
b/0001-Update-for-Wformat-security.patch
new file mode 100644
index 0000000..1cbb4e0
--- /dev/null
+++ b/0001-Update-for-Wformat-security.patch
@@ -0,0 +1,40 @@
+From d9e47fd67cf079513569698dc03a5f0cd1bdc08e Mon Sep 17 00:00:00 2001
+From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur(a)gmail.com>
+Date: Sun, 9 Dec 2018 15:31:17 +0000
+Subject: [PATCH] Update for -Wformat-security
+
+https://fedoraproject.org/wiki/Format-Security-FAQ
+---
+ genesis/src/sim/sim_method.c | 2 +-
+ genesis/src/tools/lump_p.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/genesis/src/sim/sim_method.c b/genesis/src/sim/sim_method.c
+index 9d4c447..c251a5f 100644
+--- a/genesis/src/sim/sim_method.c
++++ b/genesis/src/sim/sim_method.c
+@@ -205,7 +205,7 @@ int check_method(method)
+ }
+
+ if (valid && IsSilent() < 1) {
+- printf(methodstr);
++ printf("%s", methodstr);
+ }
+
+ return(valid);
+diff --git a/genesis/src/tools/lump_p.c b/genesis/src/tools/lump_p.c
+index 421e38a..86401ee 100644
+--- a/genesis/src/tools/lump_p.c
++++ b/genesis/src/tools/lump_p.c
+@@ -146,7 +146,7 @@ void do_lump_cell(argc,argv)
+ case '\n' :
+ case '\r' :
+ case '\0' :
+- fprintf(fn,line);
++ fprintf(fn,"%s",line);
+ continue;
+ case '/' :
+ if (line[1] == '/') {
+--
+2.19.2
+
diff --git a/0001-Update-scripts-to-use-python3.patch
b/0001-Update-scripts-to-use-python3.patch
new file mode 100644
index 0000000..b68a78f
--- /dev/null
+++ b/0001-Update-scripts-to-use-python3.patch
@@ -0,0 +1,872 @@
+From 1ca2314d633b508d18eaa75166b6a4b429703116 Mon Sep 17 00:00:00 2001
+From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur(a)gmail.com>
+Date: Sun, 9 Dec 2018 17:02:21 +0000
+Subject: [PATCH] Update scripts to use python3
+
+---
+ genesis/Scripts/VAnet2/gipyplot.py | 20 ++++++-------
+ genesis/Scripts/gpython-tools/G3Plot.py | 6 ++--
+ .../gpython-tools/examples/filetest.py | 14 ++++-----
+ .../Scripts/gpython-tools/examples/fplot.py | 8 ++---
+ genesis/Scripts/gpython-tools/fplot.py | 8 ++---
+ genesis/Scripts/gpython-tools/gipyplot.py | 20 ++++++-------
+ genesis/Scripts/gpython-tools/netview-I.py | 12 ++++----
+ genesis/Scripts/gpython-tools/netview.py | 10 +++----
+ genesis/Scripts/gpython-tools/plotPSD.py | 30 +++++++++----------
+ genesis/Scripts/gpython-tools/plotPSD0.py | 30 +++++++++----------
+ genesis/Scripts/gpython-tools/plotVm.py | 16 +++++-----
+ genesis/Scripts/gpython-tools/rasterplot.py | 12 ++++----
+ genesis/Scripts/gpython-tools/rowrateplot.py | 14 ++++-----
+ genesis/Scripts/gpython-tools/weight_hist.py | 16 +++++-----
+ genesis/Scripts/stdp_rules/gipyplot.py | 20 ++++++-------
+ genesis/Scripts/stdp_rules/weight_hist.py | 16 +++++-----
+ 16 files changed, 126 insertions(+), 126 deletions(-)
+
+diff --git a/genesis/Scripts/VAnet2/gipyplot.py b/genesis/Scripts/VAnet2/gipyplot.py
+index ede0260..b76da58 100755
+--- a/genesis/Scripts/VAnet2/gipyplot.py
++++ b/genesis/Scripts/VAnet2/gipyplot.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+ Creates a frame with a toolbar and graph for plotting
+ """
+@@ -106,7 +106,7 @@ class G3Plot(wx.Frame):
+ self.xmax = xmax
+
+ if self.verbose:
+- print "xmin, xmax, ymin, ymax: ", self.xmin, self.xmax, self.ymin,
self.ymax
++ print("xmin, xmax, ymin, ymax: ", self.xmin, self.xmax, self.ymin,
self.ymax)
+
+ self.subplot = []
+ # Give the figure size in inches, and rez
+@@ -159,7 +159,7 @@ class G3Plot(wx.Frame):
+
+ if self.verbose:
+
+- print "Processing %d files." % len(file_list)
++ print("Processing %d files." % len(file_list))
+
+ for f in file_list:
+
+@@ -171,13 +171,13 @@ class G3Plot(wx.Frame):
+
+ self._PlotFile(this_file)
+
+- except Exception, e:
++ except Exception as e:
+
+ sys.exit("Error plotting files: %s" % e)
+
+ else:
+
+- print "File Error: '%s' is not found." % this_file
++ print("File Error: '%s' is not found." % this_file)
+
+ #----------------------------------------------------------------------
+
+@@ -194,7 +194,7 @@ class G3Plot(wx.Frame):
+
+ if self.verbose:
+
+- print "Plotting file: %s" % f
++ print("Plotting file: %s" % f)
+
+
+ this_file = os.path.abspath(f)
+@@ -223,9 +223,9 @@ class G3Plot(wx.Frame):
+
+ plot_data[indx].append(d)
+
+- except IndexError, e:
++ except IndexError as e:
+
+- print "Error processing data line for index %d" %
indx
++ print("Error processing data line for index %d" %
indx)
+
+ # Now we plot all of the data we collected.
+ t = plot_data[0]
+@@ -236,12 +236,12 @@ class G3Plot(wx.Frame):
+
+ num_plots = len(plot_data[1:])
+
+- print "\tPlotting data set %d of %d" % (indx+1,
num_plots)
++ print("\tPlotting data set %d of %d" % (indx+1,
num_plots))
+ self._AddSubplot(t, x)
+
+ else:
+
+- print "File Error: '%s' is not found." % this_file
++ print("File Error: '%s' is not found." % this_file)
+
+ #----------------------------------------------------------------------
+
+diff --git a/genesis/Scripts/gpython-tools/G3Plot.py
b/genesis/Scripts/gpython-tools/G3Plot.py
+index 7ca19a2..4e6e238 100755
+--- a/genesis/Scripts/gpython-tools/G3Plot.py
++++ b/genesis/Scripts/gpython-tools/G3Plot.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # A prototype of a stand-alone application for plotting the output of
+ # GENESIS 3 models. This uses a basic wxPython frame to hold a matplotlib
+@@ -226,10 +226,10 @@ class PlotFrame(wx.Frame):
+ self.plot_file()
+ plotnum += 1
+ else:
+- print '*** Error: Incorrect file name or path
specified'
++ print('*** Error: Incorrect file name or path
specified')
+ # I need to do better error handling!
+ except:
+- print 'An error ocurred'
++ print('An error ocurred')
+ # sys.exit()
+ else:
+ # bring up a warning dialog
+diff --git a/genesis/Scripts/gpython-tools/examples/filetest.py
b/genesis/Scripts/gpython-tools/examples/filetest.py
+index e502f14..84fd271 100755
+--- a/genesis/Scripts/gpython-tools/examples/filetest.py
++++ b/genesis/Scripts/gpython-tools/examples/filetest.py
+@@ -1,18 +1,18 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ import sys, os
+ import pylab
+
+ def process_file():
+- print 'Reading %s' % filename
++ print('Reading %s' % filename)
+ fp = open(filename, 'r')
+ for line in fp.readlines():
+ data = line.split()
+ # print data
+ for x in data:
+- print x,
+- print
+- print "Processing finished"
++ print(x, end=' ')
++ print()
++ print("Processing finished")
+
+ if __name__ == "__main__":
+ try:
+@@ -20,7 +20,7 @@ if __name__ == "__main__":
+ if os.path.exists(filename):
+ process_file()
+ else:
+- print '**Error: Incorrect file name!'
++ print('**Error: Incorrect file name!')
+ except:
+- print '**Error: Exception raised!'
++ print('**Error: Exception raised!')
+ sys.exit()
+diff --git a/genesis/Scripts/gpython-tools/examples/fplot.py
b/genesis/Scripts/gpython-tools/examples/fplot.py
+index ffa2244..dd88f4c 100755
+--- a/genesis/Scripts/gpython-tools/examples/fplot.py
++++ b/genesis/Scripts/gpython-tools/examples/fplot.py
+@@ -1,10 +1,10 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ import sys, os
+ import pylab
+
+ def plot(filename):
+- print 'Plotting %s' % filename
++ print('Plotting %s' % filename)
+ pylab.plotfile(filename, cols=(0,1), delimiter=' ',
+ subplots=False)
+ pylab.show()
+@@ -15,9 +15,9 @@ if __name__ == "__main__":
+ if os.path.exists(filename):
+ plot(filename)
+ else:
+- print '**Error: Incorrect file name or path!'
++ print('**Error: Incorrect file name or path!')
+ except:
+- print '**Error: Exception raised!'
++ print('**Error: Exception raised!')
+ sys.exit()
+
+
+diff --git a/genesis/Scripts/gpython-tools/fplot.py
b/genesis/Scripts/gpython-tools/fplot.py
+index 0793154..d095b31 100755
+--- a/genesis/Scripts/gpython-tools/fplot.py
++++ b/genesis/Scripts/gpython-tools/fplot.py
+@@ -1,10 +1,10 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ import sys, os
+ import pylab
+
+ def plot(filename):
+- print 'Plotting %s' % filename
++ print('Plotting %s' % filename)
+ pylab.plotfile(filename, cols=(0,1), delimiter=' ', subplots=False)
+ pylab.show()
+
+@@ -14,9 +14,9 @@ if __name__ == "__main__":
+ if os.path.exists(filename):
+ plot(filename)
+ else:
+- print '**Error: Incorrect file name or path specified.'
++ print('**Error: Incorrect file name or path specified.')
+ except:
+- print 'incorrect filename'
++ print('incorrect filename')
+ sys.exit()
+
+
+diff --git a/genesis/Scripts/gpython-tools/gipyplot.py
b/genesis/Scripts/gpython-tools/gipyplot.py
+index ede0260..b76da58 100755
+--- a/genesis/Scripts/gpython-tools/gipyplot.py
++++ b/genesis/Scripts/gpython-tools/gipyplot.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+ Creates a frame with a toolbar and graph for plotting
+ """
+@@ -106,7 +106,7 @@ class G3Plot(wx.Frame):
+ self.xmax = xmax
+
+ if self.verbose:
+- print "xmin, xmax, ymin, ymax: ", self.xmin, self.xmax, self.ymin,
self.ymax
++ print("xmin, xmax, ymin, ymax: ", self.xmin, self.xmax, self.ymin,
self.ymax)
+
+ self.subplot = []
+ # Give the figure size in inches, and rez
+@@ -159,7 +159,7 @@ class G3Plot(wx.Frame):
+
+ if self.verbose:
+
+- print "Processing %d files." % len(file_list)
++ print("Processing %d files." % len(file_list))
+
+ for f in file_list:
+
+@@ -171,13 +171,13 @@ class G3Plot(wx.Frame):
+
+ self._PlotFile(this_file)
+
+- except Exception, e:
++ except Exception as e:
+
+ sys.exit("Error plotting files: %s" % e)
+
+ else:
+
+- print "File Error: '%s' is not found." % this_file
++ print("File Error: '%s' is not found." % this_file)
+
+ #----------------------------------------------------------------------
+
+@@ -194,7 +194,7 @@ class G3Plot(wx.Frame):
+
+ if self.verbose:
+
+- print "Plotting file: %s" % f
++ print("Plotting file: %s" % f)
+
+
+ this_file = os.path.abspath(f)
+@@ -223,9 +223,9 @@ class G3Plot(wx.Frame):
+
+ plot_data[indx].append(d)
+
+- except IndexError, e:
++ except IndexError as e:
+
+- print "Error processing data line for index %d" %
indx
++ print("Error processing data line for index %d" %
indx)
+
+ # Now we plot all of the data we collected.
+ t = plot_data[0]
+@@ -236,12 +236,12 @@ class G3Plot(wx.Frame):
+
+ num_plots = len(plot_data[1:])
+
+- print "\tPlotting data set %d of %d" % (indx+1,
num_plots)
++ print("\tPlotting data set %d of %d" % (indx+1,
num_plots))
+ self._AddSubplot(t, x)
+
+ else:
+
+- print "File Error: '%s' is not found." % this_file
++ print("File Error: '%s' is not found." % this_file)
+
+ #----------------------------------------------------------------------
+
+diff --git a/genesis/Scripts/gpython-tools/netview-I.py
b/genesis/Scripts/gpython-tools/netview-I.py
+index 7e7a06c..c04d7d0 100755
+--- a/genesis/Scripts/gpython-tools/netview-I.py
++++ b/genesis/Scripts/gpython-tools/netview-I.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # Basic wxPython frame to hold a matplotlib figure for plotting
+ # It defines some basic menu items with bindings to functions to execute
+@@ -314,8 +314,8 @@ class PlotFrame(wx.Frame):
+ self.dt = float(pdentry.dt_dialog.entry.GetValue())
+ self.NX = int(pdentry.NX_dialog.entry.GetValue())
+ self.NY = int(pdentry.NY_dialog.entry.GetValue())
+- print 'Ntimes = ', self.Ntimes, ' t_min = ', self.t_min
+- print 'NX = ', self.NX, ' NY = ', self.NY
++ print('Ntimes = ', self.Ntimes, ' t_min = ',
self.t_min)
++ print('NX = ', self.NX, ' NY = ', self.NY)
+ pdentry.Destroy()
+ self.t_max = (self.Ntimes - 1)*self.dt
+ # reset slider max and min
+@@ -397,7 +397,7 @@ class PlotFrame(wx.Frame):
+ # imshow expects the data to be scaled to range 0-1.
+ Vmin = xydata.min()
+ Vmax = xydata.max()
+- print 'Vmax = ', Vmax
++ print('Vmax = ', Vmax)
+ # Hack for EPSC data - most points are < 2 nA, but a few are large
+ # Scale data to a more reasonable range
+ Vmax = 2.0e-09
+@@ -443,7 +443,7 @@ class PlotFrame(wx.Frame):
+ # axes legends, etc. The draw_artist(artist), and blit
+ # are much faster than canvas.draw() and are sufficient.
+
+- print 'system time (seconds) = ', time.time()
++ print('system time (seconds) = ', time.time())
+
+ # round frame_min down and frame_max up for the time window
+ frame_min = int(self.t_min/self.dt)
+@@ -472,7 +472,7 @@ class PlotFrame(wx.Frame):
+ self.axes.draw_artist(self.im)
+ self.canvas.blit(self.axes.bbox)
+
+- print 'system time (seconds) = ', time.time()
++ print('system time (seconds) = ', time.time())
+
+ # ------------------------------------------------------------------
+ # Define the classes and functions for getting parameter values
+diff --git a/genesis/Scripts/gpython-tools/netview.py
b/genesis/Scripts/gpython-tools/netview.py
+index 096276d..6971642 100755
+--- a/genesis/Scripts/gpython-tools/netview.py
++++ b/genesis/Scripts/gpython-tools/netview.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # Basic wxPython frame to hold a matplotlib figure for plotting
+ # It defines some basic menu items with bindings to functions to execute
+@@ -314,8 +314,8 @@ class PlotFrame(wx.Frame):
+ self.dt = float(pdentry.dt_dialog.entry.GetValue())
+ self.NX = int(pdentry.NX_dialog.entry.GetValue())
+ self.NY = int(pdentry.NY_dialog.entry.GetValue())
+- print 'Ntimes = ', self.Ntimes, ' t_min = ', self.t_min
+- print 'NX = ', self.NX, ' NY = ', self.NY
++ print('Ntimes = ', self.Ntimes, ' t_min = ',
self.t_min)
++ print('NX = ', self.NX, ' NY = ', self.NY)
+ pdentry.Destroy()
+ self.t_max = (self.Ntimes - 1)*self.dt
+ # reset slider max and min
+@@ -439,7 +439,7 @@ class PlotFrame(wx.Frame):
+ # axes legends, etc. The draw_artist(artist), and blit
+ # are much faster than canvas.draw() and are sufficient.
+
+- print 'system time (seconds) = ', time.time()
++ print('system time (seconds) = ', time.time())
+
+ # round frame_min down and frame_max up for the time window
+ frame_min = int(self.t_min/self.dt)
+@@ -468,7 +468,7 @@ class PlotFrame(wx.Frame):
+ self.axes.draw_artist(self.im)
+ self.canvas.blit(self.axes.bbox)
+
+- print 'system time (seconds) = ', time.time()
++ print('system time (seconds) = ', time.time())
+
+ # ------------------------------------------------------------------
+ # Define the classes and functions for getting parameter values
+diff --git a/genesis/Scripts/gpython-tools/plotPSD.py
b/genesis/Scripts/gpython-tools/plotPSD.py
+index 3c9e7ea..4e68977 100755
+--- a/genesis/Scripts/gpython-tools/plotPSD.py
++++ b/genesis/Scripts/gpython-tools/plotPSD.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # plotPSD ver 0.0 - a command line utility to plot a wildcarded argument
+ # list of files containing time series data, and plot the
+@@ -14,17 +14,17 @@ def do_plot_files(filenames):
+ if len(filenames) > 0:
+ plotnum = 0
+ for file in filenames:
+- print file, plotnum
+- print 'Reading %s' % file
++ print(file, plotnum)
++ print('Reading %s' % file)
+ fp = open(file, 'r')
+ count = len(fp.readlines())
+- print count, " lines"
++ print(count, " lines")
+ fp.close()
+ if (plotnum == 0):
+- print plotnum
++ print(plotnum)
+ tn = np.zeros(count)
+ yn = np.zeros(count)
+- print len(tn)
++ print(len(tn))
+ fp = open(file, 'r')
+ i=0
+ for line in fp.readlines():
+@@ -34,9 +34,9 @@ def do_plot_files(filenames):
+ i += 1
+ plotnum += 1
+ else:
+- print "No files were specified for plotting!"
+- print "Please give one or more filenames as arguments, e.g.\n"
+- print " plotSpectra EPSC_sum_0004sj.txt EPSC_sum_M0004*.txt \n"
++ print("No files were specified for plotting!")
++ print("Please give one or more filenames as arguments, e.g.\n")
++ print(" plotSpectra EPSC_sum_0004sj.txt EPSC_sum_M0004*.txt \n")
+ sys.exit()
+
+ # Now do the plotting of the averaged array data
+@@ -60,16 +60,16 @@ def do_plot_files(filenames):
+ nfft = len(tn)//4
+ overlap = nfft//2
+
+- print npts, nfft
+- print startpt, len(yn)
++ print(npts, nfft)
++ print(startpt, len(yn))
+
+- print 'Plottting average of ', plotnum, ' runs from series ', runid
++ print('Plottting average of ', plotnum, ' runs from series ', runid)
+
+ pxx,freqs=mlab.psd(yn,NFFT=nfft,Fs=fs,noverlap=overlap,window=mlab.window_none)
+ pxx[0] = 0.0
+ ax2.plot(freqs,pxx)
+- print freqs[0], freqs[1], freqs[10], freqs[400]
+- print pxx[0], pxx[1], pxx[10], pxx[400]
++ print(freqs[0], freqs[1], freqs[10], freqs[400])
++ print(pxx[0], pxx[1], pxx[10], pxx[400])
+
+ if __name__ == "__main__":
+ # Get the arguments (possibly wildcarded) into a list of filenames
+@@ -80,7 +80,7 @@ if __name__ == "__main__":
+ # get string following final '_' and remove 1 char suffix
+ runid = fnbase.split('_')[-1][:-1]
+
+- print filenames, runid
++ print(filenames, runid)
+ global tn
+ global yn
+
+diff --git a/genesis/Scripts/gpython-tools/plotPSD0.py
b/genesis/Scripts/gpython-tools/plotPSD0.py
+index 88c73b7..9e6102d 100755
+--- a/genesis/Scripts/gpython-tools/plotPSD0.py
++++ b/genesis/Scripts/gpython-tools/plotPSD0.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # plotPSD0 ver 0.0 - a command line utility to plot a wildcarded argument
+ # list of files containing time series data, and plot the
+@@ -11,7 +11,7 @@ import matplotlib.pyplot as plt
+ import matplotlib.mlab as mlab
+
+ def plot_file(file,format):
+- print 'Plotting %s' % file
++ print('Plotting %s' % file)
+ t = []; y = []
+ fp = open(file, 'r')
+ for line in fp.readlines():
+@@ -38,38 +38,38 @@ def plot_file(file,format):
+ nfft = len(tn)//4
+ overlap = nfft//2
+
+- print npts, nfft
+- print startpt, len(yn)
+- print np.shape(yn), np.size(yn)
++ print(npts, nfft)
++ print(startpt, len(yn))
++ print(np.shape(yn), np.size(yn))
+
+ pxx,freqs=mlab.psd(yn,NFFT=nfft,Fs=fs,noverlap=overlap,window=mlab.window_none)
+ pxx[0] = 0.0
+ ax2.plot(freqs,pxx)
+- print freqs[0], freqs[1], freqs[10], freqs[400]
+- print pxx[0], pxx[1], pxx[10], pxx[400]
++ print(freqs[0], freqs[1], freqs[10], freqs[400])
++ print(pxx[0], pxx[1], pxx[10], pxx[400])
+
+ def do_plot_files(filenames):
+ if len(filenames) > 0:
+ formats = ['k', 'r', 'b', 'g', 'm',
'c']
+ plotnum = 0
+ for file in filenames:
+- print file
++ print(file)
+ format = formats[plotnum % len(formats)]
+- print format, plotnum
++ print(format, plotnum)
+ try:
+ if os.path.exists(file):
+ plot_file(file,format)
+ plotnum = plotnum + 1
+ else:
+- print '*** Error: Incorrect file name or path specified
***'
++ print('*** Error: Incorrect file name or path specified
***')
+ # I need to do better error handling!
+ except:
+- print 'An error ocurred'
++ print('An error ocurred')
+ sys.exit()
+ else:
+- print "No files were specified for plotting!"
+- print "Please give one or more filenames as arguments, e.g.\n"
+- print " plotSpectra EPSC_sum_0004sj.txt EPSC_sum_M0004*.txt \n"
++ print("No files were specified for plotting!")
++ print("Please give one or more filenames as arguments, e.g.\n")
++ print(" plotSpectra EPSC_sum_0004sj.txt EPSC_sum_M0004*.txt \n")
+ sys.exit()
+ if __name__ == "__main__":
+ # Get the arguments (possibly wildcarded) into a list of filenames
+@@ -80,7 +80,7 @@ if __name__ == "__main__":
+ # get string following final '_' and remove 1 char suffix
+ runid = fnbase.split('_')[-1][:-1]
+
+- print filenames, runid
++ print(filenames, runid)
+
+ # create the plot
+ fig = plt.figure()
+diff --git a/genesis/Scripts/gpython-tools/plotVm.py
b/genesis/Scripts/gpython-tools/plotVm.py
+index 6a12531..97a73c3 100755
+--- a/genesis/Scripts/gpython-tools/plotVm.py
++++ b/genesis/Scripts/gpython-tools/plotVm.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # plotVm ver 0.5 - a command line utility to plot a wildcarded argument
+ # list of files containing membrane potential data, and plots them in
+@@ -9,7 +9,7 @@ import matplotlib.pyplot as plt
+ import numpy as np
+
+ def plot_file(file,format):
+- print 'Plotting %s' % file
++ print('Plotting %s' % file)
+ x = []; y = []
+ fp = open(file, 'r')
+ for line in fp.readlines():
+@@ -33,20 +33,20 @@ def do_plot_files(filenames):
+ plot_file(file,format)
+ plotnum = plotnum + 1
+ else:
+- print '*** Error: Incorrect file name or path specified
***'
++ print('*** Error: Incorrect file name or path specified
***')
+ # I need to do better error handling!
+ except:
+- print 'An error ocurred'
++ print('An error ocurred')
+ sys.exit()
+ else:
+- print "No files were specified for plotting!"
+- print "Please give one or more filenames as arguments, e.g.\n"
+- print " plotVm Vm.out pyr4*.out\n"
++ print("No files were specified for plotting!")
++ print("Please give one or more filenames as arguments, e.g.\n")
++ print(" plotVm Vm.out pyr4*.out\n")
+ sys.exit()
+ if __name__ == "__main__":
+ # Get the arguments (possibly wildcarded) into a list of filenames
+ filenames = sys.argv[1:]
+- print filenames
++ print(filenames)
+ # create the plot
+ fig = plt.figure()
+ axes = fig.add_subplot(111)
+diff --git a/genesis/Scripts/gpython-tools/rasterplot.py
b/genesis/Scripts/gpython-tools/rasterplot.py
+index e40a01a..d918fb6 100755
+--- a/genesis/Scripts/gpython-tools/rasterplot.py
++++ b/genesis/Scripts/gpython-tools/rasterplot.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # rasterplot - a command line utility to generate rasterplots of
+ # firing times for a group of neurons. It takes a single filename
+@@ -11,7 +11,7 @@ import sys, os
+ import matplotlib.pyplot as plt
+
+ def plot_file():
+- print 'Plotting %s' % filename
++ print('Plotting %s' % filename)
+ fp = open(filename, 'r')
+ format = 'b.'
+ cell_num = 0
+@@ -22,7 +22,7 @@ def plot_file():
+ # print data[0], data[1], data[2], data[3]
+ for x in data:
+ axes.plot(x, y, format)
+- print "Processing finished"
++ print("Processing finished")
+
+ if __name__ == "__main__":
+ '''
+@@ -40,11 +40,11 @@ if __name__ == "__main__":
+ if os.path.exists(filename):
+ plot_file()
+ else:
+- print '**Error: Incorrect file name or path specified.\n'
+- print 'Usage: rasterplot filename'
++ print('**Error: Incorrect file name or path specified.\n')
++ print('Usage: rasterplot filename')
+ sys.exit()
+ except:
+- print 'Bad file, or other error'
++ print('Bad file, or other error')
+ sys.exit()
+ axes.set_title('Raster Plot: '+filename)
+ axes.set_xlabel('Seconds')
+diff --git a/genesis/Scripts/gpython-tools/rowrateplot.py
b/genesis/Scripts/gpython-tools/rowrateplot.py
+index c06d362..cf244b7 100755
+--- a/genesis/Scripts/gpython-tools/rowrateplot.py
++++ b/genesis/Scripts/gpython-tools/rowrateplot.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # rowrateplot - a command line utility to generate spike frequency vs.
+ # time for groups of neurons. It takes a single filename
+@@ -14,7 +14,7 @@ import matplotlib.pyplot as plt
+ import numpy as np
+
+ def plot_file():
+- print 'Plotting %s' % filename
++ print('Plotting %s' % filename)
+ fp = open(filename, 'r')
+
+ # The first line is a header with the total number of lines in file
+@@ -42,7 +42,7 @@ def plot_file():
+ # The x-axis will display the time values read from the file and added
+ xvalues = []
+ # The y-axis will display the group number, from 1 through ngroups
+- yvalues = range(1,ngroups + 1,1)
++ yvalues = list(range(1,ngroups + 1,1))
+
+ line_num = 0 # following lines will have data
+ # print "array filled with zeroes"
+@@ -75,7 +75,7 @@ def plot_file():
+ # An alternate color map
+ # cm = plt.hot()
+ cb = plt.colorbar()
+- print "Plot finished"
++ print("Plot finished")
+
+ if __name__ == "__main__":
+ '''
+@@ -110,11 +110,11 @@ if __name__ == "__main__":
+ if os.path.exists(filename):
+ plot_file()
+ else:
+- print '**Error: Incorrect file name or path specified.\n'
+- print 'Usage: freqplot filename'
++ print('**Error: Incorrect file name or path specified.\n')
++ print('Usage: freqplot filename')
+ sys.exit()
+ except:
+- print 'Bad file, or other error'
++ print('Bad file, or other error')
+ sys.exit()
+ plt.show()
+
+diff --git a/genesis/Scripts/gpython-tools/weight_hist.py
b/genesis/Scripts/gpython-tools/weight_hist.py
+index f15f0bb..32ac1c6 100755
+--- a/genesis/Scripts/gpython-tools/weight_hist.py
++++ b/genesis/Scripts/gpython-tools/weight_hist.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # weight_hist.py ver 1.0 - a command line utility to plot a wildcarded argument
+ # list of files containing a line of connection weight values as a histogram.
+@@ -21,7 +21,7 @@ def print_help():
+ If there is more than one file, the data are plotted as separately
+ colored and labeled bars.
+ """
+- print msg
++ print(msg)
+
+ def do_plot_files(filenames):
+ formats = ['r', 'g', 'b', 'k', 'm',
'c']
+@@ -34,17 +34,17 @@ def do_plot_files(filenames):
+ if os.path.exists(file):
+ fp = open(file, 'r')
+ values = np.loadtxt(fp, dtype='float')
+- print format, plotnum
++ print(format, plotnum)
+ nvalues = len(values)
+- print 'Number of values = %d' % nvalues
++ print('Number of values = %d' % nvalues)
+ datasets.append(values)
+ colors.append(format)
+ ndatasets = len(datasets)
+- print 'Number of datasets = %d' % ndatasets
+- print 'Plotting %s' % file
++ print('Number of datasets = %d' % ndatasets)
++ print('Plotting %s' % file)
+ plotnum = plotnum + 1
+ else:
+- print '*** Error: Incorrect file name or path specified
***'
++ print('*** Error: Incorrect file name or path specified
***')
+ sys.exit()
+ # I need to do better error handling!
+ # Now make the histogram with the data in values
+@@ -57,7 +57,7 @@ if __name__ == "__main__":
+ if len(filenames) == 0:
+ print_help()
+ sys.exit()
+- print filenames
++ print(filenames)
+ # Generate a RUNID from a string like "W128ex32inh_0.20.txt"
+ fn1 = sys.argv[1]
+ fnbase,ext = os.path.splitext(fn1)
+diff --git a/genesis/Scripts/stdp_rules/gipyplot.py
b/genesis/Scripts/stdp_rules/gipyplot.py
+index ede0260..b76da58 100755
+--- a/genesis/Scripts/stdp_rules/gipyplot.py
++++ b/genesis/Scripts/stdp_rules/gipyplot.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """
+ Creates a frame with a toolbar and graph for plotting
+ """
+@@ -106,7 +106,7 @@ class G3Plot(wx.Frame):
+ self.xmax = xmax
+
+ if self.verbose:
+- print "xmin, xmax, ymin, ymax: ", self.xmin, self.xmax, self.ymin,
self.ymax
++ print("xmin, xmax, ymin, ymax: ", self.xmin, self.xmax, self.ymin,
self.ymax)
+
+ self.subplot = []
+ # Give the figure size in inches, and rez
+@@ -159,7 +159,7 @@ class G3Plot(wx.Frame):
+
+ if self.verbose:
+
+- print "Processing %d files." % len(file_list)
++ print("Processing %d files." % len(file_list))
+
+ for f in file_list:
+
+@@ -171,13 +171,13 @@ class G3Plot(wx.Frame):
+
+ self._PlotFile(this_file)
+
+- except Exception, e:
++ except Exception as e:
+
+ sys.exit("Error plotting files: %s" % e)
+
+ else:
+
+- print "File Error: '%s' is not found." % this_file
++ print("File Error: '%s' is not found." % this_file)
+
+ #----------------------------------------------------------------------
+
+@@ -194,7 +194,7 @@ class G3Plot(wx.Frame):
+
+ if self.verbose:
+
+- print "Plotting file: %s" % f
++ print("Plotting file: %s" % f)
+
+
+ this_file = os.path.abspath(f)
+@@ -223,9 +223,9 @@ class G3Plot(wx.Frame):
+
+ plot_data[indx].append(d)
+
+- except IndexError, e:
++ except IndexError as e:
+
+- print "Error processing data line for index %d" %
indx
++ print("Error processing data line for index %d" %
indx)
+
+ # Now we plot all of the data we collected.
+ t = plot_data[0]
+@@ -236,12 +236,12 @@ class G3Plot(wx.Frame):
+
+ num_plots = len(plot_data[1:])
+
+- print "\tPlotting data set %d of %d" % (indx+1,
num_plots)
++ print("\tPlotting data set %d of %d" % (indx+1,
num_plots))
+ self._AddSubplot(t, x)
+
+ else:
+
+- print "File Error: '%s' is not found." % this_file
++ print("File Error: '%s' is not found." % this_file)
+
+ #----------------------------------------------------------------------
+
+diff --git a/genesis/Scripts/stdp_rules/weight_hist.py
b/genesis/Scripts/stdp_rules/weight_hist.py
+index f15f0bb..32ac1c6 100755
+--- a/genesis/Scripts/stdp_rules/weight_hist.py
++++ b/genesis/Scripts/stdp_rules/weight_hist.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ # weight_hist.py ver 1.0 - a command line utility to plot a wildcarded argument
+ # list of files containing a line of connection weight values as a histogram.
+@@ -21,7 +21,7 @@ def print_help():
+ If there is more than one file, the data are plotted as separately
+ colored and labeled bars.
+ """
+- print msg
++ print(msg)
+
+ def do_plot_files(filenames):
+ formats = ['r', 'g', 'b', 'k', 'm',
'c']
+@@ -34,17 +34,17 @@ def do_plot_files(filenames):
+ if os.path.exists(file):
+ fp = open(file, 'r')
+ values = np.loadtxt(fp, dtype='float')
+- print format, plotnum
++ print(format, plotnum)
+ nvalues = len(values)
+- print 'Number of values = %d' % nvalues
++ print('Number of values = %d' % nvalues)
+ datasets.append(values)
+ colors.append(format)
+ ndatasets = len(datasets)
+- print 'Number of datasets = %d' % ndatasets
+- print 'Plotting %s' % file
++ print('Number of datasets = %d' % ndatasets)
++ print('Plotting %s' % file)
+ plotnum = plotnum + 1
+ else:
+- print '*** Error: Incorrect file name or path specified
***'
++ print('*** Error: Incorrect file name or path specified
***')
+ sys.exit()
+ # I need to do better error handling!
+ # Now make the histogram with the data in values
+@@ -57,7 +57,7 @@ if __name__ == "__main__":
+ if len(filenames) == 0:
+ print_help()
+ sys.exit()
+- print filenames
++ print(filenames)
+ # Generate a RUNID from a string like "W128ex32inh_0.20.txt"
+ fn1 = sys.argv[1]
+ fnbase,ext = os.path.splitext(fn1)
+--
+2.19.2
+
diff --git a/genesis-simulator.spec b/genesis-simulator.spec
new file mode 100644
index 0000000..448a152
--- /dev/null
+++ b/genesis-simulator.spec
@@ -0,0 +1,182 @@
+# Upstream has been informed of incorrect FSF addresses
+#
https://github.com/genesis-sim/genesis-2.4/issues/4
+
+
+%global commit 374cdbc7971ccffa0a0fe270ce9904e30c0802dc
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+%global realname genesis
+%global instdir %{_datadir}/%{name}
+
+Name: %{realname}-simulator
+Summary: A general purpose simulation platform
+Version: 2.4
+Release: 1.20181209git374cdbc%{?dist}
+Url:
http://www.genesis-sim.org/GENESIS/
+Source0:
https://github.com/genesis-sim/%{realname}-%{version}/archive/%{commit}/%...
+# Fix for format-security issues. Sent upstream:
+#
https://github.com/genesis-sim/genesis-2.4/pull/2
+Patch0: 0001-Update-for-Wformat-security.patch
+# Update scripts to use python3. Also sent upstream
+#
https://github.com/genesis-sim/genesis-2.4/pull/3
+Patch1: 0001-Update-scripts-to-use-python3.patch
+
+# GPL and LGPL: Genesis
+# MIT: param library
+# Public Domain: Scripts
+License: GPLv2+ and LGPLv2+ and MIT and Public Domain
+
+BuildRequires: gcc
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: flex-devel
+BuildRequires: ncurses-devel
+BuildRequires: libX11-devel
+BuildRequires: libXt-devel
+BuildRequires: netcdf-devel
+BuildRequires: git
+
+%description
+GENESIS (short for GEneral NEural SImulation System) is a general
+purpose simulation platform that was developed to support the
+simulation of neural systems ranging from subcellular components and
+biochemical reactions to complex models of single neurons, simulations
+of large networks, and systems-level models. As such, GENESIS, and its
+version for parallel and networked computers (PGENESIS) was the first
+broad scale modeling system in computational biology to encourage
+modelers to develop and share model features and components. Most
+current GENESIS applications involve realistic simulations of
+biological neural systems. Although the software can also model more
+abstract networks, other simulators are more suitable for
+backpropagation and similar connectionist modeling.
+
+%package devel
+Summary: Static library and tools for building genesis extensions
+%description devel
+%{summary}.
+
+%package doc
+BuildArch: noarch
+Summary: Documentation for %{name}
+%description doc
+%{summary}.
+
+%ifarch x86_64
+%global extraflags -DLONGWORDS
+%endif
+
+%prep
+%autosetup -n %{realname}-%{version}-%{commit}/%{realname} -p2 -S git
+
+# Correct spurious perms
+find Doc -type f -exec chmod -x '{}' \;
+# Correct shebang for perl scripts
+find Scripts/purkinje/perl -exec sed -i 's|#!/usr/local/bin/perl -w|#!/usr/bin/perl
-w|' '{}' \;
+
+# Correct executable perms
+find Scripts -type f -exec chmod -x '{}' \;
+find Tutorials -type f -exec chmod -x '{}' \;
+
+# file-not-utf8
+pushd Scripts/burster
+# Convert to utf-8
+for file in README README.txt; do
+ iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
+ touch -r $file $file.new && \
+ mv $file.new $file
+done
+popd
+
+# Remove the binaries they ship
+rm -rf ../%{realname}-binaries
+
+# Remove unrelated programs
+rm -rf ./src/contrib
+
+# Remove bundled netcdf
+rm -rf ./src/diskio/interface/netcdf/netcdf-3.4
+# Do not use bundled netcdflib
+sed -i 's/netcdflib.o: netcdflib/netcdflib.o:/'
./src/diskio/interface/netcdf/Makefile
+
+# Set up Makefile for Linux installation
+cp src/Makefile.dist src/Makefile
+cat >>src/Makefile <<EOF
+MACHINE=Linux
+OS=BSD
+XLIB=%{_libdir}
+CC=gcc
+CPP=cpp -P
+CFLAGS=%{optflags} %{?extraflags}
+LD=ld
+RANLIB=ranlib
+AR=ar
+YACC=bison -y
+LEX=flex -l
+LEXLIB=-lfl
+LIBS=\$(LEXLIB) -lm -lnetcdf
+TERMCAP=-lncurses
+TERMOPT=-DTERMIO -DDONT_USE_SIGIO
+NETCDFOBJ = \
+ \$(DISKIODIR)/interface/\$(NETCDFSUBDIR)/netcdflib.o
+EOF
+
+%build
+make -C src %{?_smp_mflags} genesis
+
+%install
+make -C src install INSTALLDIR=%{buildroot}%{_libdir}/genesis
+rm -r %{buildroot}%{_libdir}/genesis/{src,man}
+rm -v %{buildroot}%{_libdir}/genesis/.*simrc
+chmod -x %{buildroot}%{_libdir}/genesis/startup/*
+
+mkdir -p %{buildroot}%{_bindir}
+mv %{buildroot}%{_libdir}/genesis/genesis %{buildroot}%{_bindir}/
+
+mkdir -p %{buildroot}%{_includedir}
+mv %{buildroot}%{_libdir}/genesis/include %{buildroot}%{_includedir}/genesis
+
+mv %{buildroot}%{_libdir}/genesis/bin/convert %{buildroot}%{_bindir}/genesis-convert
+install -D man/man1/convert.1 %{buildroot}%{_mandir}/man1/genesis-convert.1
+cp src/libsh %{buildroot}%{_libdir}/genesis/lib
+
+find %{buildroot}%{_libdir}/genesis/startup/ -name '*simrc' -exec \
+ sed -i 's|%{buildroot}||g' {} \;
+
+# Fix permission for man
+chmod -x %{buildroot}%{_mandir}/man1/%{realname}-convert.1*
+
+# Remove docs from libdir
+rm -rf %{buildroot}%{_libdir}/%{realname}/Doc
+rm -rf %{buildroot}%{_libdir}/%{realname}/Hyperdoc
+rm -rf %{buildroot}%{_libdir}/%{realname}/Tutorials
+rm -rf %{buildroot}%{_libdir}/%{realname}/Scripts
+
+# add emacs mode
+
+%files
+%{_bindir}/%{realname}
+%{_bindir}/%{realname}-convert
+%license GPLicense LGPLicense
+%doc AUTHORS COPYRIGHT CONTACTING.GENESIS ChangeLog
+%exclude %{_libdir}/%{realname}/lib
+%exclude %{_libdir}/%{realname}/*make
+%{_libdir}/%{realname}
+%{_mandir}/man1/*
+
+%files devel
+%license GPLicense LGPLicense
+%{_includedir}/%{realname}/
+%{_libdir}/%{realname}/lib
+%{_libdir}/%{realname}/*make
+
+%files doc
+%license GPLicense LGPLicense
+%doc Doc Hyperdoc Tutorials Scripts
+
+%changelog
+* Wed Dec 12 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> -
2.4-1.20181209git374cdbc
+- Add all licenses
+- Add gcc to BR
+- Add checkout date in timestamp
+- Initial build for Fedora repos
+- Use latest git commit
diff --git a/sources b/sources
new file mode 100644
index 0000000..b0ab18b
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (genesis-simulator-374cdbc.tar.gz) =
83c565b06f4df2949da72d40bd79da70155aa7df73513202497bca9a134ea9304d8378c716a77e760d54480673422257490d06f1440ce8bde85d13de12ac1a37