File polyphone.spec of Package polyphone

# spec file for package polyphone
#
# Copyright (c) 2014 by Edgar Aichinger
# 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 edogawa@aon.at
#

%if %{defined fedora}
BuildRequires:	pkgconfig
BuildRequires:	qt4-devel
BuildRequires:	jack-audio-connection-kit-devel
BuildRequires:	alsa-lib-devel
BuildRequires:	desktop-file-utils
%else
BuildRequires:	pkg-config
BuildRequires:	libqt4-devel
BuildRequires:	libjack-devel
BuildRequires:	alsa-devel
BuildRequires:	update-desktop-files
%endif
BuildRequires:	portaudio-devel
BuildRequires:	libogg-devel
BuildRequires:	libvorbis-devel
BuildRequires:	unzip

Name:		polyphone
Version:	1.8
Release:	1

Summary:	A free Soundfont (SF2) Editor
Group:		Applications/Multimedia
License:	GPL-3.0+
URL:		http://www.polyphone.fr/
Source0:	%name-%version-src.zip
Patch0:		%name-locallibs.patch

%description
Polyphone is a free software for editing soundfonts in format sf2. These files contain a multitude of audio samples put together and configured so as to form musical instruments that can be used by synthesizers such as fluidsynth and played using a MIDI keyboard.

The goal of Polyphone is to provide:

    a simple and efficient interface for creating and editing .sf2 files, available on Windows, Mac OS X and Linux,
    tools to facilitate and automate the editing of different parameters, making it possible to handle a large amount of data.

Polyphone is licensed under GNU General Public License. Anyone may thus access the source code, and is welcome to help in the development of the program.


%prep
%setup -q -n trunk
%patch0 -p1
chmod 644 README


%build
%if %{defined fedora}
export QTDIR=%{_qt4_prefix}
%{_qt4_qmake}
make
%else
qmake QMAKE_CFLAGS+="%optflags" QMAKE_CXXFLAGS+="%optflags" QMAKE_STRIP="/bin/true" polyphone.pro
make %{?_smp_mflags};
%endif

%install
mkdir -p %{buildroot}%{_bindir}
install -m0755 RELEASE/polyphone %{buildroot}%{_bindir}/
# install icon
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/
install -m0644 ressources/icon.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/polyphone.png
# create and install desktop entry
mkdir -p %{buildroot}%{_datadir}/applications

cat > polyphone.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Polyphone
GenericName=Polyphone
Comment=Soundfont Editor
Exec=%{_bindir}/polyphone
Icon=polyphone.png
Terminal=false
Type=Application
Categories=AudioVideo;Music;
EOF
%if %{defined fedora}
desktop-file-install \
    --dir %{buildroot}%{_datadir}/applications \
    polyphone.desktop
%endif
%if 0%{?suse_version}
 %suse_update_desktop_file -i %name AudioVideo Music
%endif


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,0755)
%doc README
%{_bindir}/polyphone
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/128x128/apps
%{_datadir}/applications/polyphone.desktop
%{_datadir}/icons/hicolor/128x128/apps/polyphone.png


openSUSE Build Service is sponsored by