From 30803eb07845850c6741a8c0856555de06078ad9 Mon Sep 17 00:00:00 2001 From: Till Hofmann Date: Oct 09 2016 10:30:20 +0000 Subject: Add patch to replace mktemp with mkstemp --- diff --git a/ginac-mkstemp.patch b/ginac-mkstemp.patch new file mode 100644 index 0000000..8690422 --- /dev/null +++ b/ginac-mkstemp.patch @@ -0,0 +1,29 @@ +diff --git a/ginac/excompiler.cpp b/ginac/excompiler.cpp +index 68e4a30..49bcfe8 100644 +--- a/ginac/excompiler.cpp ++++ b/ginac/excompiler.cpp +@@ -38,6 +38,7 @@ + #ifdef HAVE_LIBDL + #include + #endif // def HAVE_LIBDL ++#include + #include + #include + #include +@@ -112,12 +113,14 @@ public: + const char* filename_pattern = "./GiNaCXXXXXX"; + char* new_filename = new char[strlen(filename_pattern)+1]; + strcpy(new_filename, filename_pattern); +- if (!mktemp(new_filename)) { ++ int fd = mkstemp(new_filename); ++ if (fd == -1) { + delete[] new_filename; +- throw std::runtime_error("mktemp failed"); ++ throw std::runtime_error("mkstemp failed"); + } + filename = std::string(new_filename); + ofs.open(new_filename, std::ios::out); ++ close(fd); + delete[] new_filename; + } else { + // use parameter as filename diff --git a/ginac.spec b/ginac.spec index 1b1b08d..9926dd5 100644 --- a/ginac.spec +++ b/ginac.spec @@ -5,11 +5,14 @@ Name: ginac Version: 1.7.1 #Release: 10.%{gitdate}git%{gitrev}%{?dist} -Release: 1%{?dist} +Release: 2%{?dist} Summary: C++ library for symbolic calculations License: GPLv2+ URL: http://www.ginac.de/ Source0: http://www.ginac.de/%{name}-%{version}.tar.bz2 +# Patch to replace mktemp with mkstemp. Patch has been upstreamed but is not +# included in the latest release. +Patch0: ginac-mkstemp.patch BuildRequires: bison BuildRequires: cln-devel BuildRequires: cmake @@ -58,6 +61,7 @@ the tool "viewgar" which displays the contents of GiNaC archives. %prep %setup -q +%patch0 -p1 # Destroy the RPATH. sed -i 's| @GINACLIB_RPATH@||' ginac.pc.{in,cmake} @@ -105,6 +109,9 @@ fi %{_bindir}/* %changelog +* Sun Oct 09 2016 Till Hofmann - 1.7.1-2 +- Add patch to replace mktemp with mkstemp + * Mon Oct 03 2016 Till Hofmann - 1.7.1-1 - Update to 1.7.1