File lenmus.spec of Package lenmus

#
# spec file for package lenmus
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           lenmus
Version:        6.0.1
Release:        0
Summary:        A free program for learning music
License:        GPL-3.0-only AND BSD-2-Clause
Group:          Productivity/Multimedia/Sound/Midi
URL:            http://www.lenmus.org/en/noticias
Source0:        %{name}-%{version}.tar.xz
Source4:        %{name}.changes
Source99:       %{name}-rpmlintrc
# PATCH-FIX-OPENSUSE lenmus-samples_dir.patch
Patch3:         %{name}-samples_dir.patch
# PATCH-FIX-OPENSUSE lenmus-do_not_install_docs.patch
Patch4:         %{name}-do_not_install_docs.patch
# PATCH-FIX-OPENSUSE lenmus-extra_installs.patch
Patch5:         %{name}-extra_installs.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  intltool
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libboost_system-devel
BuildRequires:  pkgconfig
BuildRequires:  portmidi-devel
BuildRequires:  wxWidgets-devel >= 3.0
BuildRequires:  fluid-soundfont-gm
BuildRequires:  steinberg-bravura-fonts
BuildRequires:  cmake(UnitTest++)
BuildRequires:  pkgconfig(fluidsynth)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(zlib)
Requires:       fluid-soundfont-gm
Requires:       liberation-fonts
Requires:       steinberg-bravura-fonts
Requires:       timidity
Requires:       wqy-zenhei-fonts
Recommends:     %{name}-lang
BuildRequires:  fdupes

%description
LenMus is a free program for learning music. It allows you to focus on
specific skills and exercises, on both theory and aural training. The
different activities can be customized to meet your needs. It includes
a score editor.

%lang_package

%prep
%autosetup -p1
ln -s %{_datadir}/sounds/sf2/FluidR3_GM.sf2 res/sounds/
chmod -x LICENSE README

%build
%cmake -DUNITTEST_INCLUDE_DIRS=%{_includedir}/unittest-cpp
%make_jobs

%install
%cmake_install

mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}.bin
mkdir -pv %{buildroot}%{_bindir}
tee %{buildroot}%{_bindir}/%{name} << "EOF"
#!/bin/bash

if [ ! -d "~/%{name}/scores/%{version}/samples" ]; then
    mkdir -p ~/%{name}/scores/%{version}
    cp -r %{_datadir}/%{name}/%{version}/samples ~/%{name}/scores/%{version}/.
fi
%{_bindir}/lenmus.bin
EOF

# install templates
mkdir -pv %{buildroot}%{_datadir}/%{name}/%{version}/templates
cp -v templates/* %{buildroot}%{_datadir}/%{name}/%{version}/templates

%find_lang %{name} --all-name
%fdupes %{buildroot}%{_datadir}

%files
%license LICENSE
%doc CHANGELOG.md README
%attr(755, root, -) %{_bindir}/%{name}*
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/%{version}
%{_datadir}/%{name}/%{version}/res
%{_datadir}/%{name}/%{version}/samples
%{_datadir}/%{name}/%{version}/templates
%{_datadir}/%{name}/%{version}/test-scores
%{_datadir}/%{name}/%{version}/xrc
%{_datadir}/applications/org.lenmus.lenmus.desktop
%{_datadir}/metainfo/org.lenmus.lenmus.appdata.xml
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_mandir}/man1/%{name}.1%{?ext_man}

%files lang -f %{name}.lang
%license LICENSE
%{_datadir}/%{name}/%{version}/locale

%changelog
openSUSE Build Service is sponsored by