From 504208f754f469d569e210aaf8398b0c25a1aa04 Mon Sep 17 00:00:00 2001 From: Alexander Ploumistos Date: Nov 21 2018 22:34:15 +0000 Subject: Disable static library generation Add patch for exit calls - bug #24, patch by Miquel Garriga --- diff --git a/liborigin-remove-exit-calls.patch b/liborigin-remove-exit-calls.patch new file mode 100644 index 0000000..d6f33d6 --- /dev/null +++ b/liborigin-remove-exit-calls.patch @@ -0,0 +1,75 @@ +diff --git a/OriginFile.cpp b/OriginFile.cpp +index f6c41b4..bcdcccb 100644 +--- a/OriginFile.cpp ++++ b/OriginFile.cpp +@@ -33,14 +33,15 @@ + #include + + OriginFile::OriginFile(const string& fileName) +-: fileVersion(0) ++: fileVersion(0), ioError(0) + { + ifstream file(fileName.c_str(), ios_base::binary); + + if (!file.is_open()) + { +- cerr << "Could not open " << fileName.c_str() << "!" << endl; +- exit(EXIT_FAILURE); ++ cerr << endl << "liborigin: " << strerror(errno) << ": " << fileName.c_str() << endl; ++ ioError = errno; ++ return; + } + + #ifdef GENERATE_CODE_FOR_LOG +@@ -48,8 +49,9 @@ OriginFile::OriginFile(const string& fileName) + logfile = fopen("./opjfile.log", "w"); + if (logfile == nullptr) + { +- cerr << "Could not open opjfile.log !" << endl; +- exit(EXIT_FAILURE); ++ cerr << endl << "liborigin: " << strerror(errno) << ": opjfile.log" << endl; ++ ioError = errno; ++ return; + } + #endif // GENERATE_CODE_FOR_LOG + +@@ -152,10 +154,13 @@ OriginFile::OriginFile(const string& fileName) + fclose(logfile); + #endif // GENERATE_CODE_FOR_LOG + parser.reset(createOriginAnyParser(fileName)); ++ ioError=0; + } + + bool OriginFile::parse() + { ++ if (ioError != 0) ++ return false; + parser->buildVersion = buildVersion; + parser->fileVersion = fileVersion; + return parser->parse(); +diff --git a/OriginFile.h b/OriginFile.h +index 80b6ff2..3a49395 100644 +--- a/OriginFile.h ++++ b/OriginFile.h +@@ -70,7 +70,7 @@ public: + string resultsLogString() const; //!< get Results Log + + private: +- unsigned int fileVersion, buildVersion; ++ unsigned int fileVersion, buildVersion, ioError; + unique_ptr parser; + }; + +diff --git a/opj2dat.cpp b/opj2dat.cpp +index ff53309..230ac84 100644 +--- a/opj2dat.cpp ++++ b/opj2dat.cpp +@@ -54,6 +54,8 @@ int main(int argc, char *argv[]) { + OriginFile opj(inputfile); + int status = opj.parse(); + cout << "Parsing status = " << status << endl; ++ if (! status) ++ return -1; + cout << "OPJ PROJECT \"" << inputfile.c_str() << "\" VERSION = " << opj.version() << endl; + + cout << "number of datasets = " << opj.datasetCount() << endl; diff --git a/liborigin.spec b/liborigin.spec index cd68284..1de288d 100644 --- a/liborigin.spec +++ b/liborigin.spec @@ -1,12 +1,13 @@ Name: liborigin Version: 3.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 Summary: Library for reading OriginLab OPJ project files License: GPLv3 URL: https://sourceforge.net/projects/liborigin/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +Patch0: liborigin-remove-exit-calls.patch # No longer required #BuildRequires: boost-devel @@ -39,11 +40,11 @@ The %{name}-doc package contains documentation for %{name}. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build %cmake -make doc -make +make origin opj2dat doc %install %make_install @@ -70,6 +71,10 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{_docdir}/%{name}/html/ %changelog +* Wed Nov 21 2018 Alexander Ploumistos - 1:3.0.0-2 +- Disable static library generation +- Add patch for exit calls - bug #24, patch by Miquel Garriga + * Sun Nov 18 2018 Alexander Ploumistos - 1:3.0.0-1 - First v3.0.0 release - Remove obsolete code from spec file