csound/csound.spec
2017-11-23 15:03:05 +00:00

115 lines
3.3 KiB
RPMSpec

#
# spec file for package csound
#
# Copyright (c) 2017 SUSE LINUX 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 http://bugs.opensuse.org/
#
%define support_fltk 0
Name: csound
BuildRequires: alsa-devel
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
BuildRequires: fltk-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: xorg-x11-devel
%endif
Version: 5.18.02
Release: 0
Summary: Computer Sound Synthesis and Composition Program
License: GFDL-1.2 and LGPL-2.1+ and MIT
Group: Productivity/Multimedia/Sound/Utilities
Url: http://www.csounds.com
Source: Csound%{version}.tar.gz
Source1: README.SUSE
Patch0: csound-scons-on-py3.patch
Patch3: %{name}-strncat-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Csound is a software synthesis program. It is fully modular and
supports an unlimited amount of oscillators and filters.
%package devel
Summary: Development files for Csound, a sound synthesis program
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Provides: %{name}-devel-static = %{version}
%description devel
Development files for Csound.
%prep
%setup -q -n Csound%{version}
%patch0 -p1
%patch3
# 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} .
# fix encoding
iconv -f latin1 -t utf8 readme-csound5.txt > README
test -f custom.py || cp custom.py.mkg custom.py
%build
%if %{_lib} == "lib64"
args="Word64=1"
%else
args=""
%endif
scons prefix=%{_prefix} buildRelease=1 $args \
customCCFLAGS="%{optflags} -fno-strict-aliasing" \
customCXXFLAGS="%{optflags} -fno-strict-aliasing"
%install
%if %{_lib} == "lib64"
args="--word64"
%else
args=""
%endif
./install.py --prefix=%{_prefix} --instdir=%{buildroot} $args
rm -f %{buildroot}%{_prefix}/csound5-*.md5sums %{buildroot}%{_bindir}/uninstall-csound5
rm -rf %{buildroot}%{_datadir}/doc/csound
# rename conflicting binary names
mv %{buildroot}%{_bindir}/sndinfo %{buildroot}%{_bindir}/csndinfo
mv %{buildroot}%{_bindir}/extract %{buildroot}%{_bindir}/csound-extract
%fdupes -s %{buildroot}
%find_lang %{name}5
%files -f %{name}5.lang
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README README.SUSE
%{_bindir}/*
%{_libdir}/csound/
%files devel
%defattr(-,root,root)
%{_includedir}/csound/
%{_libdir}/libcsound.a
%changelog