File midieditor.spec of Package midieditor
#
# spec file for package midieditor
#
# Copyright (c) 2020 Javier S. Pedro <dev.git@javispedro.com>
#
# 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: midieditor
Version: 3.3.2
Release: 0
Summary: Graphical interface to edit, play, and record Midi data
License: GPL-3.0+
Group: Productivity/Multimedia/Sound/Midi
URL: https://www.midieditor.org/
Source0: https://github.com/markusschwenk/midieditor/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qtmultimedia-devel
BuildRequires: alsa-devel
BuildRequires: update-desktop-files
%description
MidiEditor is a free software providing an interface to edit, record, and play Midi data.
The editor is able to open existing Midi files and modify their content. New files can be created and the user can enter his own composition by either recording Midi data from a connected Midi device (e.g., a digital piano or a keyboard) or by manually creating new notes and other Midi events. The recorded data can be easily quantified and edited afterwards using MidiEditor.
%prep
%setup -q
%build
export MIDIEDITOR_RELEASE_VERSION_STRING=%{version}
export MIDIEDITOR_RELEASE_VERSION_ID=-1 # Avoids auto updates
export MIDIEDITOR_RELEASE_DATE=2019-10-20
%qmake5
make %{?_smp_mflags}
%install
# No make install
install -D -m 755 MidiEditor %{buildroot}%{_libdir}/midieditor/MidiEditor
# wrapper script to set cwd as required
install -d %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/%{name} <<-EOF
#!/bin/bash
cd %{_datadir}/midieditor
export QT_AUTO_SCREEN_SCALE_FACTOR=1 # Hack
exec %{_libdir}/midieditor/MidiEditor "$@"
EOF
chmod 0755 %{buildroot}%{_bindir}/%{name}
# Data & desktop files
install -D -m 644 packaging/metronome/metronome-01.wav %{buildroot}%{_datadir}/midieditor/metronome/metronome-01.wav
install -D -m 644 packaging/unix/midieditor/logo48.png %{buildroot}%{_datadir}/pixmaps/midieditor.png
%suse_update_desktop_file -c MidiEditor MidiEditor MidiEditor midieditor midieditor AudioVideo Midi
%files
%license LICENSE
%doc README.md
%{_bindir}/midieditor
%{_libdir}/midieditor
%{_datadir}/midieditor
%{_datadir}/pixmaps/midieditor.png
%{_datadir}/applications/MidiEditor.desktop
%changelog