File Ripchord.spec of Package Ripchord

#
# spec file for package Ripchord
#
# 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:           Ripchord
Version:        2.7.0
Release:        0
Summary:        MIDI plugin for creating and remixing chord progressions
License:        GPL-3.0-only
Group:          Productivity/Multimedia/Sound/Midi
URL:            https://trackbout.com/ripchord
Source0:        %{name}-%{version}.tar.gz
Source1:        generate-lv2-ttl.py
Source2:        LV2.mak.in
Source3:        AppConfig.h.in
Patch0:         ripchord-jucer.patch
BuildRequires:  JUCE6-Projucer
BuildRequires:  JUCE6-devel
BuildRequires:  Mesa-libGL-devel
BuildRequires:  gcc-c++
BuildRequires:  ladspa-devel
BuildRequires:  libXcursor-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libcurl-devel
BuildRequires:  libjack-devel
BuildRequires:  lv2-devel
BuildRequires:  pkgconfig
BuildRequires:  python3
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xinerama)

%description

Ripchord is a free MIDI plugin for creating and remixing chord progressions.
You can create custom chord presets from scratch, load community presets or expansion packs,
and also import any MIDI file that contains chords and Ripchord will automatically create
a preset from it. Once you have a preset loaded, you can quickly and easily compose
progressions by playing single notes to trigger full chords.

Manual, videos and presets are available at https://trackbout.com/ripchord

%package -n vst3-%{name}
Summary:        MIDI plugin for creating and remixing chord progressions (VST3)

%description -n vst3-%{name}

Ripchord is a free MIDI plugin for creating and remixing chord progressions.
You can create custom chord presets from scratch, load community presets or expansion packs,
and also import any MIDI file that contains chords and Ripchord will automatically create
a preset from it. Once you have a preset loaded, you can quickly and easily compose
progressions by playing single notes to trigger full chords.

Manual, videos and presets are available at https://trackbout.com/ripchord

%package -n vst-%{name}
Summary:        MIDI plugin for creating and remixing chord progressions (VST)

%description -n vst-%{name}

Ripchord is a free MIDI plugin for creating and remixing chord progressions.
You can create custom chord presets from scratch, load community presets or expansion packs,
and also import any MIDI file that contains chords and Ripchord will automatically create
a preset from it. Once you have a preset loaded, you can quickly and easily compose
progressions by playing single notes to trigger full chords.

Manual, videos and presets are available at https://trackbout.com/ripchord

%package -n lv2-%{name}
Summary:        MIDI plugin for creating and remixing chord progressions (LV2)

%description -n lv2-%{name}

Ripchord is a free MIDI plugin for creating and remixing chord progressions.
You can create custom chord presets from scratch, load community presets or expansion packs,
and also import any MIDI file that contains chords and Ripchord will automatically create
a preset from it. Once you have a preset loaded, you can quickly and easily compose
progressions by playing single notes to trigger full chords.

Manual, videos and presets are available at https://trackbout.com/ripchord

%prep
%setup -q
%autopatch -p0

mkdir -p JuceLibraryCode
cp -f %{SOURCE3} JuceLibraryCode/
cp %{SOURCE2} .
cp %{SOURCE1} .

%build

lv2uri=%{URL}
sed "s/_lv2uri_pattern_/${lv2uri//\//\\/}/g" JuceLibraryCode/AppConfig.h.in >JuceLibraryCode/AppConfig.h
sed "s/_juce_target_/%{name}/g" LV2.mak.in >LV2.mak

%define JUCE_VERSION `ls %{_libdir}/juce/include/`

Projucer --set-global-search-path linux defaultJuceModulePath %{_libdir}/juce/include/%{JUCE_VERSION}/modules
Projucer --resave %{name}.jucer
echo "include ../../LV2.mak" >> Builds/LinuxMakefile/Makefile

cd Builds/LinuxMakefile
CONFIG=Release make %{?_smp_mflags}

%install

mkdir -p %{buildroot}%{_bindir}
install Builds/LinuxMakefile/build/%{name} %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}/vst
install Builds/LinuxMakefile/build/%{name}.so %{buildroot}%{_libdir}/vst/
mkdir -p %{buildroot}%{_libdir}/vst3
cp -r Builds/LinuxMakefile/build/*.vst3 %{buildroot}%{_libdir}/vst3/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r Builds/LinuxMakefile/build/*.lv2 %{buildroot}%{_libdir}/lv2/

%files
%{_bindir}/%{name}
%doc README.md
%license LICENSE

%files -n vst-%{name}
%dir %{_libdir}/vst
%{_libdir}/vst/%{name}.so
%doc README.md
%license LICENSE

%files -n vst3-%{name}
%dir %{_libdir}/vst3
%{_libdir}/vst3/*
%doc README.md
%license LICENSE

%files -n lv2-%{name}
%dir %{_libdir}/lv2
%{_libdir}/lv2/*
%doc README.md
%license LICENSE

%changelog
openSUSE Build Service is sponsored by