[liborigin2] unretire liborigin2 (#1127173)
Christian Dersch
lupinix at fedoraproject.org
Mon Dec 8 20:27:39 UTC 2014
commit fcd4838d0a83ebf3735404601102069e6cd28d8f
Author: Christian Dersch <chrisdersch at gmail.com>
Date: Mon Dec 8 21:27:09 2014 +0100
unretire liborigin2 (#1127173)
.gitignore | 1 +
...ound-for-parsing-Text-section-in-opj-file.patch | 20 +
OriginDefaultParser.patch | 24 ++
dead.package | 1 -
fix-format-strings.patch | 370 ++++++++++++++++++++
liborigin2.spec | 125 +++++++
sources | 1 +
7 files changed, 541 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 565c2b8..28385e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/liborigin2-20101029.tar.gz
+/liborigin-2.0.0.tar.gz
diff --git a/0001-Workaround-for-parsing-Text-section-in-opj-file.patch b/0001-Workaround-for-parsing-Text-section-in-opj-file.patch
new file mode 100644
index 0000000..bca6f2b
--- /dev/null
+++ b/0001-Workaround-for-parsing-Text-section-in-opj-file.patch
@@ -0,0 +1,20 @@
+--- liborigin/Origin750Parser.cpp 2014-08-06 10:58:28.608795736 +0200
++++ liborigin.new/Origin750Parser.cpp 2014-08-06 10:58:52.680673856 +0200
+@@ -642,6 +642,17 @@
+ //close section 00 00 00 00 0A
+ LAYER += size + (size > 0 ? 0x1 : 0) + 0x5;
+
++
++ if(sec_name == "statcbut" || sec_name == "Recalculate"
++ || sec_name == "Text") // workaround: just skip this section
++ {
++ LAYER -= 0x5;
++ file.seekg(LAYER, ios_base::beg);
++ file >> size;
++ LAYER += size + (size > 0 ? 0x1 : 0) + 0x5;
++ file.seekg(LAYER, ios_base::beg);
++ }
++
+ if(sec_name == "__LayerInfoStorage")
+ break;
+
diff --git a/OriginDefaultParser.patch b/OriginDefaultParser.patch
new file mode 100644
index 0000000..c934000
--- /dev/null
+++ b/OriginDefaultParser.patch
@@ -0,0 +1,24 @@
+--- liborigin/OriginDefaultParser.cpp 2014-08-06 10:58:28.528796142 +0200
++++ liborigin.new/OriginDefaultParser.cpp 2014-08-06 10:58:52.600674262 +0200
+@@ -73,10 +73,12 @@
+ return false;
+ }
+
++#ifndef NO_CODE_GENERATION_FOR_LOG
+ if((debug=fopen("opjfile.log","a")) == NULL ) {
+ printf("Could not open log file!\n");
+ return false;
+ }
++#endif // NO_CODE_GENERATION_FOR_LOG
+
+ ////////////////////////////// check version from header ///////////////////////////////
+ char vers[5];
+@@ -89,7 +91,7 @@
+
+ unsigned char c=0; // tmp char
+
+- fprintf(debug,"HEADER :\n");
++ LOG_PRINT(debug,"HEADER :\n");
+ for(i=0;i<0x16;i++) { // skip header + 5 Bytes ("27")
+ ioret = fread(&c,1,1,f);
+ fprintf(debug,"%.2X ",c);
diff --git a/fix-format-strings.patch b/fix-format-strings.patch
new file mode 100644
index 0000000..0315370
--- /dev/null
+++ b/fix-format-strings.patch
@@ -0,0 +1,370 @@
+diff -Naur liborigin.orig/opj2dat.cpp liborigin.new/opj2dat.cpp
+--- liborigin.orig/opj2dat.cpp 2010-11-23 22:55:07.000000000 +0100
++++ liborigin.new/opj2dat.cpp 2014-12-06 23:18:25.633959427 +0100
+@@ -48,11 +48,11 @@
+ printf("Parsing status = %d\n",status);
+ printf("OPJ PROJECT \"%s\" VERSION = %.2f\n",argv[1],opj.version());
+
+- printf("number of spreadsheets = %d\n",opj.spreadCount());
+- printf("number of matrixes = %d\n",opj.matrixCount());
+- printf("number of functions = %d\n",opj.functionCount());
+- printf("number of graphs = %d\n",opj.graphCount());
+- printf("number of notes = %d\n",opj.noteCount());
++ printf("number of spreadsheets = %zu\n",opj.spreadCount());
++ printf("number of matrixes = %zu\n",opj.matrixCount());
++ printf("number of functions = %zu\n",opj.functionCount());
++ printf("number of graphs = %zu\n",opj.graphCount());
++ printf("number of notes = %zu\n",opj.noteCount());
+ for (unsigned int s=0;s<opj.spreadCount();s++) {
+ Origin::SpreadSheet spread = opj.spread(s);
+ int columnCount=spread.columns.size();
+diff -Naur liborigin.orig/Origin610Parser.cpp liborigin.new/Origin610Parser.cpp
+--- liborigin.orig/Origin610Parser.cpp 2010-11-23 22:55:07.000000000 +0100
++++ liborigin.new/Origin610Parser.cpp 2014-12-06 23:18:25.633959427 +0100
+@@ -546,9 +546,9 @@
+
+ file >> notes.back().text.assign(size - labellen, 0);
+
+- LOG_PRINT(logfile, "NOTE %d NAME: %s\n", notes.size(), notes.back().name.c_str())
+- LOG_PRINT(logfile, "NOTE %d LABEL: %s\n", notes.size(), notes.back().label.c_str())
+- LOG_PRINT(logfile, "NOTE %d TEXT: %s\n", notes.size(), notes.back().text.c_str())
++ LOG_PRINT(logfile, "NOTE %zu NAME: %s\n", notes.size(), notes.back().name.c_str())
++ LOG_PRINT(logfile, "NOTE %zu LABEL: %s\n", notes.size(), notes.back().label.c_str())
++ LOG_PRINT(logfile, "NOTE %zu TEXT: %s\n", notes.size(), notes.back().text.c_str())
+
+ file.seekg(1, ios_base::cur);
+ pos = file.tellg();
+@@ -1480,7 +1480,7 @@
+ GraphCurve& curve(layer.curves.back());
+ file.seekg(LAYER + 0x4C, ios_base::beg);
+ file >> curve.type;
+- LOG_PRINT(logfile, " graph %d layer %d curve %d type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
+ if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour)
+ layer.isXYY3D = false;
+
+@@ -1491,10 +1491,10 @@
+ if(column.first.size() > 0){
+ curve.dataName = column.first;
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.zColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ }
+ }
+@@ -1504,16 +1504,16 @@
+ column = findDataByIndex(w-1);
+ if(column.first.size() > 0){
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ } else if (layer.isXYY3D){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ }
+ }
+@@ -1522,10 +1522,10 @@
+ file >> w;
+ column = findDataByIndex(w-1);
+ if(column.first.size() > 0 && layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+ }
+
+ if(layer.is3D() || layer.isXYY3D)
+diff -Naur liborigin.orig/Origin700Parser.cpp liborigin.new/Origin700Parser.cpp
+--- liborigin.orig/Origin700Parser.cpp 2010-11-23 22:55:07.000000000 +0100
++++ liborigin.new/Origin700Parser.cpp 2014-12-06 23:18:25.633959427 +0100
+@@ -387,7 +387,7 @@
+
+ unsigned int POS = (unsigned int)file.tellg()-11;
+ LOG_PRINT(logfile, "\nHEADER SECTION\n")
+- LOG_PRINT(logfile, " nr_spreads = %d\n", speadSheets.size())
++ LOG_PRINT(logfile, " nr_spreads = %zu\n", speadSheets.size())
+ LOG_PRINT(logfile, " [position @ 0x%X]\n", POS)
+
+ //////////////////////// OBJECT INFOS //////////////////////////////////////
+@@ -1058,7 +1058,7 @@
+ GraphCurve& curve(layer.curves.back());
+ file.seekg(LAYER + 0x4C, ios_base::beg);
+ file >> curve.type;
+- LOG_PRINT(logfile, " graph %d layer %d curve %d type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
+ if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour)
+ layer.isXYY3D = false;
+
+@@ -1069,10 +1069,10 @@
+ if(column.first.size() > 0){
+ curve.dataName = column.first;
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.zColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ }
+ }
+@@ -1082,16 +1082,16 @@
+ column = findDataByIndex(w-1);
+ if(column.first.size() > 0){
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ } else if (layer.isXYY3D){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ }
+ }
+@@ -1100,10 +1100,10 @@
+ file >> w;
+ column = findDataByIndex(w-1);
+ if(column.first.size() > 0 && layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+ }
+
+ if(layer.is3D() || layer.isXYY3D)
+diff -Naur liborigin.orig/Origin750Parser.cpp liborigin.new/Origin750Parser.cpp
+--- liborigin.orig/Origin750Parser.cpp 2014-12-06 23:19:48.197177395 +0100
++++ liborigin.new/Origin750Parser.cpp 2014-12-06 23:18:25.633959427 +0100
+@@ -409,7 +409,7 @@
+
+ unsigned int POS = (unsigned int)file.tellg()-11;
+ LOG_PRINT(logfile, "\nHEADER SECTION\n")
+- LOG_PRINT(logfile, " nr_spreads = %d\n", speadSheets.size())
++ LOG_PRINT(logfile, " nr_spreads = %zu\n", speadSheets.size())
+ LOG_PRINT(logfile, " [position @ 0x%X]\n", POS)
+
+ //////////////////////// OBJECT INFOS //////////////////////////////////////
+@@ -550,9 +550,9 @@
+
+ file >> notes.back().text.assign(size - labellen, 0);
+
+- LOG_PRINT(logfile, "NOTE %d NAME: %s\n", notes.size(), notes.back().name.c_str())
+- LOG_PRINT(logfile, "NOTE %d LABEL: %s\n", notes.size(), notes.back().label.c_str())
+- LOG_PRINT(logfile, "NOTE %d TEXT: %s\n", notes.size(), notes.back().text.c_str())
++ LOG_PRINT(logfile, "NOTE %zu NAME: %s\n", notes.size(), notes.back().name.c_str())
++ LOG_PRINT(logfile, "NOTE %zu LABEL: %s\n", notes.size(), notes.back().label.c_str())
++ LOG_PRINT(logfile, "NOTE %zu TEXT: %s\n", notes.size(), notes.back().text.c_str())
+
+ file.seekg(1, ios_base::cur);
+ }
+@@ -661,7 +661,7 @@
+ }
+
+ /////////////// COLUMN Types ///////////////////////////////////////////
+- LOG_PRINT(logfile, " Spreadsheet has %d columns\n", speadSheets[spread].columns.size())
++ LOG_PRINT(logfile, " Spreadsheet has %zu columns\n", speadSheets[spread].columns.size())
+
+ vector<SpreadColumn> header;
+ while(1)
+@@ -879,7 +879,7 @@
+ LAYER += 0x5;
+
+ /////////////// COLUMN Types ///////////////////////////////////////////
+- LOG_PRINT(logfile, " Excel sheet %d has %d columns\n", isheet, excels[iexcel].sheets[isheet].columns.size())
++ LOG_PRINT(logfile, " Excel sheet %d has %zu columns\n", isheet, excels[iexcel].sheets[isheet].columns.size())
+
+ while(1)
+ {
+@@ -1654,7 +1654,7 @@
+ GraphCurve& curve(layer.curves.back());
+ file.seekg(LAYER + 0x4C, ios_base::beg);
+ file >> curve.type;
+- LOG_PRINT(logfile, " graph %d layer %d curve %d type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
+
+ file.seekg(LAYER + 0x04, ios_base::beg);
+ file >> w;
+@@ -1663,10 +1663,10 @@
+ if (column.first.size() > 0){
+ curve.dataName = column.first;
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.zColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ }
+ }
+@@ -1676,16 +1676,16 @@
+ column = findDataByIndex(w-1);
+ if (column.first.size() > 0){
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ } else if (layer.isXYY3D){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ }
+ }
+@@ -1694,10 +1694,10 @@
+ file >> w;
+ column = findDataByIndex(w-1);
+ if (column.first.size() > 0 && layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ if(curve.dataName != column.first) {
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+ }
+ }
+
+diff -Naur liborigin.orig/Origin800Parser.cpp liborigin.new/Origin800Parser.cpp
+--- liborigin.orig/Origin800Parser.cpp 2010-11-23 22:55:07.000000000 +0100
++++ liborigin.new/Origin800Parser.cpp 2014-12-06 23:18:25.633959427 +0100
+@@ -416,7 +416,7 @@
+
+ unsigned int POS = (unsigned int)file.tellg()-11;
+ LOG_PRINT(logfile, "\nHEADER SECTION\n")
+- LOG_PRINT(logfile, " nr_spreads = %d\n", speadSheets.size())
++ LOG_PRINT(logfile, " nr_spreads = %zu\n", speadSheets.size())
+ LOG_PRINT(logfile, " [position @ 0x%X]\n", POS)
+
+ POS += 0xB;
+@@ -558,9 +558,9 @@
+
+ file >> notes.back().text.assign(size - labellen, 0);
+
+- LOG_PRINT(logfile, "NOTE %d NAME: %s\n", notes.size(), notes.back().name.c_str())
+- LOG_PRINT(logfile, "NOTE %d LABEL: %s\n", notes.size(), notes.back().label.c_str())
+- LOG_PRINT(logfile, "NOTE %d TEXT: %s\n", notes.size(), notes.back().text.c_str())
++ LOG_PRINT(logfile, "NOTE %zu NAME: %s\n", notes.size(), notes.back().name.c_str())
++ LOG_PRINT(logfile, "NOTE %zu LABEL: %s\n", notes.size(), notes.back().label.c_str())
++ LOG_PRINT(logfile, "NOTE %zu TEXT: %s\n", notes.size(), notes.back().text.c_str())
+
+ file.seekg(1, ios_base::cur);
+ pos = file.tellg();
+@@ -1570,7 +1570,7 @@
+ GraphCurve& curve(layer.curves.back());
+ file.seekg(LAYER + 0x4C, ios_base::beg);
+ file >> curve.type;
+- LOG_PRINT(logfile, " graph %d layer %d curve %d type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu type : %d\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), (int)curve.type)
+
+ file.seekg(LAYER + 0x04, ios_base::beg);
+ file >> w;
+@@ -1579,10 +1579,10 @@
+ if(column.first.size() > 0){
+ curve.dataName = column.first;
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Z : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.zColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ }
+ }
+@@ -1592,16 +1592,16 @@
+ column = findDataByIndex(w-1);
+ if(column.first.size() > 0){
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+
+ if(layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu Y : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.yColumnName = column.second;
+ } else if (layer.isXYY3D){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ } else {
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ }
+ }
+@@ -1610,10 +1610,10 @@
+ file >> w;
+ column = findDataByIndex(w-1);
+ if(column.first.size() > 0 && layer.is3D()){
+- LOG_PRINT(logfile, " graph %d layer %d curve %d X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
++ LOG_PRINT(logfile, " graph %zu layer %zu curve %zu X : %s.%s\n", graphs.size(), graphs.back().layers.size(), layer.curves.size(), column.first.c_str(), column.second.c_str())
+ curve.xColumnName = column.second;
+ if(curve.dataName != column.first)
+- LOG_PRINT(logfile, " graph %d X and Y from different tables\n", graphs.size())
++ LOG_PRINT(logfile, " graph %zu X and Y from different tables\n", graphs.size())
+ }
+
+ if(layer.is3D() || layer.isXYY3D)
+diff -Naur liborigin.orig/OriginDefaultParser.cpp liborigin.new/OriginDefaultParser.cpp
+--- liborigin.orig/OriginDefaultParser.cpp 2014-12-06 23:19:58.761333237 +0100
++++ liborigin.new/OriginDefaultParser.cpp 2014-12-06 23:18:25.634959441 +0100
+@@ -304,7 +304,7 @@
+
+ int POS = ftell(f)-11;
+ fprintf(debug,"\nHEADER SECTION\n");
+- fprintf(debug," nr_spreads = %d\n",speadSheets.size());
++ fprintf(debug," nr_spreads = %zu\n",speadSheets.size());
+ fprintf(debug," [position @ 0x%X]\n",POS);
+ fflush(debug);
+
+@@ -371,7 +371,7 @@
+ if(spread == -1)
+ spread=i;
+
+- fprintf(debug," SPREADSHEET %d NAME : %s (@ 0x%X) has %d columns\n",
++ fprintf(debug," SPREADSHEET %d NAME : %s (@ 0x%X) has %zu columns\n",
+ spread+1,name,POS + 0x12,speadSheets[spread].columns.size());
+ fflush(debug);
+
+@@ -398,7 +398,7 @@
+ fflush(debug);
+
+ /////////////// COLUMN Types ///////////////////////////////////////////
+- fprintf(debug," Spreadsheet has %d columns\n",speadSheets[spread].columns.size());
++ fprintf(debug," Spreadsheet has %zu columns\n",speadSheets[spread].columns.size());
+ for (unsigned int j=0; j<speadSheets[spread].columns.size(); j++) {
+ fprintf(debug," reading COLUMN %d/%zd type\n",j+1,speadSheets[spread].columns.size());
+ fflush(debug);
diff --git a/liborigin2.spec b/liborigin2.spec
new file mode 100644
index 0000000..4f4f473
--- /dev/null
+++ b/liborigin2.spec
@@ -0,0 +1,125 @@
+%global upname liborigin
+%global major 2.0
+
+Name: %{upname}2
+# The 2.0.0 release of liborigin is known as liborigin2 before. It is
+# incompatible with former releases of liborigin
+Version: %{major}.0
+Release: 5%{?dist}
+Summary: Library for reading OriginLab OPJ project files
+
+License: GPLv2 or GPLv3
+URL: http://sourceforge.net/projects/liborigin/
+Source0: http://sourceforge.net/projects/liborigin/files/liborigin/%{major}/%{upname}-%{version}.tar.gz
+
+# Patch required to read larger OBJ files, patches are submitted to upstream
+# http://sourceforge.net/p/liborigin/bugs/18/
+# http://sourceforge.net/p/liborigin/bugs/19/
+# http://sourceforge.net/p/liborigin/bugs/22/
+Patch0: 0001-Workaround-for-parsing-Text-section-in-opj-file.patch
+Patch1: OriginDefaultParser.patch
+Patch2: fix-format-strings.patch
+
+BuildRequires: boost-devel
+BuildRequires: cmake
+BuildRequires: doxygen
+
+%description
+A library for reading OriginLab OPJ project files.
+
+Compatibility package containing the newer version 2.0
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%package doc
+Summary: Documentation for %{name}
+BuildArch: noarch
+
+%description doc
+The %{name}-doc package contains documentation for %{name}.
+
+%prep
+%setup -q -n %{upname}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+# Recode FORMAT to UTF-8
+iconv -f ISO-8859-5 -t UTF-8 FORMAT > FORMAT.UTF8
+touch -r FORMAT FORMAT.UTF8
+mv FORMAT.UTF8 FORMAT
+
+%build
+# fix for hardcoded path of library location and avoid static lib
+sed -i "s|install(TARGETS origin origin-static DESTINATION lib)|install(TARGETS origin DESTINATION lib\${LIB_SUFFIX})|" CMakeLists.txt
+
+%cmake
+make
+
+
+%install
+%make_install
+
+# We need to move some files to avoid a conflict with liborigin
+mv %{buildroot}%{_includedir}/%{upname} %{buildroot}%{_includedir}/%{name}
+mv %{buildroot}%{_bindir}/opj2dat %{buildroot}%{_bindir}/opj2dat-2.0.0
+mv %{buildroot}%{_docdir}/%{upname} %{buildroot}%{_docdir}/%{name}
+mv %{buildroot}%{_libdir}/liborigin.so %{buildroot}%{_libdir}/liborigin2.so
+find %{buildroot} -name '*.la' -exec rm -f {} ';'
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%if 0%{?fedora} >= 21
+%doc README
+%license COPYING
+%else
+%doc COPYING README
+%endif
+%{_libdir}/*.so.*
+%{_bindir}/opj2dat-2.0.0
+%exclude %{_docdir}/%{name}/html
+
+%files devel
+%{_includedir}/*
+%{_libdir}/*.so
+
+
+%files doc
+%if 0%{?fedora} >= 21
+%doc FORMAT README
+%license COPYING
+%else
+%doc COPYING FORMAT README
+%endif
+%dir %{_docdir}/%{name}
+%{_docdir}/%{name}/html/
+
+
+%changelog
+* Sat Dec 6 2014 Christian Dersch <lupinix at fedoraproject.org> - 2.0.0-5
+- added patch to fix wrong usage of format strings
+- added COPYING to doc subpackage
+- make without smp_mflags macro (not prepared by upstream)
+- spec cleanups (use license macro for Fedora >= 21)
+
+* Sat Aug 30 2014 Christian Dersch <lupinix at fedoraproject.org> - 2.0.0-4
+- some more spec adjustments (dropped dependency of doc subpackage)
+
+* Wed Aug 6 2014 Christian Dersch <lupinix at fedoraproject.org> - 2.0.0-3
+- fixed spec to be conform with guidelines
+
+* Wed Aug 6 2014 Christian Dersch <lupinix at fedoraproject.org> - 2.0.0-2
+- added two patches fixing an issue with larger origin files
+
+* Mon Aug 4 2014 Christian Dersch <lupinix at fedoraproject.org> - 2.0.0-1
+- initial spec
diff --git a/sources b/sources
new file mode 100644
index 0000000..29c873f
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+d75850e7f85787603bbda4dab2190de3 liborigin-2.0.0.tar.gz
More information about the scm-commits
mailing list