SHA256
1
0
forked from pool/csound
csound/csound.spec

187 lines
5.1 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 1
%define maj 6
%define min 0
Name: csound
Version: 6.12.2
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: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: README.SuSE
# Default to using pulseaudio instead of portaudio
Patch2: csound-6.08-default-pulse.patch
# Do not use SSE2 on non-x86_64 platforms
Patch3: csound-6.08-sse2.patch
# Use xdg-open to open a browser to view the manual
Patch4: csound-6.08-xdg-open.patch
# fixup library dirs to use rpm variables
#Patch5: csound-6.08-fix-library-dirs.patch
Patch6: fluidsynth2.patch
Patch0: csound-scons-on-py3.patch
BuildRequires: gcc-c++
BuildRequires: alsa-devel
BuildRequires: bison
BuildRequires: libboost_atomic-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_locale-devel
BuildRequires: libboost_regex-devel
BuildRequires: libboost_thread-devel
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: eigen3-devel
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: fluidsynth-devel
BuildRequires: gcc-c++
BuildRequires: jack-devel
BuildRequires: liblo-devel
#BuildRequires: lua-devel
BuildRequires: libsndfile-devel
BuildRequires: portaudio-devel
BuildRequires: python3-devel
#BuildRequires: scons
BuildRequires: swig
%if %support_fltk
BuildRequires: fltk-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: xorg-x11-devel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global luaver %(lua -v | sed -r 's/Lua ([[:digit:]]+\\.[[:digit:]]+).*/\\1/')
%description
Csound is a software synthesis program. It is fully modular and
supports an unlimited amount of oscillators and filters.
%package -n libcsnd6_%{maj}_%{min}
Summary: csound6 library
Group: System/Libraries
%description -n libcsnd6_%{maj}_%{min}
Library for csound use
%package -n libcsnd64_%{maj}_%{min}
Summary: csound6 library
Group: System/Libraries
%description -n libcsnd64_%{maj}_%{min}
Library for csound use
%package -n lib_jcsound6
Summary: csound6 library
Group: System/Libraries
%description -n lib_jcsound6
Library for csound use
%package plugins
Summary: Plugins
Group: Productivity/Multimedia/Other
%description plugins
Plugins for csound
%package python-bindings
Summary: Plugins
Group: Productivity/Multimedia/OtherBUILDROOT/
%description python-bindings
Plugins for csound
%package devel
Summary: Development files for Csound, a sound synthesis program
Group: Development/Libraries/C and C++
Requires: libcsnd6_%{maj}_%{min} = %{version}
Requires: libcsnd64_%{maj}_%{min} = %{version}
Requires: lib_jcsound6 = %{version}
%description devel
Development files for Csound.
%prep
%setup -q
%patch2 -p1 -b .default-pulse
%ifnarch x86_64
%patch3 -p1 -b .sse2
%endif
%patch4 -p1 -b .xdg-open
#%%patch5 -p1
%patch6 -p1
# remove __DATE__ from source files, causes unnecessary rebuilds
sed -i 's:__DATE__:"":' Engine/musmon.c include/version.h Top/main.c
# copy readme
cp %{SOURCE1} .
%build
# Needed to link libbuchla.so
export CFLAGS="%{optflags} -lm"
export CXXFLAGS="%{optflags} -std=c++11"
%cmake -DPYTHON_LIBRARY="%{_libdir}/libpython%{python_version}.so" \
-DPYTHON_INCLUDE_DIR="%{_includedir}/python%{python_version}" \
-DNEED_PORTTIME:BOOL=OFF \
-DRPM_LUAVER:STRING=%{luaver} \
%if %{_lib} == "lib64"
-DUSE_LIB64:BOOL=ON
%else
-DUSE_LIB64:BOOL=OFF
%endif
# -DRPM_PYTHON_SITEARCH:STRING=%%{python_sitelib} \
make %{_smp_mflags}
%install
%cmake_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