File ecasound.spec of Package ecasound

# vim: set ts=4 sw=4 et:
# Copyright (c) 2005-2010 oc2pus, 2011 Pascal Bleser
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments to packman@links2linux.de
%define _lto_cflags %{nil}
%define ruby_sitedir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]')

%{!?python_sitelib:  %global python_sitelib  %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

Name:           ecasound
Summary:        Multitrack audio processing tool
Version:        2.9.1
Release:        0.pm.1
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Editors and Convertors
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
URL:            http://ecasound.seul.org/
# http://ecasound.seul.org/download/ecasound-%{version}.tar.gz
Source:         ecasound-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM incorrect-fsf-address.patch avvissu@yandex.ru -- Fix wrong fsf address
Patch0:         incorrect-fsf-address.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  alsa-devel
BuildRequires:  arts-devel
BuildRequires:  audiofile-devel
BuildRequires:  fdupes
BuildRequires:  flac-devel
BuildRequires:  glib2-devel
BuildRequires:  ladspa
BuildRequires:  libjack-devel
BuildRequires:  liblo-devel
BuildRequires:  liboil-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libtool
BuildRequires:  ncurses-devel
BuildRequires:  python-devel
BuildRequires:  ruby
BuildRequires:  readline-devel
BuildRequires:  libsndfile-devel
Requires:       alsa
Requires:       jack
Requires:       ladspa
BuildRequires:  alsa jack ladspa
%py_requires

%description
Ecasound is a software package designed for multitrack audio
processing. It can be used for simple tasks like audio playback,
recording and format conversions, as well as for multitrack effect
processing, mixing, recording and signal recycling. Ecasound
supports a wide range of audio inputs, outputs and effect
algorithms. Several open-source audio packages, like for instance
ALSA, OSS, mpg123, lame, libaudiofile and MikMod, are directly
supported. One of the advantages of ecasound's chain-based design
is that effects can easily be combined both in series and in
parallel. Oscillators and MIDI-CCs can be used for controlling
effect parameters. Included user-interfaces are ecasound - a
versatile console mode interface, qtecasound - a Qt-based
X-interface and various command-line utils suitable for batch
processing.

%package -n libecasound-devel
Summary:        Library header files for ecasound
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       alsa-devel
Requires:       jack-devel
Requires:       libsndfile-devel
Provides:       ecasound-devel = 2.4.5
Obsoletes:      ecasound-devel < 2.4.5

%description -n libecasound-devel
Headers files needed for compiling other programs against ecasound
libraries.

%package -n python-ecasound
Summary:        Python Bindings to the Ecasound Control Interface
Group:          Development/Libraries/Python
Requires:       %{name} = %{version}
Requires:       python >= %{py_ver}
Provides:       pyecasound = 2.4.5
Obsoletes:      pyecasound < 2.4.5

%description -n python-ecasound
Python bindings to the Ecasound control interface.

%package -n ruby-ecasound
Summary:        Ruby Bindings to the Ecasound Control Interface
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}
Requires:       ruby

%description -n ruby-ecasound
Ruby bindings to the Ecasound control interface.

%package doc
Summary:        Documentation to the Ecasound Control Interface
Group:          Documentation/HTML
Requires:       %{name} = %{version}

%description doc
User documentation for the Ecasound control interface.

%prep
%setup -q
%patch0 -p1

%build
autoreconf -fi
export CFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC"
export CXXFLAGS="$RPM_OPT_FLAGS"
%configure \
    --enable-shared \
    --enable-static \
    --with-pic \
    --enable-sys-readline \
    --enable-liboil \
    --enable-liblo \
    --with-python-modules=%{_libdir}/python%{py_ver} \
    --with-python-includes=%{_includedir}/python%{py_ver}

%__make %{?_smp_flags}

%install
%makeinstall ECA_S_RUBY_SITEDIR="%{ruby_sitedir}"

# clean ups
find Documentation -name 'Makefile*' | xargs %__rm
find examples -name 'Makefile*' -o -name 'ecatrimsilence*' | xargs %__rm
%__rm Documentation/*.1
%__rm %{buildroot}%{_libdir}/lib*.la
#%__rm %{buildroot}%{_libdir}/lib*.a

%__chmod 644 %{buildroot}%{python_sitearch}/*.py
%__chmod 644 %{buildroot}%{ruby_sitedir}/%{name}.rb

%fdupes -s %{buildroot}%{_mandir}

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files
%defattr(-, root, root)
%doc AUTHORS BUGS COPYING COPYING.GPL COPYING.LGPL NEWS README TODO
%doc examples
%{_bindir}/ecasound
%{_bindir}/ecaconvert
%{_bindir}/ecafixdc
%{_bindir}/ecalength
%{_bindir}/ecamonitor
%{_bindir}/ecanormalize
%{_bindir}/ecaplay
%{_bindir}/ecasignalview
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/%{name}.el
%config %{_datadir}/%{name}/ecasoundrc
%config %{_datadir}/%{name}/generic_oscillators
%config %{_datadir}/%{name}/effect_presets
%{_mandir}/*/*

%files -n libecasound-devel
%defattr(-, root, root)
%{_includedir}/kvutils
%{_includedir}/libecasound
%{_includedir}/libecasoundc
%{_bindir}/libecasound-config
%{_bindir}/libecasoundc-config
%{_libdir}/libecasound.a
%{_libdir}/libecasoundc.a
%{_libdir}/libkvutils.a

%files -n python-ecasound
%defattr(-,root,root)
%{python_sitearch}/*.py*

%files -n ruby-ecasound
%defattr(-,root,root)
%{ruby_sitedir}/*

%files doc
%defattr(-,root,root)
%doc Documentation/*

%changelog