mumble/mumble.spec
Michael Vetter 681d22d19b Accepting request 947668 from home:seijikun:branches:games:tools
Hey,
this is my attempt at updating to Mumble 1.4.230.
I cleaned up the spec-file in the process.
  * Ported specfile to CMake build-system
  * Use cmake install instead of manual as much as possible
  * Disabled ICE for now (depends on unavailable lib)
  * bonjour is no longer optional
  * Removed init.d script and enabled systemd

I removed a lot of branches for other distros or old versions - I hope that was okay.
The package builds fine for every repo of the devel-package's build targets.

I tested client and server, and both seem to work for me.

OBS-URL: https://build.opensuse.org/request/show/947668
OBS-URL: https://build.opensuse.org/package/show/games:tools/mumble?expand=0&rev=139
2022-01-20 15:27:42 +00:00

232 lines
7.8 KiB
RPMSpec

#
# spec file for package mumble
#
# 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/
#
%define ver 1.4.230
# requires libzeroc-ice, not available yet
%bcond_without ice
%bcond_without jack
%bcond_without pulseaudio
%bcond_without system_opus
%bcond_without system_speex
# mumble must be able to talk to other clients which may use
# different versions of celt. Since each celt release is
# incompatible to each other mumble bundles some specific
# versions.
%bcond_with system_celt
Name: mumble
Version: %{ver}%{?snapshot:_%{snapshot}}
Release: 0
Summary: Voice Communication Client for Gamers
# For Legal: the bundled opus and speex subdirectories are not built.
# Most files are BSD-3-Clause, celt also contains BSD-2-Clause files.
License: BSD-2-Clause AND BSD-3-Clause
Group: Productivity/Multimedia/Sound/Utilities
URL: http://mumble.sourceforge.net/
Source: https://github.com/mumble-voip/mumble/releases/download/%{ver}%{?snapshot:-%{snapshot}}/%{name}-%{ver}%{?snapshot:-%{snapshot}}.tar.gz
Source1: https://github.com/mumble-voip/mumble/releases/download/%{ver}%{?snapshot:-%{snapshot}}/%{name}-%{ver}%{?snapshot:-%{snapshot}}.tar.gz.sig
Source3: murmur.apparmor
# http://mumble.info/gpg/gpg.txt
Source4: https://raw.githubusercontent.com/mumble-voip/mumble-gpg-signatures/master/mumble-auto-build-2022.asc#/%{name}.keyring
Source5: mumble-server.service
Source6: baselibs.conf
BuildRequires: cmake >= 3.15
BuildRequires: gcc-c++
BuildRequires: libcap-devel
BuildRequires: libogg-devel
BuildRequires: libsndfile-devel
BuildRequires: libspeechd-devel
BuildRequires: protobuf-devel
Requires: lsb-release
BuildRequires: libboost_headers-devel
BuildRequires: pkgconfig(avahi-compat-libdns_sd)
%if %{with system_celt}
BuildRequires: libcelt-devel
Requires: libcelt0 > 0.7.0
%endif
%if %{with system_opus}
BuildRequires: pkgconfig(opus)
%endif
%if %{with system_speex}
BuildRequires: pkgconfig(speex)
BuildRequires: pkgconfig(speexdsp)
%endif
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: cmake(PocoZip)
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: pkgconfig(Qt5Concurrent)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5TextToSpeech)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(libopenssl)
BuildRequires: pkgconfig(xi)
%if %{with ice}
BuildRequires: pkgconfig(ice)
%endif
%if %{with pulseaudio}
BuildRequires: pulseaudio-devel
%endif
%if %{with jack}
BuildRequires: libjack-devel
%endif
%ifarch x86_64
BuildRequires: gcc-c++-32bit
Recommends: %{name}-32bit
Conflicts: %{name}-32bit < %{version}
%endif
%ifarch ppc
Recommends: %{name}-64bit
Conflicts: %{name}-64bit < %{version}
%endif
#
%if 0%{?snapshot:1}
Conflicts: mumble < %{version}
Provides: mumble = %{version}
%endif
#
%description
Low-latency, high-quality voice communication for gamers. Includes game
linking, so voice from other players comes from the direction of their
characters, and has echo cancellation so the sound from your loudspeakers
won't be audible to other players.
%package server
Summary: Voice Communication Server for Gamers
Group: Productivity/Multimedia/Sound/Utilities
Requires: lsb-release
Requires(pre): %{_sbindir}/useradd
Recommends: libQt5Sql5-sqlite
Recommends: libQt5Sql5-mysql
Recommends: libQt5Sql5-postgresql
%if 0%{?snapshot:1}
Conflicts: mumble-server < %{version}
Provides: mumble-server = %{version}
%endif
%{?systemd_requires}
%description server
Low-latency, high-quality voice communication for gamers. Includes game
linking, so voice from other players comes from the direction of their
characters, and has echo cancellation so the sound from your loudspeakers
won't be audible to other players.
%prep
%setup -q -n %{name}-%{ver}.src
%build
%cmake .. \
-Dupdate:BOOL=OFF \
-Dsymbols:BOOL=ON \
-Dcrash-report:BOOL=OFF \
-DMUMBLE_INSTALL_PLUGINDIR=%{_libdir}/mumble/plugins \
-DCMAKE_MODULE_LINKER_FLAGS="" \
-DCMAKE_SHARED_LINKER_FLAGS="" \
%if 1
-Dice=OFF \
%endif
%if %{with system_celt}
-Dbundled-celt:BOOL=OFF \
%endif
%if %{with system_speex}
-Dbundled-opus:BOOL=OFF \
%endif
%if %{with system_speex}
-Dbundled-speex:BOOL=OFF \
%endif
%if !%{with pulseaudio}
-Dpulseaudio:BOOL=OFF \
%endif
# build fails for high -j so we overwrite with 1 here
%make_build -j1
%install
%cmake_install
install -D -m 0640 scripts/murmur.ini %{buildroot}%{_sysconfdir}/mumble-server.ini
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -a scripts LICENSE README.md %{buildroot}%{_docdir}/%{name}
find %{buildroot}%{_docdir}/%{name}/scripts -type f -name '*.py' -exec chmod -x {} \;
find %{buildroot}%{_docdir}/%{name}/scripts -type f -name '*.rb' -exec chmod -x {} \;
find %{buildroot}%{_docdir}/%{name}/scripts -type f -name '*.sh' -exec chmod -x {} \;
find %{buildroot}%{_docdir}/%{name}/scripts -type f -name '*.bat' -exec chmod -x {} \;
# Server
##
mkdir -p %{buildroot}%{_tmpfilesdir}
cat >> %{buildroot}%{_tmpfilesdir}/mumble-server.conf <<EOF
d %{_localstatedir}/run/mumble-server 0755 mumble-server mumble-server -
EOF
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/apparmor.d/usr.sbin.murmurd
install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/mumble-server.service
install -D -m 0644 scripts/murmur.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/mumble-server.conf
install -D -m 0644 scripts/murmur.ini %{buildroot}%{_sysconfdir}/mumble-server.ini
%pre server
getent group mumble-server >/dev/null || groupadd -r mumble-server || :
getent passwd mumble-server >/dev/null || \
%{_sbindir}/useradd -r -d %{_localstatedir}/lib/mumble-server -s /bin/false -c "Mumble VoIP Server" -g mumble-server mumble-server 2> /dev/null || :
%service_add_pre mumble-server.service
%preun server
%service_del_preun mumble-server.service
%post server
systemd-tmpfiles --create %{_tmpfilesdir}/mumble-server.conf || true
%service_add_post mumble-server.service
%postun server
%service_del_postun mumble-server.service
%files
%exclude %{_docdir}/%{name}/scripts/murmur.ini
%exclude %{_docdir}/%{name}/scripts/org.mumble_voip.mumble.desktop
%doc %{_docdir}/%{name}
%{_bindir}/mumble
%{_bindir}/mumble-overlay
%{_mandir}/man1/mumble-overlay.*
%{_mandir}/man1/mumble.*
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/icons/hicolor/*/apps/mumble.*
%{_datadir}/applications/*
%{_libdir}/mumble
%files server
%doc %{_docdir}/%{name}/scripts/murmur.ini
%{_bindir}/mumble-server
%config %{_sysconfdir}/dbus-1/system.d/mumble-server.conf
%config(noreplace) %{_sysconfdir}/mumble-server.ini
%{_tmpfilesdir}/mumble-server.conf
%{_unitdir}/mumble-server.service
%{_mandir}/man1/murmurd.*
%{_mandir}/man1/murmur-user-wrapper.*
%{_datadir}/metainfo/org.mumble_voip.mumble.appdata.xml
%dir %{_sysconfdir}/apparmor.d
%config %{_sysconfdir}/apparmor.d/usr.sbin.murmurd
%changelog