SHA256
1
0
forked from pool/csound

Accepting request 107162 from multimedia:apps

- updated to version 5.16.6, including a fix for
  VUL-0: CVE-2012-0270: csound: two buffer overflow flaws in
  getnum() (bnc#749073)
- drop obsoleted patches

- updated to version 5.15.0
- drop unused patches
- fix wrong memset and strncat usage ({memset,strncat}-fix.patch)
- create -devel subpackage

OBS-URL: https://build.opensuse.org/request/show/107162
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/csound?expand=0&rev=18
This commit is contained in:
Stephan Kulow 2012-03-01 16:19:05 +00:00 committed by Git OBS Bridge
commit 1dba2f016f
10 changed files with 101 additions and 260 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:85557740bfc321bfd553ba082b18055ce76fd7b2d9eccd706ffb60801f423c32
size 11105246

3
Csound5.16.6.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0ba912850152aeddb7eb757a33c185e3d50b4807548db6d7ba6cf85de15e7ffb
size 8735038

View File

@ -1,12 +0,0 @@
--- InOut/rtalsa.c-dist 2007-01-22 11:31:00.000000000 +0100
+++ InOut/rtalsa.c 2007-01-22 11:31:28.000000000 +0100
@@ -27,6 +27,9 @@
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#endif
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 1
+#endif
#ifndef _BSD_SOURCE
#define _BSD_SOURCE 1
#endif

View File

@ -1,14 +0,0 @@
--- Opcodes/gab/sliderTable.c-dist 2007-06-11 18:20:22.000000000 +0200
+++ Opcodes/gab/sliderTable.c 2007-06-11 18:29:35.000000000 +0200
@@ -364,9 +364,9 @@ static int sliderTable64(CSOUND *csound,
break; \
} \
*outTable++ = \
- *yt1++ = *c1++ * value + *c2++ * *yt1; /* filters the output */ \
+ *yt1 = *c1++ * value + *c2++ * *yt1; /* filters the output */ \
\
- min++; max++; j++; ftp++; \
+ yt1++; min++; max++; j++; ftp++; \
} \
} \
return OK;

View File

