File spotify-adblock.spec of Package spotify-adblock
#
# spec file for package spotify-adblock
#
# 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 https://bugs.opensuse.org/
#
%define somajor 1
%define libname libspotifyadblock
Name: spotify-adblock
Version: 1.0.3
Release: 0
URL: https://github.com/abba23/spotify-adblock
License: GPL-3.0-only
Summary: Adblocker for Spotify
Source0: https://github.com/abba23/spotify-adblock/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: vendor.tar.zst
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: zstd
%{?suse_build_hwcaps_libs}
%description
Spotify adblocker for Linux (macOS untested) that works by wrapping getaddrinfo
and cef_urlrequest_create. It blocks requests to domains that are not on
the allowlist, as well as URLs that are on the denylist.
%package -n %{libname}%{somajor}
Summary: Adblocker for Spotify
%description -n %{libname}%{somajor}
Spotify adblocker for Linux (macOS untested) that works by wrapping getaddrinfo
and cef_urlrequest_create. It blocks requests to domains that are not on
the allowlist, as well as URLs that are on the denylist.
%package devel
Summary: Development files for %{name}
Requires: %{libname}%{somajor} = %{version}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%autosetup -a1
%build
%{cargo_build}
%install
install -p -m 0755 -D %{_builddir}/%{name}-%{version}/target/release/%{libname}.so \
%{buildroot}%{_libdir}/%{libname}.so
install -p -m 0755 -D %{_builddir}/%{name}-%{version}/target/release/%{libname}.so \
%{buildroot}%{_libdir}/%{libname}.so.%{somajor}
%post -n %{libname}%{somajor} -p /sbin/ldconfig
%postun -n %{libname}%{somajor} -p /sbin/ldconfig
%files -n %{libname}%{somajor}
%license LICENSE
%{_libdir}/*.so.*
%files devel
%doc README.md
%{_libdir}/*.so
%changelog