element/element.spec

129 lines
3.3 KiB
RPMSpec
Raw Normal View History

2020-07-16 18:50:47 +03:00
# To avoid out of memory error
%define _build_pkgcheck_set %{nil}
%define debug_package %{nil}
2020-08-05 21:53:16 +03:00
%define oname element-desktop
2020-07-16 18:50:47 +03:00
%define _riotdir /opt/element
2020-08-17 16:19:21 +03:00
%define __noautoreqfiles /opt/element/resources
2020-07-16 18:50:47 +03:00
%define __noautoreq 'libffmpeg.so*|libnode.so*'
Summary: Client for the decentralized and secure protocol Matrix
Name: element
2021-10-12 11:24:51 +03:00
Version: 1.9.2
2021-09-14 15:37:10 +03:00
Release: 1
2020-07-16 18:50:47 +03:00
License: ASL 2.0
Group: Networking/Instant messaging
2021-05-17 16:59:51 +03:00
URL: https://element.io
2020-07-16 18:50:47 +03:00
Source0: https://github.com/vector-im/%{oname}/archive/v%{version}/%{oname}-%{version}.tar.gz
BuildRequires: yarn
#BuildRequires: nodejs-bootstrap-bin >= 14.17.0
BuildRequires: nodejs14
2020-07-16 18:50:47 +03:00
BuildRequires: git-core
BuildRequires: curl
BuildRequires: imagemagick
2021-09-13 13:28:39 +03:00
BuildRequires: pkgconfig(sqlcipher)
2020-07-16 18:50:47 +03:00
%ifarch i386 i486 i586 i686 x86
BuildRequires: nodejs-rimraf
%endif
AutoProv: no
Provides: riot == %{version}
Conflicts: nodejs-bootstrap-bin
2020-07-16 18:50:47 +03:00
%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}
%build
export PATH=$PATH:/opt/nodejs14/bin
yarn && yarn clean
yarn run fetch --noverify --cfgdir 'element.io/release'
2021-09-13 13:28:39 +03:00
cp element.io/release/config.json config.json
2020-07-16 18:50:47 +03:00
%ifarch x86_64
%define linuxunpacked dist/linux-unpacked
2021-09-13 13:28:39 +03:00
yarn run build:64
2020-07-16 18:50:47 +03:00
%else
%define linuxunpacked dist/linux-ia32-unpacked
2021-09-13 13:28:39 +03:00
yarn run build:32
2020-07-16 18:50:47 +03:00
%endif
%install
mkdir -p %{buildroot}%{_riotdir}
cp -a %{linuxunpacked}/* %{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