File freetube.spec of Package freetube
#
# spec file for package freetube
#
# 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/
#
Name: freetube
Version: 0.23.9
Release: 0.beta%{?dist}
Summary: An Open Source YouTube app for privacy
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: AGPL-3.0
URL: https://github.com/FreeTubeApp/FreeTube
Source0: %{name}-%{version}.tar.gz
Source1: node_modules.tar.gz
BuildRequires: nodejs-default npm-default zip unzip
%description
FreeTube is an open source desktop YouTube player built with privacy
in mind.
%prep
%setup -q -a1 -n %{name}-%{version}
%build
export ELECTRON_CACHE=$PWD/electron_cache
npm run build
%install
%define original_folder linux-unpacked
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}
mv build/%{original_folder} build/%{name}
mv build/%{name}/FreeTube build/%{name}/%{name}
cp -r build/%{name} %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
ln -s %{_libdir}/%{name}/%{name} %{buildroot}%{_bindir}/%{name}
mkdir -p %{buildroot}%{_datadir}/applications
cp %{name}.desktop %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
cp _icons/256x256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/freetube.png
%files
%license LICENSE
%doc README.md
%{_libdir}/*
%{_bindir}/*
%{_datadir}/applications/*
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/256x256
%dir %{_datadir}/icons/hicolor/256x256/apps
%{_datadir}/icons/hicolor/256x256/apps/*
%changelog