From 327fa8e166ddaf6cd9baf3e3d542b080ac81ec751ed4101863b43b0dcf8acd17 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 23 Oct 2020 09:17:54 +0000 Subject: [PATCH] Accepting request 842609 from home:13ilya - Refresh spec-file via spec-cleaner and manual optimizations. - Add Requires:fluid-soundfont-gm. - Add user fluidsynth and group audio. - Add files: fluidsynth.conf and fluidsynth.service. OBS-URL: https://build.opensuse.org/request/show/842609 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/fluidsynth?expand=0&rev=80 --- fluidsynth.changes | 9 ++++++++- fluidsynth.conf | 5 +++++ fluidsynth.service | 14 ++++++++++++++ fluidsynth.spec | 33 ++++++++++++++++----------------- 4 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 fluidsynth.conf create mode 100644 fluidsynth.service diff --git a/fluidsynth.changes b/fluidsynth.changes index 3957a62..ddd1d1c 100644 --- a/fluidsynth.changes +++ b/fluidsynth.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Oct 19 11:05:56 UTC 2020 - Илья Индиго + +- Refresh spec-file via spec-cleaner and manual optimizations. +- Add Requires:fluid-soundfont-gm. +- Add user fluidsynth and group audio. +- Add files: fluidsynth.conf and fluidsynth.service. + ------------------------------------------------------------------- Sun Sep 20 09:36:23 UTC 2020 - Tom Mbrt @@ -536,4 +544,3 @@ Fri Jun 6 16:20:24 CEST 2003 - tiwai@suse.de Thu Mar 27 17:22:27 CET 2003 - tiwai@suse.de - initial version 1.0.0. iiwusynth is obsoleted. - diff --git a/fluidsynth.conf b/fluidsynth.conf new file mode 100644 index 0000000..a6fec2f --- /dev/null +++ b/fluidsynth.conf @@ -0,0 +1,5 @@ +# Mandatory parameters (uncomment and edit) +SOUND_FONT=/usr/share/sounds/sf2/FluidR3_GM.sf2 + +# Additional optional parameters (may be useful, see 'man fluidsynth' for further info) +OTHER_OPTS='-a pulseaudio -m alsa_seq -p FluidSynth\ GM -r 48000' diff --git a/fluidsynth.service b/fluidsynth.service new file mode 100644 index 0000000..90e3379 --- /dev/null +++ b/fluidsynth.service @@ -0,0 +1,14 @@ +[Unit] +Description=FluidSynth GM daemon +Documentation=man:fluidsynth(1) +After=sound.target + +[Service] +User=fluidsynth +Group=audio +EnvironmentFile=-/etc/sysconfig/fluidsynth +ExecStart=/usr/bin/fluidsynth -is $OTHER_OPTS $SOUND_FONT +LimitRTPRIO=90 + +[Install] +WantedBy=multi-user.target diff --git a/fluidsynth.spec b/fluidsynth.spec index 3fc93e1..94eb85c 100644 --- a/fluidsynth.spec +++ b/fluidsynth.spec @@ -1,7 +1,7 @@ # # spec file for package fluidsynth # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,21 +16,16 @@ # -# fix build for older distros and architectures where _fillupdir is -# not yet defined by using the old path as recommended by -# https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25_fillupdir -%if ! %{defined _fillupdir} - %define _fillupdir /var/adm/fillup-templates -%endif - %define sover 2 Name: fluidsynth Version: 2.1.5 Release: 0 Summary: A Real-Time Software Synthesizer That Uses Soundfont(tm) License: LGPL-2.1-or-later -URL: http://www.fluidsynth.org/ -Source: https://github.com/FluidSynth/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +URL: http://www.fluidsynth.org +Source0: https://github.com/FluidSynth/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: %{name}.conf +Source2: %{name}.service Source1000: baselibs.conf BuildRequires: cmake >= 3.1.0 BuildRequires: ladspa-devel @@ -43,8 +38,11 @@ BuildRequires: pkgconfig(libinstpatch-1.0) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(sndfile) +Requires: fluid-soundfont-gm +Requires(pre): %fillup_prereq +Requires(pre): group(audio) +Requires(pre): shadow %{?systemd_requires} -PreReq: %fillup_prereq %description FluidSynth (formerly IIWU Synth) is a real-time software synthesizer @@ -82,18 +80,18 @@ This package contains the shared library for Fluidsynth. # may or may not create a 'build' subdirectory %cmake # cannot call ctest as the unit tests need to be compiled yet -make check +%make_build check %install %cmake_install - -# manually install systemd service files -install -Dm 644 build/fluidsynth.conf %{buildroot}%{_fillupdir}/sysconfig.%{name} -install -Dm 644 build/fluidsynth.service %{buildroot}%{_unitdir}/%{name}.service -install -d %{buildroot}%{_sbindir} +mkdir -p %{buildroot}%{_localstatedir}/lib/%{name} +install -Dpm0644 %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.%{name} +install -Dpm0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service +mkdir %{buildroot}%{_sbindir} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %pre +getent passwd %{name} >/dev/null || useradd -rc 'FluidSynth GM daemon' -s /bin/false -d %{_localstatedir}/lib/%{name} -g audio %{name} %service_add_pre %{name}.service %post @@ -112,6 +110,7 @@ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %files %license LICENSE %doc AUTHORS ChangeLog README.md THANKS TODO +%dir %attr(-,%{name},audio) %{_localstatedir}/lib/%{name} %{_bindir}/%{name} %{_fillupdir}/sysconfig.%{name} %{_mandir}/man1/%{name}.1%{?ext_man}