# To avoid out of memory error %define _build_pkgcheck_set %{nil} %define debug_package %{nil} %define oname element-desktop %define _riotdir /opt/element %define __noautoreqfiles /opt/element/resources %define __noautoreq 'libffmpeg.so*|libnode.so*' Summary: Client for the decentralized and secure protocol Matrix Name: element Version: 1.11.92 Release: 1 License: ASL 2.0 Group: Networking/Instant messaging URL: https://element.io Source0: https://github.com/vector-im/%{oname}/archive/v%{version}/%{oname}-%{version}.tar.gz Source1: https://github.com/vector-im/element-web/releases/download/v%{version}/%{name}-v%{version}.tar.gz ExclusiveArch: x86_64 BuildRequires: yarn BuildRequires: nodejs-bootstrap-bin >= 16 # (18.18.0) #BuildRequires: nodejs14 BuildRequires: git-core BuildRequires: curl BuildRequires: imagemagick BuildRequires: pkgconfig(sqlcipher) BuildRequires: python38-devel %ifarch i386 i486 i586 i686 x86 BuildRequires: nodejs-rimraf %endif AutoProv: no Provides: riot == %{version} #Conflicts: nodejs-bootstrap-bin %description Element (oldname Riot) is a decentralized, secure messaging client for collaborative group communication. Element's core architecture is an implementation of the Matrix protocol. Element is more than a messaging app. Riot is a shared workspace for the web. Element is a place to connect with teams. Riot is a place to to collaborate, to work, to discuss your current projects. Element removes the barriers between apps, allowing you to connect teams and functionality like never before. Element is free. Element is secure. %files %{_bindir}/%{name}* %{_datadir}/applications/%{name}*.desktop %{_iconsdir}/hicolor/*/apps/%{name}.* %{_riotdir}/* #---------------------------------------------------------------------------- %prep %setup -qn %{oname}-%{version} #sed -i -e '/node/s/18.0.0/16.0.0/' \ # -e '/electron/s/\^32.0.0/22/' \ # -e '/\@playwright\/test/s/1.48.0/1.22.0/' \ # -e '/\@stylistic\/eslint-plugin/s/\^2.9.0/1.8.0/' \ # -e '/\@typescript-eslint\/eslint-plugin/s/\^8.0.0/\^6.0.0/' \ # -e '/\@typescript-eslint\/parser/s/\^8.0.0/\^6.0.0/' \ # -e '/isbinaryfile/s/\^5.0.0/\^4.0.0/' \ # -e '/eslint/s/\^8.26.0/8.26.0/' \ # -e '/app-builder-lib/s/25.1.8/\^22.0.0/' \ # -e '/electron-builder/s/25.1.8/\^22.0.0/' \ # -e '/electron-builder-squirrel-windows/s/25.1.8/\^22.0.0/' \ # -e '/glob/s/\^11.0.0/\^9.0.0/' \ # -e '/eslint-plugin-unicorn/s/56.0.0/50.0.0/' \ # -e '/knip/s/5.0.0/2.0.0/' \ # -e '/pacote/s/19.0.0/18.0.0/' \ # -e '/rimraf/s/6.0.0/5.0.0/' \ # package.json # -e '/\@types\/node/s/18.19.55/\^16.11.26/' \ #sed -i -e '/isbinaryfile/s/\^5.0.0/\^4.0.0/' \ # -e '/minimatch/s/\^10.0.0/\^9.0.0/g' \ # yarn.lock #rm -rf yarn.lock %build export PATH=/opt/nodejs/16.*/bin:$PATH #export PYTHONPATH=%{python38_sitelib} #export PYTHON3=/usr/libexec/python3.8 #export PYTHON=/usr/libexec/python3.8 /usr/libexec/python3.8 -m venv . . bin/activate yarn config set --home enableTelemetry 0 mkdir -p packages deploys pushd deploys tar -xf %{SOURCE1} popd #yarn generate-lock-entry yarn #yarn clean yarn run fetch --noverify --cfgdir 'element.io/release' cp element.io/release/config.json config.json #yarn run build --dir yarn run build:64 --dir %install mkdir -p %{buildroot}%{_riotdir} cp -a dist/linux-*/* %{buildroot}%{_riotdir} # install binary wrapper mkdir -p %{buildroot}%{_bindir} cat > %{buildroot}%{_bindir}/%{name} << EOF #!/bin/bash cd %{_riotdir} ./element-desktop EOF cat > %{buildroot}%{_bindir}/%{name}-tor << EOF #!/bin/bash cd %{_riotdir} ./element-desktop --proxy-server="socks5://127.0.0.1:9050" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE myproxy" EOF chmod 755 %{buildroot}%{_bindir}/%{name}* # install menu entry mkdir -p %{buildroot}%{_datadir}/applications/ cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF [Desktop Entry] Name=Element Comment=Client for the decentralized and secure protocol Matrix Exec=%{name} Icon=%{name} Terminal=false Type=Application StartupNotify=true Categories=Network;InstantMessaging; EOF cat > %{buildroot}%{_datadir}/applications/%{name}-tor.desktop << EOF [Desktop Entry] Name=Element-tor Comment=Client for the decentralized and secure protocol Matrix over Tor Exec=%{name}-tor Icon=%{name} Terminal=false Type=Application StartupNotify=true Categories=Network;InstantMessaging; EOF # install menu icons pushd res/img for N in 16 22 24 32 48 128 256; do install -d %{buildroot}%{_iconsdir}/hicolor/${N}x${N}/apps convert -resize ${N}x${N} element.png %{buildroot}%{_iconsdir}/hicolor/${N}x${N}/apps/%{name}.png done popd