File csound.spec of Package csound.463

# spec file for package csound
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           csound
%define support_fltk	0
BuildRequires:  alsa-devel
BuildRequires:  fdupes
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
BuildRequires:  fltk-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  xorg-x11-devel
Summary:        Computer Sound Synthesis and Composition Program
License:        GFDL-1.2 ; LGPL-2.1+ ; MIT
Group:          Productivity/Multimedia/Sound/Utilities
Version:        5.06.0
Release:        139.<RELEASE140>
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
Patch5:         csound-fix-CVE-2012-0270.patch
Patch6:         csound-fix-CVE-2012-2107.patch
AutoReq:        on
Autoprov:       off
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Csound is a software synthesis program. It is fully modular and
supports an unlimited amount of oscillators and filters.

For detailed information, refer to

%setup -q -n Csound%{version}
%patch4 -p1
%patch5 -p1
%patch6 -p1
cp %{SOURCE1} .
# fix encoding
iconv -f latin1 -t utf8 readme-csound5.txt > readme-csound5.txt.utf8
mv readme-csound5.txt.utf8 readme-csound5.txt
test -f || cp

%if %_lib == "lib64"
scons prefix=%{_prefix} buildRelease=1 $args \
  customCCFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
  customCXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"

%if %_lib == "lib64"
./ --prefix=%{_prefix} --instdir="$RPM_BUILD_ROOT" $args
rm -f $RPM_BUILD_ROOT%{_prefix}/csound5-*.md5sums
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/csound
# rename conflicting binary names
mv $RPM_BUILD_ROOT%{_bindir}/sndinfo $RPM_BUILD_ROOT%{_bindir}/csndinfo
mv $RPM_BUILD_ROOT%{_bindir}/extract $RPM_BUILD_ROOT%{_bindir}/csound-extract
# remove devel files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -rf $RPM_BUILD_ROOT%{_includedir}
%fdupes -s $RPM_BUILD_ROOT

[ "$RPM_BUILD_ROOT" != "/" -a -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc COPYING ChangeLog INSTALL readme-csound5.txt README.SuSE
# %{_includedir}/*
# %{_libdir}/lib*