File ungoogled-chromium-portable.spec of Package ungoogled-chromium-portable
#
# spec file for package ungoogled-chromium-portable
#
# Copyright (c) 2023 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 _name ungoogled-chromium
Name: ungoogled-chromium-portable
Version: 130.0.6723.58
Release: 1%{?dist}
Summary: Ungoogled Chromium Browser
License: BSD-3-Clause
URL: https://github.com/ungoogled-software/ungoogled-chromium
Source0: https://github.com/ungoogled-software/ungoogled-chromium-portablelinux/releases/download/%{version}-1/ungoogled-chromium_%{version}-1_linux.tar.xz
Source1: LICENSE
Source2: README.md
Source3: ungoogled-chromium.svg
BuildRequires: hicolor-icon-theme
BuildRequires: desktop-file-utils
BuildRequires: rsvg-convert
BuildRequires: fdupes
%description
Ungoogled Chromium is a Google Chromium variant for removing Google integration and enhancing privacy, control, and transparency. This package provides a portable version of the browser.
%prep
%setup -q -n %{_name}_%{version}-1_linux
%check
%build
%install
mkdir -p %{buildroot}%{_prefix}/lib/%{_name}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/applications
install -m 0644 -p %{SOURCE1} %{_builddir}/%{_name}_%{version}-1_linux/LICENSE
install -m 0644 -p %{SOURCE2} %{_builddir}/%{_name}_%{version}-1_linux/README.md
cp -r ./* %{buildroot}%{_prefix}/lib/%{_name}
ln -s %{_prefix}/lib/%{_name}/chrome %{buildroot}%{_bindir}/%{_name}
install -d %{buildroot}%{_datadir}/pixmaps
install -m 0644 -p product_logo_48.png %{buildroot}%{_datadir}/pixmaps/%{_name}.png
install -d %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -m 0644 -p %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{_name}.svg
for size in 16 22 24 32 48 64 128 256; do
dest=%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps
install -d ${dest}
rsvg-convert -w ${size} -h ${size} %{SOURCE3} -o ${dest}/%{_name}.png
chmod 0644 ${dest}/%{_name}.png
touch -r %{SOURCE3} ${dest}/%{_name}.png
done
cat > %{buildroot}%{_datadir}/applications/ungoogled-chromium.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=Ungoogled Chromium
Comment=Browse the web
Exec=%{_bindir}/ungoogled-chromium %U
Terminal=false
Icon=ungoogled-chromium
Type=Application
Categories=Network;WebBrowser;
StartupWMClass=chromium-browser
EOF
%{__strip} %{buildroot}/usr/lib/%{_name}/chrome
%{__strip} %{buildroot}/usr/lib/%{_name}/chrome_crashpad_handler
%{__strip} %{buildroot}/usr/lib/%{_name}/chrome_sandbox
%{__strip} %{buildroot}/usr/lib/%{_name}/chromedriver
%{__strip} %{buildroot}/usr/lib/%{_name}/libEGL.so
%{__strip} %{buildroot}/usr/lib/%{_name}/libGLESv2.so
%{__strip} %{buildroot}/usr/lib/%{_name}/libvk_swiftshader.so
%{__strip} %{buildroot}/usr/lib/%{_name}/libvulkan.so.1
%fdupes %{buildroot}/%{_prefix}/share
%fdupes %{buildroot}/%{_prefix}/lib/%{_name}/locales/
%files
%license %{_prefix}/lib/%{_name}/LICENSE
%doc README.md
%{_prefix}/lib/%{_name}
%{_bindir}/%{_name}
%{_datadir}/applications/%{_name}.desktop
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/16x16
%dir %{_datadir}/icons/hicolor/16x16/apps
%dir %{_datadir}/icons/hicolor/22x22
%dir %{_datadir}/icons/hicolor/22x22/apps
%dir %{_datadir}/icons/hicolor/24x24
%dir %{_datadir}/icons/hicolor/24x24/apps
%dir %{_datadir}/icons/hicolor/32x32
%dir %{_datadir}/icons/hicolor/32x32/apps
%dir %{_datadir}/icons/hicolor/48x48
%dir %{_datadir}/icons/hicolor/48x48/apps
%dir %{_datadir}/icons/hicolor/64x64
%dir %{_datadir}/icons/hicolor/64x64/apps
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/128x128/apps
%dir %{_datadir}/icons/hicolor/256x256
%dir %{_datadir}/icons/hicolor/256x256/apps
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/*/apps/%{_name}.*
%{_datadir}/pixmaps/%{_name}.png
%changelog