@ -1,145 +0,0 @@
--- SConstruct-dist 2008-10-01 14:46:05.000000000 +0200
+++ SConstruct 2008-10-01 15:25:35.000000000 +0200
@@ -266,19 +266,19 @@
Tool('mingw')(commonEnvironment)
customCPPPATH = commonEnvironment['customCPPPATH']
-commonEnvironment.Prepend(CPPPATH = customCPPPATH)
+commonEnvironment.Prepend(CPPPATH = Split(customCPPPATH))
customCCFLAGS = commonEnvironment['customCCFLAGS']
-commonEnvironment.Prepend(CCFLAGS = customCCFLAGS)
+commonEnvironment.Prepend(CCFLAGS = Split(customCCFLAGS))
customCXXFLAGS = commonEnvironment['customCXXFLAGS']
-commonEnvironment.Prepend(CXXFLAGS = customCXXFLAGS)
+commonEnvironment.Prepend(CXXFLAGS = Split(customCXXFLAGS))
customLIBS = commonEnvironment['customLIBS']
-commonEnvironment.Prepend(LIBS = customLIBS)
+commonEnvironment.Prepend(LIBS = Split(customLIBS))
customLIBPATH = commonEnvironment['customLIBPATH']
-commonEnvironment.Prepend(LIBPATH = customLIBPATH)
+commonEnvironment.Prepend(LIBPATH = Split(customLIBPATH))
customSHLINKFLAGS = commonEnvironment['customSHLINKFLAGS']
-commonEnvironment.Prepend(SHLINKFLAGS = customSHLINKFLAGS)
+commonEnvironment.Prepend(SHLINKFLAGS = Split(customSHLINKFLAGS))
customSWIGFLAGS = commonEnvironment['customSWIGFLAGS']
-commonEnvironment.Prepend(SWIGFLAGS = customSWIGFLAGS)
+commonEnvironment.Prepend(SWIGFLAGS = Split(customSWIGFLAGS))
# Define options for different platforms.
if getPlatform() != 'win32':
@@ -339,15 +339,15 @@
# Define different build environments for different types of targets.
if not withMSVC():
- commonEnvironment.Prepend(CCFLAGS = "-Wall")
+ commonEnvironment.Prepend(CCFLAGS = ["-Wall"])
if getPlatform() == 'linux':
- commonEnvironment.Append(CCFLAGS = "-DLINUX")
- commonEnvironment.Append(CPPFLAGS = '-DHAVE_SOCKETS')
- commonEnvironment.Append(CPPPATH = '/usr/local/include')
- commonEnvironment.Append(CPPPATH = '/usr/include')
- commonEnvironment.Append(CPPPATH = '/usr/X11R6/include')
- commonEnvironment.Append(CCFLAGS = "-DPIPES")
+ commonEnvironment.Append(CCFLAGS = ["-DLINUX"])
+ commonEnvironment.Append(CPPFLAGS = ['-DHAVE_SOCKETS'])
+ commonEnvironment.Append(CPPPATH = ['/usr/local/include'])
+ commonEnvironment.Append(CPPPATH = ['/usr/include'])
+ commonEnvironment.Append(CPPPATH = ['/usr/X11R6/include'])
+ commonEnvironment.Append(CCFLAGS = ["-DPIPES"])
commonEnvironment.Append(LINKFLAGS = ['-Wl,-Bdynamic'])
elif getPlatform() == 'darwin':
commonEnvironment.Append(CCFLAGS = "-DMACOSX")
@@ -519,9 +519,9 @@
if getPlatform() == 'win32':
if configure.CheckHeader("winsock.h", language = "C"):
- commonEnvironment.Append(CPPFLAGS = '-DHAVE_SOCKETS')
+ commonEnvironment.Append(CPPFLAGS = ['-DHAVE_SOCKETS'])
elif configure.CheckHeader("sys/socket.h", language = "C"):
- commonEnvironment.Append(CPPFLAGS = '-DHAVE_SOCKETS')
+ commonEnvironment.Append(CPPFLAGS = ['-DHAVE_SOCKETS'])
if getPlatform() == 'darwin':
commonEnvironment.Append(CPPFLAGS = '-DHAVE_DIRENT_H')
@@ -954,7 +954,7 @@
pyModule_ = env.Program('_%s.so' % targetName, srcs)
else:
if getPlatform() == 'linux':
- pyModule_ = env.SharedLibrary('%s' % targetName, srcs, SHLIBPREFIX="_", SHLIBSUFFIX = '.so')
+ pyModule_ = env.SharedLibrary('%s' % targetName, srcs, SHLIBPREFIX="_", SHLIBSUFFIX = ['.so'])
else:
pyModule_ = env.SharedLibrary('_%s' % targetName, srcs, SHLIBSUFFIX = '.pyd')
if getPlatform() == 'win32' and pythonLibs[0] < 'python24':
@@ -992,7 +992,7 @@
'''))
csoundWrapperEnvironment = csoundInterfacesEnvironment.Copy()
fixCFlagsForSwig(csoundWrapperEnvironment)
- csoundWrapperEnvironment.Append(CPPFLAGS = '-D__BUILDING_CSOUND_INTERFACES')
+ csoundWrapperEnvironment.Append(CPPFLAGS = ['-D__BUILDING_CSOUND_INTERFACES'])
for option in csoundWrapperEnvironment['CCFLAGS']:
if string.find(option, '-D') == 0:
csoundWrapperEnvironment.Append(SWIGFLAGS = [option])
@@ -1407,11 +1407,11 @@
# distribution into the csound5/Opcodes/Loris directory, e.g.
# csound5/Opcodes/Loris/src/*, etc.
lorisEnvironment = pluginEnvironment.Copy()
- lorisEnvironment.Append(CCFLAGS = '-DHAVE_FFTW3_H')
+ lorisEnvironment.Append(CCFLAGS = ['-DHAVE_FFTW3_H'])
if commonEnvironment['buildRelease'] == '0':
- lorisEnvironment.Append(CCFLAGS = '-DDEBUG_LORISGENS')
+ lorisEnvironment.Append(CCFLAGS = ['-DDEBUG_LORISGENS'])
if getPlatform() == 'win32':
- lorisEnvironment.Append(CCFLAGS = '-D_MSC_VER')
+ lorisEnvironment.Append(CCFLAGS = ['-D_MSC_VER'])
if not withMSVC():
lorisEnvironment.Append(CCFLAGS = Split('''
-Wno-comment -Wno-unknown-pragmas -Wno-sign-compare
@@ -1474,15 +1474,15 @@
''')
stkEnvironment = pluginEnvironment.Copy()
if getPlatform() == 'win32':
- stkEnvironment.Append(CCFLAGS = '-D__OS_WINDOWS__')
+ stkEnvironment.Append(CCFLAGS = ['-D__OS_WINDOWS__'])
elif getPlatform() == 'linux':
- stkEnvironment.Append(CCFLAGS = '-D__OS_LINUX__')
+ stkEnvironment.Append(CCFLAGS = ['-D__OS_LINUX__'])
elif getPlatform() == 'darwin':
- stkEnvironment.Append(CCFLAGS = '-D__OS_MACOSX__')
+ stkEnvironment.Append(CCFLAGS = ['-D__OS_MACOSX__'])
if sys.byteorder == 'big':
- stkEnvironment.Append(CCFLAGS = '-D__BIG_ENDIAN__')
+ stkEnvironment.Append(CCFLAGS = ['-D__BIG_ENDIAN__'])
else:
- stkEnvironment.Append(CCFLAGS = '-D__LITTLE_ENDIAN__')
+ stkEnvironment.Append(CCFLAGS = ['-D__LITTLE_ENDIAN__'])
stkEnvironment.Prepend(CPPPATH = Split('''
Opcodes/stk/include Opcodes/stk/src ./ ./../include
'''))
@@ -1523,7 +1523,7 @@
pyEnvironment.Append(LIBS = ['dl', 'm'])
elif getPlatform() == 'win32':
pyEnvironment['ENV']['PATH'] = os.environ['PATH']
- pyEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
+ pyEnvironment.Append(SHLINKFLAGS = ['--no-export-all-symbols'])
pythonOpcodes = makePlugin(pyEnvironment, 'py',
['Opcodes/py/pythonopcodes.c'])
if getPlatform() == 'win32' and pythonLibs[0] < 'python24':
@@ -1713,7 +1713,7 @@
vstEnvironment.Append(SWIGFLAGS = Split('-c++ -includeall -verbose -outdir .'))
if getPlatform() == 'linux':
vstEnvironment.Append(LIBS = ['util', 'dl', 'm'])
- vstEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
+ vstEnvironment.Append(SHLINKFLAGS = ['--no-export-all-symbols'])
vstEnvironment.Append(LINKFLAGS = ['-Wl,-rpath-link,.'])
guiProgramEnvironment.Prepend(LINKFLAGS = ['-Wl,-rpath-link,.'])
os.spawnvp(os.P_WAIT, 'rm', ['rm', '-f', '_CsoundVST.so'])
@@ -2029,7 +2029,7 @@
print "...Building csLadspa"
csLadspaEnv = commonEnvironment.Copy()
csLadspaEnv.Append(LIBS=libCsoundLibs)
-csLadspaEnv.Append(CCFLAGS='-I./frontends/csladspa')
+csLadspaEnv.Append(CCFLAGS=['-I./frontends/csladspa'])
csladspa = csLadspaEnv.SharedLibrary('frontends/csladspa/csladspa.cpp', PREFIX="")
Depends(csladspa, csoundLibrary)
libs.append(csladspa)

View File

@ -1,22 +0,0 @@
--- a/frontends/CsoundVST/Shell.cpp
+++ b/frontends/CsoundVST/Shell.cpp
@@ -211,6 +211,8 @@ namespace csound
void Shell::main(int argc, char **argv)
{
PySys_SetArgv_(argc, argv);
+ /* Sanitize sys.path */
+ PyRun_SimpleString_("import sys; sys.path = filter(None, sys.path)");
}
void Shell::initialize()
--- a/frontends/CsoundVST/ScoreGeneratorVst.cpp
+++ b/frontends/CsoundVST/ScoreGeneratorVst.cpp
@@ -427,6 +427,8 @@
Shell::open();
char *argv[] = {"",""};
PySys_SetArgv(1, argv);
+ /* Sanitize sys.path */
+ PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
PyObject *mainModule = PyImport_ImportModule("__main__");
result = runScript("import sys\n");
if(result)

28
csound-strncat-fix.patch Normal file
View File

@ -0,0 +1,28 @@
Index: OOps/dumpf.c
===================================================================
--- OOps/dumpf.c.orig
+++ OOps/dumpf.c
@@ -175,19 +175,19 @@ static void nkdump(CSOUND *csound, MYFLT
outbuf[0] = '\0';
while (--nk) {
sprintf(buf1, "%ld\t", (long) *kp++);
- strncat(outbuf, buf1, 256);
+ strncat(outbuf, buf1, sizeof(outbuf)-strlen(buf1)-1);
}
sprintf(buf1, "%ld\n", (long) *kp);
- strncat(outbuf, buf1, 256);
+ strncat(outbuf, buf1, sizeof(outbuf)-strlen(buf1)-1);
len = strlen(outbuf);
break;
case 8: *outbuf = '\0';
while (--nk) {
sprintf(buf1, "%6.4f\t", *kp++);
- strncat(outbuf, buf1, 256);
+ strncat(outbuf, buf1, sizeof(outbuf)-strlen(buf1)-1);
}
sprintf(buf1, "%6.4f\n", *kp);
- strncat(outbuf, buf1, 256);
+ strncat(outbuf, buf1, sizeof(outbuf)-strlen(buf1)-1);
len = strlen(outbuf);
break;
default: csound->Die(csound, Str("unknown kdump format"));

View File

@ -1,24 +0,0 @@
--- Top/one_file.c-dist 2006-10-13 12:31:47.000000000 +0200
+++ Top/one_file.c 2007-01-22 12:06:54.000000000 +0100
@@ -24,6 +24,7 @@
#include "csoundCore.h"
#include <ctype.h>
#include <errno.h>
+#include <stdlib.h>
#if defined(LINUX) || defined(__MACH__) || defined(WIN32)
# include <sys/types.h>
# include <sys/stat.h>
@@ -74,8 +75,11 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
do {
#endif
#ifndef WIN32
- if (tmpnam(buf) == NULL)
- csound->Die(csound, Str(" *** cannot create temporary file"));
+ int fd;
+ strcpy(buf, "/tmp/csoundXXXXXX");
+ if ((fd = mkstemp(buf)) < 0)
+ csound->Die(csound, Str(" *** cannot create temporary file"));
+ close(fd);
#else
{
char *s = (char*) csoundGetEnv(csound, "SFDIR");

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Mon Feb 27 12:04:56 CET 2012 - tiwai@suse.de
- updated to version 5.16.6, including a fix for
VUL-0: CVE-2012-0270: csound: two buffer overflow flaws in
getnum() (bnc#749073)
- drop obsoleted patches
-------------------------------------------------------------------
Sun Jan 8 15:04:23 UTC 2012 - prusnak@opensuse.org
- updated to version 5.15.0
- drop unused patches
- fix wrong memset and strncat usage ({memset,strncat}-fix.patch)
- create -devel subpackage
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Sep 18 00:04:38 UTC 2011 - jengelh@medozas.de Sun Sep 18 00:04:38 UTC 2011 - jengelh@medozas.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package csound # spec file for package csound
# #
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,28 +16,37 @@
# #
%define support_fltk 0
Name: csound Name: csound
%define support_fltk 0 BuildRequires: alsa-devel
BuildRequires: alsa-devel fdupes fluidsynth-devel gcc-c++ jack-devel liblo-devel libsndfile-devel portaudio-devel python-devel scons swig BuildRequires: bison
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: fluidsynth-devel
BuildRequires: gcc-c++
BuildRequires: jack-devel
BuildRequires: liblo-devel
BuildRequires: libsndfile-devel
BuildRequires: portaudio-devel
BuildRequires: python-devel
BuildRequires: scons
BuildRequires: swig
%if %support_fltk %if %support_fltk
BuildRequires: fltk-devel libjpeg-devel libpng-devel xorg-x11-devel BuildRequires: fltk-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: xorg-x11-devel
%endif %endif
Version: 5.16.6
Release: 0
Summary: Computer Sound Synthesis and Composition Program Summary: Computer Sound Synthesis and Composition Program
Version: 5.06.0
Release: 130
License: GFDL-1.2 ; LGPL-2.1+ ; MIT License: GFDL-1.2 ; LGPL-2.1+ ; MIT
Group: Productivity/Multimedia/Sound/Utilities Group: Productivity/Multimedia/Sound/Utilities
Source: Csound%{version}.tar.bz2
Source1: README.SuSE
Patch: csound-alsa-fix.diff
Patch1: csound-tmpnam-fix.diff
Patch2: csound-gcc-warning-fix.diff
Patch3: csound-python-2.6-fix.diff
Patch4: csound-sanitize-sys.patch
Url: http://www.csounds.com Url: http://www.csounds.com
AutoReq: on Source: Csound%{version}.tar.gz
Autoprov: off Source1: README.SuSE
Patch3: %{name}-strncat-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -46,59 +55,64 @@ supports an unlimited amount of oscillators and filters.
For detailed information, refer to http://www.csounds.com. For detailed information, refer to http://www.csounds.com.
%package devel
Summary: Development files for Csound
Group: System/Libraries
Requires: %{name} = %{version}
Provides: %{name}-devel-static = %{version}
%description devel
Development files for Csound.
%prep %prep
%setup -q -n Csound%{version} %setup -q -n Csound%{version}
%patch
%patch1
%patch2
%patch3 %patch3
%patch4 -p1 # remove __DATE__ from source files, causes unnecessary rebuilds
sed -i 's:__DATE__:"":' Engine/musmon.c frontends/CsoundVST/CsoundVstFltk.cpp Top/main.c
# copy readme
cp %{SOURCE1} . cp %{SOURCE1} .
# fix encoding # fix encoding
iconv -f latin1 -t utf8 readme-csound5.txt > readme-csound5.txt.utf8 iconv -f latin1 -t utf8 readme-csound5.txt > README
mv readme-csound5.txt.utf8 readme-csound5.txt
test -f custom.py || cp custom.py.mkg custom.py test -f custom.py || cp custom.py.mkg custom.py
%build %build
%if %_lib == "lib64" %if %{_lib} == "lib64"
args="Word64=1" args="Word64=1"
%else %else
args="" args=""
%endif %endif
scons prefix=%{_prefix} buildRelease=1 $args \ scons prefix=%{_prefix} buildRelease=1 $args \
customCCFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ customCCFLAGS="%{optflags} -fno-strict-aliasing" \
customCXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" customCXXFLAGS="%{optflags} -fno-strict-aliasing"
%install %install
%if %_lib == "lib64" %if %{_lib} == "lib64"
args="--word64" args="--word64"
%else %else
args="" args=""
%endif %endif
./install.py --prefix=%{_prefix} --instdir="$RPM_BUILD_ROOT" $args ./install.py --prefix=%{_prefix} --instdir=%{buildroot} $args
rm -f $RPM_BUILD_ROOT%{_prefix}/csound5-*.md5sums rm -f %{buildroot}%{_prefix}/csound5-*.md5sums
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/csound rm -rf %{buildroot}%{_datadir}/doc/csound
# rename conflicting binary names # rename conflicting binary names
mv $RPM_BUILD_ROOT%{_bindir}/sndinfo $RPM_BUILD_ROOT%{_bindir}/csndinfo mv %{buildroot}%{_bindir}/sndinfo %{buildroot}%{_bindir}/csndinfo
mv $RPM_BUILD_ROOT%{_bindir}/extract $RPM_BUILD_ROOT%{_bindir}/csound-extract mv %{buildroot}%{_bindir}/extract %{buildroot}%{_bindir}/csound-extract
# remove devel files %fdupes -s %{buildroot}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a %find_lang %{name}5
rm -rf $RPM_BUILD_ROOT%{_includedir}
%fdupes -s $RPM_BUILD_ROOT
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%files %files -f %{name}5.lang
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING ChangeLog INSTALL readme-csound5.txt README.SuSE %doc AUTHORS COPYING ChangeLog README README.SuSE
%{_bindir}/* %{_bindir}/*
%{_libdir}/csound %{_libdir}/csound/
%{_datadir}/csound
# %{_includedir}/* %files devel
# %{_libdir}/lib* %defattr(-,root,root)
%{_includedir}/csound/
%{_libdir}/libcsound.a
%changelog %changelog