File electron14.spec of Package electron

#
# spec file for package electron
#
# 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/
#

%if "%{?_target_cpu}" == "x86_64"
%define arch_type x64
%endif

%if "%{?_target_cpu}" == "aarch64"
%define arch_type arm64
%endif

Name:           electron14
Version:        14.2.9
Release:        0
Summary:        Build cross platform desktop apps with JavaScript, HTML, and CSS
License:        MIT
Group:          Development/Languages/NodeJS
URL:            https://github.com/electron/electron
Source0:        electron-v%{version}-linux-%{arch_type}.zip
Source1:        electron

BuildRequires:  unzip

ExcludeArch:    s390 s390x i586 ppc64 ppc64le armv6l armv7l riscv64

%description
Nodejs application: Build cross platform desktop apps with JavaScript, HTML, and CSS

%prep
/usr/bin/unzip -d %{name} %{SOURCE0}

%build
sed -i 's/name=electronVERSION/name=%{name}/' %{S:1}

%install
mkdir -p %{buildroot}%{_libdir}
cp -r %{name} %{buildroot}%{_libdir}/
install -Dm 755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}

%post
%{_sbindir}/update-alternatives --install %{_bindir}/electron electron "%{_bindir}/%{name}" 14

%postun
%{_sbindir}/update-alternatives --remove electron "%{_bindir}/%{name}"

%files
%defattr(-,root,root)
%dir %{_libdir}/%{name}
%ghost %{_sysconfdir}/alternatives/electron
%{_libdir}/%{name}/*
%{_bindir}/%{name}

%changelog

openSUSE Build Service is sponsored by