File spicetify-cli.spec of Package spicetify-cli
#
# spec file for package spicetify-cli
#
# 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
# 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 __arch_install_post export NO_BRP_STRIP_DEBUG=true
# Project name when using go tooling.
%define project github.com/khanhas/spicetify-cli
# Project upstream commit.
%define commit edac821
Name: spicetify-cli
Version: 2.39.4
Release: 0
Summary: Commandline tool to customize Spotify client
License: GPL-3.0-only
URL: https://github.com/khanhas/spicetify-cli
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: README.SUSE
BuildRequires: fdupes
BuildRequires: go >= 1.16
BuildRequires: go-md2man
BuildRequires: golang-packaging
Requires: spotify-client
ExcludeArch: s390
%if 0%{?is_opensuse}
ExcludeArch: s390x
%endif
%description
Command-line tool to customize Spotify client. Supports Windows, MacOS and Linux.
Features
Change colors whole UI
Inject CSS for advanced customization
Inject Extensions (Javascript script) to extend functionalities, manipulate UI and control player.
Inject Custom apps
Enable additional, hidden features
Remove bloated components to improve performance
%prep
%autosetup -a1
cp $RPM_SOURCE_DIR/README.SUSE .
%build
export VERSION=%{version}
export COMMIT=%{commit}
export CGO_ENABLED=1
go build \
-mod=vendor \
-buildmode=pie \
-ldflags "-s -w -X main.gitCommit=$COMMIT -X main.version=$VERSION" \
-o %{name} ;
%install
mkdir -p %{buildroot}%{_datadir}/spicetify
# Install the binary.
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/jsHelper"
# Copy data files
cp -afr {CustomApps,Extensions,Themes} %{buildroot}%{_datadir}/spicetify
# Build the man page.
go-md2man -in README.md -out %{name}.1
# Install the man page.
install -D -m 0644 %{name}.1 "%{buildroot}/%{_mandir}/man1/%{name}.1"
rm %{name}.1
%fdupes %{buildroot}
%files
%license LICENSE
%doc README.md README.SUSE
%{_bindir}/%{name}
%{_bindir}/jsHelper
%{_datadir}/spicetify
%dir %{_mandir}/man1
%{_mandir}/man1/%{name}*.1%{?ext_man}
%changelog