6
0
Files
element-desktop/element-desktop.spec

252 lines
9.5 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package element-desktop
#
- Version 1.11.109 This release supports the upcoming v12 ("hydra") Matrix room version and is necessary to view and participate in these rooms. ## ✨ Features * https://github.com/element-hq/element-web/pull/30529). Contributed by @RiotRobot. * https://github.com/element-hq/element-web/pull/30526). Contributed by @RiotRobot. * New room list: change icon and label of menu item for to start a DM (https://github.com/element-hq/element-web/pull/30470). Contributed by @florianduros. * Implement the member list with virtuoso (https://github.com/element-hq/element-web/pull/29869). Contributed by @langleyd. * Add labs option for history sharing on invite (https://github.com/element-hq/element-web/pull/30313). Contributed by @richvdh. * Bump wysiwyg to 2.39.0 adding support for pasting rich text content in the Rich Text Edtior (https://github.com/element-hq/element-web/pull/30421). Contributed by @langleyd. * Support `EventShieldReason.MISMATCHED_SENDER` (https://github.com/element-hq/element-web/pull/30403). Contributed by @richvdh. * Change unencrypted and public pills to blue (https://github.com/element-hq/element-web/pull/30399). Contributed by @florianduros. * Change color of public room icon (https://github.com/element-hq/element-web/pull/30390). Contributed by @florianduros. * Script for updating storybook screenshots (https://github.com/element-hq/element-web/pull/30340). Contributed by @dbkr. * Add toggle to hide empty state in devtools (https://github.com/element-hq/element-web/pull/30352). Contributed by @toger5. ## 🐛 Bug Fixes * https://github.com/element-hq/element-web/pull/30537). Contributed by @RiotRobot. * https://github.com/element-hq/element-web/pull/30536). Contributed by @RiotRobot. * Update for compatibility with v12 rooms (https://github.com/element-hq/element-web/pull/30452). Contributed by @dbkr. * New room list: fix tooltip on presence (https://github.com/element-hq/element-web/pull/30474). Contributed by @florianduros. * New room list: add tooltip for presence and room status (https://github.com/element-hq/element-web/pull/30472). Contributed by @florianduros. * Fix: Clicking on an item in the member list causes it to scroll to the top rather than show the profile view (https://github.com/element-hq/element-web/pull/30455). Contributed by @langleyd. * Put the 'decrypting' tooltip back (https://github.com/element-hq/element-web/pull/30446). Contributed by @dbkr. * Use server name explicitly for via. (https://github.com/element-hq/element-web/pull/30362). Contributed by @Half-Shot. * fix: replace hardcoded string in poll history dialog (https://github.com/element-hq/element-web/pull/30402). Contributed by @florianduros. * fix: replace hardcoded string on qr code back button (https://github.com/element-hq/element-web/pull/30401). Contributed by @florianduros. * Fix color of icon button with outline (https://github.com/element-hq/element-web/pull/30361). Contributed by @florianduros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-desktop?expand=0&rev=123
2025-08-11 16:10:55 +00:00
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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: element-desktop
- Version 1.11.109 This release supports the upcoming v12 ("hydra") Matrix room version and is necessary to view and participate in these rooms. ## ✨ Features * https://github.com/element-hq/element-web/pull/30529). Contributed by @RiotRobot. * https://github.com/element-hq/element-web/pull/30526). Contributed by @RiotRobot. * New room list: change icon and label of menu item for to start a DM (https://github.com/element-hq/element-web/pull/30470). Contributed by @florianduros. * Implement the member list with virtuoso (https://github.com/element-hq/element-web/pull/29869). Contributed by @langleyd. * Add labs option for history sharing on invite (https://github.com/element-hq/element-web/pull/30313). Contributed by @richvdh. * Bump wysiwyg to 2.39.0 adding support for pasting rich text content in the Rich Text Edtior (https://github.com/element-hq/element-web/pull/30421). Contributed by @langleyd. * Support `EventShieldReason.MISMATCHED_SENDER` (https://github.com/element-hq/element-web/pull/30403). Contributed by @richvdh. * Change unencrypted and public pills to blue (https://github.com/element-hq/element-web/pull/30399). Contributed by @florianduros. * Change color of public room icon (https://github.com/element-hq/element-web/pull/30390). Contributed by @florianduros. * Script for updating storybook screenshots (https://github.com/element-hq/element-web/pull/30340). Contributed by @dbkr. * Add toggle to hide empty state in devtools (https://github.com/element-hq/element-web/pull/30352). Contributed by @toger5. ## 🐛 Bug Fixes * https://github.com/element-hq/element-web/pull/30537). Contributed by @RiotRobot. * https://github.com/element-hq/element-web/pull/30536). Contributed by @RiotRobot. * Update for compatibility with v12 rooms (https://github.com/element-hq/element-web/pull/30452). Contributed by @dbkr. * New room list: fix tooltip on presence (https://github.com/element-hq/element-web/pull/30474). Contributed by @florianduros. * New room list: add tooltip for presence and room status (https://github.com/element-hq/element-web/pull/30472). Contributed by @florianduros. * Fix: Clicking on an item in the member list causes it to scroll to the top rather than show the profile view (https://github.com/element-hq/element-web/pull/30455). Contributed by @langleyd. * Put the 'decrypting' tooltip back (https://github.com/element-hq/element-web/pull/30446). Contributed by @dbkr. * Use server name explicitly for via. (https://github.com/element-hq/element-web/pull/30362). Contributed by @Half-Shot. * fix: replace hardcoded string in poll history dialog (https://github.com/element-hq/element-web/pull/30402). Contributed by @florianduros. * fix: replace hardcoded string on qr code back button (https://github.com/element-hq/element-web/pull/30401). Contributed by @florianduros. * Fix color of icon button with outline (https://github.com/element-hq/element-web/pull/30361). Contributed by @florianduros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-desktop?expand=0&rev=123
2025-08-11 16:10:55 +00:00
Version: 1.11.109
Release: 0
Summary: A glossy Matrix collaboration client - desktop
License: AGPL-3.0-only OR GPL-3.0-only
URL: https://github.com/vector-im/element-desktop
Source0: https://github.com/vector-im/element-desktop/archive/v%{version}.tar.gz#/element-desktop-%{version}.tar.gz
Source2: vendor.tar.zst
Source3: io.element.Element.desktop
Source4: element-desktop.sh
Source5: prepare.sh
Patch0: hak-remove-devdependencies.patch
Patch1: 7za-path.patch
Patch2: cc-link-lib-no-static.patch
Patch3: remove-fuses.patch
Patch4: no-walrus-operator.patch
Patch5: break-esbuild-for-good.patch
Patch6: fix-oxc-resolver.patch
BuildRequires: app-builder
BuildRequires: cargo
BuildRequires: element-web = %{version}
BuildRequires: esbuild
- Version 1.11.32 ## ✨ Features * Redirect to the SSO page if `sso_redirect_options.on_welcome_page` is enabled and the URL hash is empty ([\#25495](https://github.com/vector-im/element-web/pull/25495)). Contributed by @dhenneke. * vector/index.html: Allow fetching blob urls ([\#25336](https://github.com/vector-im/element-web/pull/25336)). Contributed by @SuperKenVery. * When joining room in sub-space join the parents too ([\#11011](https://github.com/matrix-org/matrix-react-sdk/pull/11011)). * Include thread replies in message previews ([\#10631](https://github.com/matrix-org/matrix-react-sdk/pull/10631)). Fixes vector-im/element-web#23920. * Use semantic headings in space preferences ([\#11021](https://github.com/matrix-org/matrix-react-sdk/pull/11021)). Contributed by @kerryarchibald. * Use semantic headings in user settings - Ignored users ([\#11006](https://github.com/matrix-org/matrix-react-sdk/pull/11006)). Contributed by @kerryarchibald. * Use semantic headings in user settings - profile ([\#10973](https://github.com/matrix-org/matrix-react-sdk/pull/10973)). Fixes vector-im/element-web#25461. Contributed by @kerryarchibald. * Use semantic headings in user settings - account ([\#10972](https://github.com/matrix-org/matrix-react-sdk/pull/10972)). Contributed by @kerryarchibald. * Support `Insert from iPhone or iPad` in Safari ([\#10851](https://github.com/matrix-org/matrix-react-sdk/pull/10851)). Fixes vector-im/element-web#25327. Contributed by @SuperKenVery. * Specify supportedStages for User Interactive Auth ([\#10975](https://github.com/matrix-org/matrix-react-sdk/pull/10975)). Fixes vector-im/element-web#19605. * Pass device id to widgets ([\#10209](https://github.com/matrix-org/matrix-react-sdk/pull/10209)). Contributed by @Fox32. * Use semantic headings in user settings - discovery ([\#10838](https://github.com/matrix-org/matrix-react-sdk/pull/10838)). Contributed by @kerryarchibald. * Use semantic headings in user settings - Notifications ([\#10948](https://github.com/matrix-org/matrix-react-sdk/pull/10948)). Contributed by @kerryarchibald. * Use semantic headings in user settings - spellcheck and language ([\#10959](https://github.com/matrix-org/matrix-react-sdk/pull/10959)). Contributed by @kerryarchibald. * Use semantic headings in user settings Appearance ([\#10827](https://github.com/matrix-org/matrix-react-sdk/pull/10827)). Contributed by @kerryarchibald. * Use semantic heading in user settings Sidebar & Voip ([\#10782](https://github.com/matrix-org/matrix-react-sdk/pull/10782)). Contributed by @kerryarchibald. * Use semantic headings in user settings Security ([\#10774](https://github.com/matrix-org/matrix-react-sdk/pull/10774)). Contributed by @kerryarchibald. * Use semantic headings in user settings - integrations and account deletion ([\#10837](https://github.com/matrix-org/matrix-react-sdk/pull/10837)). Fixes vector-im/element-web#25378. Contributed by @kerryarchibald. * Use semantic headings in user settings Preferences ([\#10794](https://github.com/matrix-org/matrix-react-sdk/pull/10794)). Contributed by @kerryarchibald. * Use semantic headings in user settings Keyboard ([\#10793](https://github.com/matrix-org/matrix-react-sdk/pull/10793)). Contributed by @kerryarchibald. * RTE plain text mentions as pills ([\#10852](https://github.com/matrix-org/matrix-react-sdk/pull/10852)). Contributed by @alunturner. * Allow welcome.html logo to be replaced by config ([\#25339](https://github.com/vector-im/element-web/pull/25339)). Fixes vector-im/element-web#8636. * Use semantic headings in user settings Labs ([\#10773](https://github.com/matrix-org/matrix-react-sdk/pull/10773)). Contributed by @kerryarchibald. * Use semantic list elements for menu lists and tab lists ([\#10902](https://github.com/matrix-org/matrix-react-sdk/pull/10902)). Fixes vector-im/element-web#24928. * Fix aria-required-children axe violation ([\#10900](https://github.com/matrix-org/matrix-react-sdk/pull/10900)). Fixes vector-im/element-web#25342. * Enable pagination for overlay timelines ([\#10757](https://github.com/matrix-org/matrix-react-sdk/pull/10757)). Fixes vector-im/voip-internal#107. * Add tooltip to disabled invite button due to lack of permissions ([\#10869](https://github.com/matrix-org/matrix-react-sdk/pull/10869)). Fixes vector-im/element-web#9824. * Respect configured auth_header_logo_url for default Welcome page ([\#10870](https://github.com/matrix-org/matrix-react-sdk/pull/10870)). OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-desktop?expand=0&rev=35
2023-06-07 09:54:36 +00:00
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: jq
BuildRequires: nodejs-electron-devel
BuildRequires: zstd
BuildRequires: pkgconfig(openssl)
%if 0%{?fedora}
BuildRequires: rust-srpm-macros
%else
BuildRequires: cargo-auditable
BuildRequires: cargo-packaging >= 1.2.0+3
%endif
BuildRequires: libsecret-devel
%if 0%{?sle_version} <= 150600
BuildRequires: gcc13-c++
%else
BuildRequires: gcc-c++
%endif
Requires: element-web = %{version}
Requires: nodejs-electron%{_isa}
#x86 electron requires SSE2
%ifarch %ix86
ExclusiveArch: i586 i686
BuildArch: i686
%{expand:%%global optflags %(echo "%optflags") -march=pentium4 -mtune=generic}
%{expand:%%global build_rustflags %(echo "%build_rustflags") -C target-cpu=pentium4 -Z tune-cpu=generic}
- Version 1.11.32 ## ✨ Features * Redirect to the SSO page if `sso_redirect_options.on_welcome_page` is enabled and the URL hash is empty ([\#25495](https://github.com/vector-im/element-web/pull/25495)). Contributed by @dhenneke. * vector/index.html: Allow fetching blob urls ([\#25336](https://github.com/vector-im/element-web/pull/25336)). Contributed by @SuperKenVery. * When joining room in sub-space join the parents too ([\#11011](https://github.com/matrix-org/matrix-react-sdk/pull/11011)). * Include thread replies in message previews ([\#10631](https://github.com/matrix-org/matrix-react-sdk/pull/10631)). Fixes vector-im/element-web#23920. * Use semantic headings in space preferences ([\#11021](https://github.com/matrix-org/matrix-react-sdk/pull/11021)). Contributed by @kerryarchibald. * Use semantic headings in user settings - Ignored users ([\#11006](https://github.com/matrix-org/matrix-react-sdk/pull/11006)). Contributed by @kerryarchibald. * Use semantic headings in user settings - profile ([\#10973](https://github.com/matrix-org/matrix-react-sdk/pull/10973)). Fixes vector-im/element-web#25461. Contributed by @kerryarchibald. * Use semantic headings in user settings - account ([\#10972](https://github.com/matrix-org/matrix-react-sdk/pull/10972)). Contributed by @kerryarchibald. * Support `Insert from iPhone or iPad` in Safari ([\#10851](https://github.com/matrix-org/matrix-react-sdk/pull/10851)). Fixes vector-im/element-web#25327. Contributed by @SuperKenVery. * Specify supportedStages for User Interactive Auth ([\#10975](https://github.com/matrix-org/matrix-react-sdk/pull/10975)). Fixes vector-im/element-web#19605. * Pass device id to widgets ([\#10209](https://github.com/matrix-org/matrix-react-sdk/pull/10209)). Contributed by @Fox32. * Use semantic headings in user settings - discovery ([\#10838](https://github.com/matrix-org/matrix-react-sdk/pull/10838)). Contributed by @kerryarchibald. * Use semantic headings in user settings - Notifications ([\#10948](https://github.com/matrix-org/matrix-react-sdk/pull/10948)). Contributed by @kerryarchibald. * Use semantic headings in user settings - spellcheck and language ([\#10959](https://github.com/matrix-org/matrix-react-sdk/pull/10959)). Contributed by @kerryarchibald. * Use semantic headings in user settings Appearance ([\#10827](https://github.com/matrix-org/matrix-react-sdk/pull/10827)). Contributed by @kerryarchibald. * Use semantic heading in user settings Sidebar & Voip ([\#10782](https://github.com/matrix-org/matrix-react-sdk/pull/10782)). Contributed by @kerryarchibald. * Use semantic headings in user settings Security ([\#10774](https://github.com/matrix-org/matrix-react-sdk/pull/10774)). Contributed by @kerryarchibald. * Use semantic headings in user settings - integrations and account deletion ([\#10837](https://github.com/matrix-org/matrix-react-sdk/pull/10837)). Fixes vector-im/element-web#25378. Contributed by @kerryarchibald. * Use semantic headings in user settings Preferences ([\#10794](https://github.com/matrix-org/matrix-react-sdk/pull/10794)). Contributed by @kerryarchibald. * Use semantic headings in user settings Keyboard ([\#10793](https://github.com/matrix-org/matrix-react-sdk/pull/10793)). Contributed by @kerryarchibald. * RTE plain text mentions as pills ([\#10852](https://github.com/matrix-org/matrix-react-sdk/pull/10852)). Contributed by @alunturner. * Allow welcome.html logo to be replaced by config ([\#25339](https://github.com/vector-im/element-web/pull/25339)). Fixes vector-im/element-web#8636. * Use semantic headings in user settings Labs ([\#10773](https://github.com/matrix-org/matrix-react-sdk/pull/10773)). Contributed by @kerryarchibald. * Use semantic list elements for menu lists and tab lists ([\#10902](https://github.com/matrix-org/matrix-react-sdk/pull/10902)). Fixes vector-im/element-web#24928. * Fix aria-required-children axe violation ([\#10900](https://github.com/matrix-org/matrix-react-sdk/pull/10900)). Fixes vector-im/element-web#25342. * Enable pagination for overlay timelines ([\#10757](https://github.com/matrix-org/matrix-react-sdk/pull/10757)). Fixes vector-im/voip-internal#107. * Add tooltip to disabled invite button due to lack of permissions ([\#10869](https://github.com/matrix-org/matrix-react-sdk/pull/10869)). Fixes vector-im/element-web#9824. * Respect configured auth_header_logo_url for default Welcome page ([\#10870](https://github.com/matrix-org/matrix-react-sdk/pull/10870)). OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/element-desktop?expand=0&rev=35
2023-06-07 09:54:36 +00:00
%endif
%description
A glossy Matrix collaboration client - desktop
%prep
%setup -q -a2
%autopatch -p1
# of course this node garbage of a "programming language" is trying to copy around some windows specific stuff on linux
echo > ./node_modules/electron-winstaller/script/select-7z-arch.js
# don't run the broken postinstall script
sed -i -e 's/^.*postinstall.*$/"foo":"bar"/' package.json
# https://blogs.gnome.org/mcatanzaro/2020/05/18/patching-vendored-rust-dependencies/
for i in cc libloading libsqlite3-sys openssl-src rustix seshat vcpkg; do
pushd .hak/hakModules/matrix-seshat/vendor/$i
jq -cj '.files={}' .cargo-checksum.json >tmp && mv tmp .cargo-checksum.json && popd
done
jq -cj '.piwik=false | .update_base_url=null' < element.io/release/config.json > tmp && mv -v tmp element.io/release/config.json
%build
export CFLAGS="%{optflags} -fpic -fno-semantic-interposition -fno-fat-lto-objects -fvisibility=hidden"
export CXXFLAGS="%{optflags} -fpic -fno-semantic-interposition -fno-fat-lto-objects -fvisibility=hidden"
export LDFLAGS="%{?build_ldflags}"
export MAKEFLAGS="%{_smp_mflags}"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
export USE_SYSTEM_APP_BUILDER=true
export OPENSSL_NO_VENDOR=1
%if 0%{?sle_version} <= 150600
mkdir -p /tmp/bin
ln -sf /usr/bin/gcc-13 /tmp/bin/gcc
ln -sf /usr/bin/g++-13 /tmp/bin/g++
export PATH="/tmp/bin:$PATH"
%endif
# The `cc` crate tries to be too clever and passes some default cflags when building sqlcipher.
# Disable these and use only the ones from CFLAGS env. variable
export CRATE_CC_NO_DEFAULTS=1
%ifarch %ix86
export RUSTC_BOOTSTRAP=1
%endif
#I want to actually see the build logs for Cargo. Especially the gcc command line for dependent modules.
export RUSTC_LOG='rustc_codegen_ssa::back::link=info'
export RUSTFLAGS="%{build_rustflags} --verbose -Cstrip=none"
export CARGO_TERM_VERBOSE=true
# break esbuild for good - see https://en.opensuse.org/openSUSE:Packaging_Electron#esbuild and Patch5
export ESBUILD_BINARY_PATH=/usr/bin/esbuild
%electron_rebuild
pushd .hak/hakModules/matrix-seshat
%if 0%{?suse_version}
auditable='auditable -vv'
%endif
cargo -vv $auditable rustc --offline --release --features=bundled-sqlcipher --lib --crate-type cdylib
ln -Tv target/release/*.so index.node
popd
#Compare definition of `build:universal` in package.json
npm run build:ts
npm run build:res
npx --no-install electron-builder --linux dir --universal -c.electronDist=%{_libdir}/electron -c.asar=false -c.nodeGypRebuild=false -c.npmRebuild=false
rm -rf "/tmp/bin"
%install
#Remove sources an other files that should not be shipped
pushd dist/linux-universal-unpacked/resources/app
rm -rf node_modules/matrix-seshat/{.cargo,false,src,target,test,vendor,Cargo.lock,Cargo.toml}
find -name '*.c' -type f -print -delete
find -name '*.cc' -type f -print -delete
find -name '*.cpp' -type f -print -delete
find -name '*.h' -type f -print -delete
find -name '*.m' -type f -print -delete
find -name '*.map' -type f -print -delete
find -name '*.ts' -type f -print -delete
find -name '*.tsx' -type f -print -delete
find -name '*.gyp' -type f -print -delete
find -name '*.gypi' -type f -print -delete
find -name '*.mk' -type f -print -delete
find -name '*.Makefile' -type f -print -delete
find -name '.eslint*' -type f -print -delete
find -name .editorconfig -type f -print -delete
find -name .nvmrc -type f -print -delete
find -name .nycrc -type f -print -delete
find -name Makefile -type f -print -delete
find -name '.jscs*' -type f -print -delete
find -name obj.target -print0 |xargs -r0 -- rm -rvf --
find -name '*.d' -type f -print -delete
#Documentation
find -name '*.md' -type f -print -delete
find -name '*.markdown' -type f -print -delete
find -name '*.bnf' -type f -print -delete
find -name '*.mli' -type f -print -delete
find -name CHANGES -type f -print -delete
find -name TODO -type f -print -delete
find -name usage.txt -type f -print -delete
# Remove empty directories
find . -type d -empty -print -delete
# remove dotfiles
find -type f -name ".*" -print -delete
# fix file mode
find . -type f -exec chmod 0644 {} \;
find . -name '*.node' -exec chmod 0755 {} \;
popd
# Install the app content, replace the webapp with a symlink to the system package
install -vd -m 0755 "%{buildroot}%{_datadir}/element/"
cp -lrv dist/linux-universal-unpacked/resources/* -t "%{buildroot}%{_datadir}/element/"
rm %{buildroot}/usr/share/element/default_app.asar
ln -vs %{_datadir}/webapps/element "%{buildroot}%{_datadir}/element/webapp"
# Install binaries to /usr/lib
install -vd -m 0755 "%{buildroot}%{_prefix}/lib/element/"
mv "%{buildroot}/%{_datadir}/element/app/node_modules/keytar-forked/build/Release/keytar.node" "%{buildroot}%{_prefix}/lib/element/"
install -pvm0755 dist/linux-universal-unpacked/resources/app/node_modules/matrix-seshat/index.node "%{buildroot}%{_prefix}/lib/element/matrix-seshat.node"
ln -sfv "%{_prefix}/lib/element/keytar.node" "%{buildroot}/%{_datadir}/element/app/node_modules/keytar-forked/build/Release/keytar.node"
ln -sfv "%{_prefix}/lib/element/matrix-seshat.node" "%{buildroot}%{_datadir}/element/app/node_modules/matrix-seshat/index.node"
# Config file
install -vm 0755 -d %{buildroot}%{_sysconfdir}/element
install -pvm 0644 element.io/release/config.json "%{buildroot}%{_sysconfdir}/element/config.json"
install -pvm 0755 -d %{buildroot}%{_sysconfdir}/webapps/element
ln -vs %{_sysconfdir}/element/config.json "%{buildroot}%{_sysconfdir}/webapps/element/config.json"
install -vd -m 0755 "%{buildroot}%{_datadir}/webapps/element/"
ln -vs %{_sysconfdir}/element/config.json "%{buildroot}%{_datadir}/webapps/element/config.json" # moved here from element-web to make symlink check happy
# Required extras
install -vd -m 0755 "%{buildroot}%{_datadir}/applications/"
install -pvm 0644 %{SOURCE3} "%{buildroot}%{_datadir}/applications/io.element.Element.desktop"
install -vd -m 0755 "%{buildroot}%{_bindir}/"
install -pvm 0755 %{SOURCE4} "%{buildroot}%{_bindir}/%{name}"
# Icons
install -vd -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/"
for i in 16 24 48 64 96 128 256 512; do
install -vd -m 0755 "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/"
install -pvm 0644 build/icons/${i}x${i}.png "%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/io.element.Element.png"
done
# Prevent error msg on element start
ln -vs de_DE.json "%{buildroot}%{_datadir}/element/app/lib/i18n/strings/de.json"
# Remove shebangs
grep -rlZ '#! \?/usr/bin/env' "%{buildroot}%{_datadir}/element/app/node_modules/" | xargs -0 sed -i -e '/#\! \?\/usr\/bin\/env.*/d'
%fdupes %{buildroot}%{_datadir}
%check
%electron_check_native
%files
%license LICENSE-AGPL-3.0 LICENSE-GPL-3.0
%{_bindir}/%{name}
%dir %{_datadir}/element/
%{_datadir}/element/webapp
%{_datadir}/element/app-update.yml
%dir %{_datadir}/element/app
%{_datadir}/element/app/lib
%{_datadir}/element/app/node_modules
%{_datadir}/element/app/package.json
%dir %{_datadir}/element/img
%{_datadir}/element/img/*
%{_prefix}/lib/element/
%config(noreplace) %{_sysconfdir}/element/config.json
%{_sysconfdir}/webapps/element/config.json
%{_datadir}/webapps/element/config.json
%dir %{_sysconfdir}/element/
%{_datadir}/applications/io.element.Element.desktop
%{_datadir}/icons/hicolor/*/apps/io.element.Element.png
%changelog