File zen-browser.spec of Package zen-browser

%define _disable_rpath_check 1
%global __brp_check_rpaths %{nil}
%global __brp_check_rpaths_reloc %{nil}

Name:           zen-browser
Version:        1.17.13b
Release:        %mkrel 1
Summary:        Privacy-focused Firefox fork with workspaces and split view
License:        MPLv2.0
Group:          Networking/WWW
URL:            https://zen-browser.org

Source0:        zen.linux-x86_64.tar.xz
Source1:        zen.desktop
Source2:        zen-browser.metainfo.xml
Source3:        zen256.png
Source4:        zen-wayland.desktop

Requires:       hicolor-icon-theme
Requires:       desktop-file-utils

# Prevent RPM from auto-providing bundled libs
%global __provides_exclude_from %{_libdir}/zen-browser/.*\\.so
%global __requires_exclude_from %{_libdir}/zen-browser/.*\\.so

%description
Zen Browser is a modern fork of Firefox focused on privacy, productivity,
and design. It adds features like workspaces, split view, and glance,
while retaining Gecko compatibility and Firefox extensions.

# Upstream tarball extracts into "zen/"
%prep
%setup -q -n zen

%install
rm -rf %{buildroot}

# Install full runtime directory into /usr/lib64/zen-browser
mkdir -p %{buildroot}%{_libdir}/zen-browser
cp -a * %{buildroot}%{_libdir}/zen-browser/

# Create wrapper launcher in /usr/bin
mkdir -p %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/zen-browser << 'EOF'
#!/bin/sh
exec %{_libdir}/zen-browser/zen "$@"
EOF
chmod 755 %{buildroot}%{_bindir}/zen-browser

# Install desktop files
install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/applications/zen.desktop
install -Dm644 %{SOURCE4} %{buildroot}%{_datadir}/applications/zen-wayland.desktop

# Install 128x128 icon
install -Dm644 browser/chrome/icons/default/default128.png \
    %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/zen.png

# Install 256x256 HiDPI icon
install -Dm644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/zen.png

# Install AppStream metadata
install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/metainfo/zen-browser.metainfo.xml

%files
%{_bindir}/zen-browser
%{_libdir}/zen-browser/
%{_datadir}/applications/zen.desktop
%{_datadir}/applications/zen-wayland.desktop
%{_datadir}/icons/hicolor/128x128/apps/zen.png
%{_datadir}/icons/hicolor/256x256/apps/zen.png
%{_datadir}/metainfo/zen-browser.metainfo.xml

%post
%update_desktop_database
%update_icon_cache

%postun
%update_desktop_database
%update_icon_cache
openSUSE Build Service is sponsored by