File spotify-adblock.spec of Package spotify-adblock

Name:           spotify-adblock
Version:        1.0.3~0
Release:        0
Summary:        Adblocker for Spotify 
License:        GPL-3.0-or-later
URL:            https://github.com/abba23/spotify-adblock
Source0:        %{name}-%{version}.tar.zst
Source1:        vendor.tar.zst
Source2:        cargo_config
BuildRequires:  cargo-packaging
# Disable this line if you wish to support all platforms.
# In most situations, you will likely only target tier1 arches for user facing components.
ExclusiveArch:  %{rust_tier1_arches}
Enhances:       spotify-client

%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.

%prep
%autosetup -p1 -a1
install -D -m 644 %{SOURCE2} .cargo/config

%build
%{cargo_build}

%install
install -D -d -m 0755 %{buildroot}%{_libdir}
install -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}
install -m 0755 %{_builddir}/%{name}-%{version}/target/release/libspotifyadblock.so %{buildroot}%{_libdir}/libspotifyadblock.so
install -m 0644 %{_sourcedir}/%{name}-%{version}/config.toml %{buildroot}%{_sysconfdir}/%{name}/config.toml

%check
%{cargo_test}

%files
%license LICENSE
%doc README.md
%{_libdir}/libspotifyadblock.so
%{_sysconfdir}/%{name}
openSUSE Build Service is sponsored by