File fluidsynth.spec of Package fluidsynth

# spec file for package fluidsynth
# Copyright (c) 2024 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

%define sover   3
Name:           fluidsynth
Version:        2.3.5
Release:        0
Summary:        A Real-Time Software Synthesizer That Uses Soundfont(tm)
License:        LGPL-2.1-or-later
Group:          Productivity/Multimedia/Sound/Midi
URL:            https://www.fluidsynth.orga/
Source1:        %{name}.conf
Source1000:     baselibs.conf
BuildRequires:  cmake >= 3.13.0
BuildRequires:  gcc-c++
BuildRequires:  ladspa-devel
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(jack)
#BuildRequires:  pkgconfig(lash-1.0)
BuildRequires:  pkgconfig(libinstpatch-1.0)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(portaudio-2.0)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(sndfile)
Recommends:     fluid-soundfont-gm

FluidSynth (formerly IIWU Synth) is a real-time software synthesizer
based on the SoundFont(tm) 2 specifications. It can read MIDI events
from the MIDI input device and render them to the audio device. It
can also play MIDI files.

%package devel
Summary:        Development package for the fluidsynth library
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libfluidsynth%{sover} = %{version}
Provides:       libfluidsynth-devel = %{version}

%description devel
This package contains the files needed to compile programs that use the
fluidsynth library.

%package -n libfluidsynth%{sover}
Summary:        Library for Fluidsynth
Group:          System/Libraries

%description -n libfluidsynth%{sover}
This package contains the shared library for Fluidsynth.

%autosetup -p1

%cmake \
    -DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} \
    -DDEFAULT_SOUNDFONT=/usr/share/sounds/sf2/FluidR3_GM.sf2 \
    -Denable-portaudio=1 \
    -Denable-floats=1 \
    -Denable-debug=0 \

# depending on the distribution being built for, cmake
# may or may not create a 'build' subdirectory
# cannot call ctest as the unit tests need to be compiled yet
#cmake_build check

install -Dpm0644 %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.%{name}
install -Dpm0644 build/fluidsynth.service %{buildroot}%{_userunitdir}/%{name}.service
mkdir %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}

%systemd_user_pre %{name}.service

%systemd_user_post %{name}.service

%systemd_user_preun %{name}.service

%systemd_user_postun %{name}.service

%post -n libfluidsynth%{sover} -p /sbin/ldconfig
%postun -n libfluidsynth%{sover} -p /sbin/ldconfig

%license LICENSE

%files devel
%dir %{_libdir}/cmake/%{name}/

%files -n libfluidsynth%{sover}

openSUSE Build Service is sponsored by