File jc303.spec of Package jc303

#
# spec file for package jc303
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2023 Konstantin Voinov konstantin.voinov@gmail.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:           jc303
Version:        0.9.2+git.1.e0594fa
Release:        0
Summary:        A Free Roland TB-303 Plugin
License:        GPL-3.0-only
Group:          Productivity/Multimedia/Sound
URL:            https://github.com/midilab/jc303
Source0:        %{name}-%{version}.tar.xz
Source1:        clap-juce-extensions-git.54d83e1.tar.xz
Patch0:         cmakelists.patch
BuildRequires:  JUCE7_05-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(xcomposite)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(gl)
%if %{defined fedora}
BuildRequires:  jack-audio-connection-kit-devel
%else
BuildRequires:  pkgconfig(jack)
%endif

%description
A Cmake JUCE port of Robin Schmidt`s Open303, a Roland TB-303 clone plugin.
The Open303 engine part of this software is also licensed under the MIT License.

%package -n vst3-%{name}
Summary:        JUCE implementation of jc303 (VST3)

%description -n vst3-%{name}
A Cmake JUCE port of Robin Schmidt`s Open303, a Roland TB-303 clone plugin.
The Open303 engine part of this software is also licensed under the MIT License.

%package -n vst-%{name}
Summary:        JUCE implementation of jc303 (VST)

%description -n vst-%{name}
A Cmake JUCE port of Robin Schmidt`s Open303, a Roland TB-303 clone plugin.
The Open303 engine part of this software is also licensed under the MIT License.

%package -n lv2-%{name}
Summary:        JUCE implementation of jc303 (LV2)

%description -n lv2-%{name}
A Cmake JUCE port of Robin Schmidt`s Open303, a Roland TB-303 clone plugin.
The Open303 engine part of this software is also licensed under the MIT License.

%package -n clap-%{name}
Summary:        JUCE implementation of jc303 (CLAP)

%description -n clap-%{name}
A Cmake JUCE port of Robin Schmidt`s Open303, a Roland TB-303 clone plugin.
The Open303 engine part of this software is also licensed under the MIT License.

%prep
%setup -q
%autopatch -p1

tar xf %{SOURCE1} --strip-components=1 --one-top-level=lib/clap-juce-extensions

%build
%cmake -DFETCHCONTENT_FULLY_DISCONNECTED=ON \
       -DBUILD_SHARED_LIBS:BOOL=OFF \
       -DBUILD_STATIC_LIBS:BOOL=ON
%cmake_build

%install
%define binname JC303
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libdir}/vst3
mkdir -p %{buildroot}%{_libdir}/lv2
mkdir -p %{buildroot}%{_libdir}/vst
mkdir -p %{buildroot}%{_libdir}/clap
%if %{defined fedora}
install redhat-linux-build/%{binname}_artefacts/RelWithDebInfo/Standalone/* %{buildroot}%{_bindir}/
cp -r redhat-linux-build/%{binname}_artefacts/Release/VST/*.so %{buildroot}%{_libdir}/vst/
cp -r redhat-linux-build/%{binname}_artefacts/RelWithDebInfo/VST3/*.vst3 %{buildroot}%{_libdir}/vst3/
cp -r redhat-linux-build/%{binname}_artefacts/RelWithDebInfo/LV2/*.lv2 %{buildroot}%{_libdir}/lv2/
cp -r redhat-linux-build/%{binname}_artefacts/Release/CLAP/*.clap %{buildroot}%{_libdir}/clap/
%else
install build/%{binname}_artefacts/RelWithDebInfo/Standalone/* %{buildroot}%{_bindir}/
cp -r build/%{binname}_artefacts/RelWithDebInfo/VST3/*.vst3 %{buildroot}%{_libdir}/vst3/
cp -r build/%{binname}_artefacts/RelWithDebInfo/LV2/*.lv2 %{buildroot}%{_libdir}/lv2/
install build/%{binname}_artefacts/RelWithDebInfo/VST/*.so %{buildroot}%{_libdir}/vst/
cp -r build/%{binname}_artefacts/RelWithDebInfo/CLAP/*.clap %{buildroot}%{_libdir}/clap/
%endif

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

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

%files -n clap-%{name}
%{_libdir}/clap/
%doc README.md
%license LICENSE

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

%files -n lv2-%{name}
%{_libdir}/lv2/
%doc README.md
%license LICENSE
%changelog
openSUSE Build Service is sponsored by