File sonic-visualiser.spec of Package sonic-visualiser

#
# spec file for package sonic-visualiser
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 Tom Mbrt <tom.mbrt@googlemail.com>
# Copyright (c) 2005-2010 oc2pus
# Copyright (c) 2011 Evstifeev Roman <someuniquename@gmail.com>
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/
#

Name:           sonic-visualiser
Version:        2.5
Release:        0
Summary:        A program for viewing and analysing contents of audio files
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Utilities
Url:            http://www.sonicvisualiser.org/
Source:         https://code.soundsoftware.ac.uk/attachments/download/1675/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Source2:        %{name}.xml
Patch0:         sonic-visualiser-ld-X11-fix.patch
Patch1:         sonic-visualiser-remove-svcore-test.patch
BuildRequires:  alsa-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  curl-devel
BuildRequires:  dssi
BuildRequires:  fftw3-devel
BuildRequires:  flac
BuildRequires:  flac-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  ladspa
BuildRequires:  libbz2-devel
BuildRequires:  libid3tag-devel
BuildRequires:  libjack-devel
BuildRequires:  libjpeg8-devel
BuildRequires:  liblo-devel
BuildRequires:  liblrdf-devel
BuildRequires:  libogg-devel
BuildRequires:  liboggz-devel >= 0.9.5
BuildRequires:  libpng-devel
BuildRequires:  libpulse-devel
BuildRequires:  libqt5-qtbase-devel >= 5.2
BuildRequires:  libraptor-devel >= 2.0.4
BuildRequires:  librasqal-devel
BuildRequires:  libredland-devel >= 1.0.14
BuildRequires:  librubberband-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libserd-0-devel
BuildRequires:  libsndfile-devel
BuildRequires:  libsord-0-devel
BuildRequires:  libspeex-devel
BuildRequires:  libvorbis-devel
BuildRequires:  libxslt-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(mad)
BuildRequires:  portaudio-devel
BuildRequires:  shared-mime-info
BuildRequires:  update-desktop-files
BuildRequires:  vamp-plugin-sdk-devel >= 2.5
BuildRequires:  xorg-x11-devel
BuildRequires:  zlib-devel
BuildRequires:  libfishsound-devel >= 0.8.0
%if 0%{?BUILD_ORIG}
BuildRequires:  libdataquay-devel >= 0.9
%endif
Requires:       dssi
Requires:       ladspa

%description
Sonic Visualiser is a program for viewing and analysing the contents
of music audio files.

With Sonic Visualiser you can:
* Load audio files in various formats and view their waveforms

* Look at audio visualisations such as spectrogram views, with
  interactive adjustment of display parameters

* Annotate audio data by adding labelled time points and defining
  segments, point values and curves

* Run feature-extraction plugins to calculate annotations
  automatically, using algorithms such as beat trackers, pitch
  detectors and so on

* Import annotation data from various text formats and MIDI files

* Play back the original audio with synthesised annotations, taking
  care to synchronise playback with the display position

* Slow down playback and loop segments of interest, including
  seamless looping of complex non-contiguous areas

* Export annotations and audio selections to external files.

* Sonic Visualiser can also be controlled remotely using the Open Sound
  Control (OSC) protocol

%prep
%setup -q
%patch0
%patch1

%build
export dataquay_CFLAGS='-I/usr/include/dataquay'
export dataquay_LIBS='-ldataquay -lrdf'
export fishsound_CFLAGS=''
export fishsound_LIBS='-lfishsound -lvorbis -lvorbisenc -lspeex -lFLAC -lm'

export CFLAGS="%{optflags}" CXXFLAGS="%{optflags}"
sh bootstrap.sh
%configure
make %{?_smp_mflags}


%install

install -dm 755 %{buildroot}%{_bindir}
install -m 755 sonic-visualiser %{buildroot}%{_bindir}

# plugin dir
install -dm 755 %{buildroot}%{_libdir}/vamp

# icon
for size in 16 22 24 32 48 64 128 ; do
install -Dm 644 icons/sv-${size}x${size}.png %{buildroot}/%{_datadir}/icons/hicolor/${size}x${size}/apps/%{name}.png
done

install -Dm 644 icons/sv-icon.svg %{buildroot}/%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
ln -s sonic-visualiser.svg %{buildroot}/%{_datadir}/icons/hicolor/scalable/apps/sv-icon.svg

# mime types
install -Dm 644 %{SOURCE2} %{buildroot}%{_datadir}/mime/packages/%{name}.xml
install -Dm 644 x-sonicvisualiser.desktop %{buildroot}/%{_datadir}/mimelnk/application/x-sonicvisualiser.desktop
install -Dm 644 x-sonicvisualiser-layer.desktop %{buildroot}/%{_datadir}/mimelnk/application/x-sonicvisualiser-layer.desktop

# Menu
install -Dm 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -i %{name} AudioVideo Audio Music

%post
%desktop_database_post
%icon_theme_cache_post
%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :

%postun
%desktop_database_postun
%icon_theme_cache_postun
%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :

%files
%defattr(-,root,root)
%doc COPYING README*
%{_bindir}/%{name}
%dir %{_libdir}/vamp
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/icons/hicolor/scalable/apps/sv-icon.svg
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/%{name}.xml
%dir %{_datadir}/mimelnk
%dir %{_datadir}/mimelnk/application
%{_datadir}/mimelnk/application/x-sonicvisualiser*

%changelog