Updates to spec file

* Get SPEC file to build with 28.2 and FC35
* Owntone requires avahi, so declare that
* Update configure options based on new code
* Remove spotify and lastfm options; we always build with those
* Clean up service-file handling
* Install systemd file correctly through build system
This commit is contained in:
Derek Atkins 2021-11-23 15:40:03 -05:00 committed by GitHub
parent ce5634e372
commit 28b2822d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,8 +5,6 @@
%bcond_without alsa %bcond_without alsa
%bcond_without pulseaudio %bcond_without pulseaudio
%bcond_with spotify
%bcond_with lastfm
%bcond_with chromecast %bcond_with chromecast
%global _hardened_build 1 %global _hardened_build 1
@ -18,7 +16,7 @@ Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/Multimedia Group: Applications/Multimedia
Url: https://github.com/owntone/owntone-server Url: https://github.com/owntone/owntone-server
Source0: https://github.com/owntone/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/owntone/%{name}/archive/%{version}/%{name}-%{version}.tar.xz
%{?systemd_ordering} %{?systemd_ordering}
BuildRequires: gcc, make, systemd, pkgconfig, libunistring-devel BuildRequires: gcc, make, systemd, pkgconfig, libunistring-devel
BuildRequires: pkgconfig(zlib), pkgconfig(libconfuse), pkgconfig(mxml) BuildRequires: pkgconfig(zlib), pkgconfig(libconfuse), pkgconfig(mxml)
@ -30,6 +28,7 @@ BuildRequires: pkgconfig(libswscale), pkgconfig(libavutil)
BuildRequires: pkgconfig(libavfilter), pkgconfig(libcurl) BuildRequires: pkgconfig(libavfilter), pkgconfig(libcurl)
BuildRequires: pkgconfig(openssl), pkgconfig(libwebsockets) > 2.0.2 BuildRequires: pkgconfig(openssl), pkgconfig(libwebsockets) > 2.0.2
BuildRequires: pkgconfig(libsodium), pkgconfig(avahi-client) >= 0.6.24 BuildRequires: pkgconfig(libsodium), pkgconfig(avahi-client) >= 0.6.24
BuildRequires: pkgconfig(libprotobuf-c)
# pkgconfig(libplist) not used universally, so require libplist-devel instead # pkgconfig(libplist) not used universally, so require libplist-devel instead
BuildRequires: libplist-devel >= 0.16 BuildRequires: libplist-devel >= 0.16
Requires(pre): shadow-utils Requires(pre): shadow-utils
@ -39,13 +38,10 @@ BuildRequires: pkgconfig(alsa)
%if %{with pulseaudio} %if %{with pulseaudio}
BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(libpulse)
%endif %endif
%if %{with spotify}
BuildRequires: libspotify-devel
%endif
%if %{with chromecast} %if %{with chromecast}
BuildRequires: pkgconfig(libprotobuf-c)
BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(gnutls)
%endif %endif
Requires: avahi
%global homedir %{_localstatedir}/lib/%{name} %global homedir %{_localstatedir}/lib/%{name}
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
@ -68,10 +64,9 @@ by iTunes and friends to share/stream media libraries over the network.
%build %build
%configure \ %configure \
--with%{!?with_alsa:out}-alsa --with%{!?with_pulseaudio:out}-pulseaudio \ --with%{!?with_alsa:out}-alsa --with%{!?with_pulseaudio:out}-pulseaudio \
--with-libcurl --with-libwebsockets --with-libsodium --with-libplist \ --with-libwebsockets --with-avahi %{?with_chromecast:--enable-chromecast} \
--with-avahi %{?with_spotify:--enable-spotify} \ --with-user=%{username} --with-group=%{groupname} \
%{?with_lastfm:--enable-lastfm} %{?with_chromecast:--enable-chromecast} \ --with-systemddir=%{_unitdir}
--with-daapd-user=%{username} --with-daapd-group=%{groupname}
%make_build %make_build
%install %install
@ -80,8 +75,6 @@ rm -f %{buildroot}%{_pkgdocdir}/INSTALL
mkdir -p %{buildroot}%{homedir} mkdir -p %{buildroot}%{homedir}
mkdir -p %{buildroot}%{_localstatedir}/log mkdir -p %{buildroot}%{_localstatedir}/log
touch %{buildroot}%{_localstatedir}/log/%{name}.log touch %{buildroot}%{_localstatedir}/log/%{name}.log
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 owntone.service %{buildroot}%{_unitdir}/%{name}.service
rm -f %{buildroot}%{_libdir}/%{name}/*.la rm -f %{buildroot}%{_libdir}/%{name}/*.la
%pre %pre
@ -115,6 +108,11 @@ exit 0
%{_mandir}/man?/* %{_mandir}/man?/*
%changelog %changelog
* Mon Nov 22 2021 Derek Atkins <derek@ihtfp.com> - 28.2-1
- Release tarball is a XZ not GZ file
- Configure always needs protobuf-c, not just for chromecast
- Exclude build-system-installed service file and use system location
* Sat Mar 17 2018 Scott Shambarger <devel@shambarger.net> - 26.0-1 * Sat Mar 17 2018 Scott Shambarger <devel@shambarger.net> - 26.0-1
- 26.0 release. - 26.0 release.
- Update spec file to handle new feature defaults. - Update spec file to handle new feature defaults.