File audacity.spec of Package audacity

#
# spec file for package audacity
#
# Copyright (c) 2015 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 _use_internal_dependency_generator 0
%define __find_requires %{wx_requires}
%bcond_with ffmpeg
%bcond_with mad
%bcond_with lame
%bcond_with twolame
Name:           audacity
Version:        2.1.0
Release:        0
Summary:        A Free, Cross-Platform Digital Audio Editor
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Editors and Convertors
Url:            http://audacity.sourceforge.net/
Source:         http://downloads.sf.net/%{name}/%{name}-minsrc-%{version}.tar.xz
Source1:        %{name}-rpmlintrc
Source2:        %{name}-license-nyquist
# PATCH-FIX-OPENSUSE audacity-no_buildstamp.patch reddwarf@opensuse.org -- Remove the buildstamp.
Patch0:         %{name}-no_buildstamp.patch
# PATCH-FIX-UPSTREAM audacity-flac_assert.h.patch joerg.lorenzen@ki.tng.de -- Patch to build against libflac 1.3.0+.
Patch1:         %{name}-flac_assert.h.patch
# PATCH-FIX-UPSTREAM audacity-ffmpeg.patch reddwarf@opensuse.org -- Patch to compile with latest ffmpeg.
Patch2:         %{name}-ffmpeg.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  wxWidgets-devel
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(flac)
BuildRequires:  pkgconfig(flac++)
BuildRequires:  pkgconfig(gtk+-2.0) >= 2.4.0
BuildRequires:  pkgconfig(id3tag)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(shared-mime-info)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(soundtouch)
BuildRequires:  pkgconfig(vamp-hostsdk)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vorbisenc)
BuildRequires:  pkgconfig(vorbisfile)
Recommends:     %{name}-lang = %{version}
Recommends:     libavcodec56
Recommends:     libavformat56
Recommends:     libavutil54
Recommends:     libmp3lame0
%if 0%{?suse_version} > 1320
BuildRequires:  pkgconfig(soxr)
%else
BuildRequires:  pkgconfig(samplerate)
%endif
# This would require to patch our portaudio package with "PortMixer"... an extra API that never got integrated in PortAudio.
#BuildRequires:  portaudio-devel
%if %{with ffmpeg}
BuildRequires:  libffmpeg-devel
%endif
%if %{with mad}
BuildRequires:  pkgconfig(mad)
%endif
%if %{with lame}
BuildRequires:  libmp3lame-devel
%endif
%if %{with twolame}
BuildRequires:  pkgconfig(twolame)
%endif

%description
Audacity is a program that manipulates digital audio wave forms. In
addition to recording sounds directly from within the program, it
imports many sound file formats, including WAV, AIFF, AU, IRCAM, MP,
and Ogg Vorbis.  With Audacity, you can edit wave data larger than the
physical memory size of your computer.

%lang_package

%prep
%setup -q -n %{name}-minsrc-%{version}
%patch0
%patch1 -p1
%if %{with ffmpeg}
%patch2
%endif
cp -f %{SOURCE2} LICENSE_NYQUIST.txt
# Make sure we use the system versions.
rm -rf lib-src/libvamp/
%if %{with lame}
rm -rf lib-src/lame/
%endif
%if %{with ffmpeg}
rm -rf lib-src/ffmpeg/
%endif

%build
aclocal -I m4
autoconf
%configure \
%ifnarch %ix86 x86_64
  --disable-sse                \
%endif
%if 0%{?suse_version} <= 1320
  --with-libsamplerate         \
  --without-libsoxr            \
%endif
  --docdir=%{_docdir}/%{name}/

make %{?_smp_mflags}

%install
%make_install
# email wrote to feedback@audacityteam.org
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/mimetypes/
mv -f %{buildroot}%{_datadir}/pixmaps/gnome-mime-application-x-audacity-project.xpm \
  %{buildroot}%{_datadir}/icons/hicolor/48x48/mimetypes/application-x-audacity-project.xpm
rm -rf %{buildroot}%{_datadir}/pixmaps/
%find_lang %{name}

%post
%desktop_database_post
%icon_theme_cache_post
%mime_database_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun

%files
%defattr(-,root,root)
%doc LICENSE.txt LICENSE_NYQUIST.txt README.txt
%doc %{_docdir}/%{name}/
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/icons/hicolor/*/mimetypes/application-x-audacity-project.*
%{_datadir}/mime/packages/%{name}.xml
%{_mandir}/man?/%{name}.?%{?ext_man}
%dir %{_datadir}/appdata/
%{_datadir}/appdata/%{name}.appdata.xml

%files lang -f %{name}.lang
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by