File matrix-element-web.spec of Package matrix-element-web

#
# spec file for package matrix-element-web
#
# Copyright (c) 2022 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/
#


Name:           matrix-element-web
Version:        1.11.110
Release:        0
Summary:        A glossy Matrix collaboration client for the web
License:        Apache-2.0
Group:          Productivity/Networking/Instant Messenger
URL:            https://about.riot.im/
Source0:        https://github.com/vector-im/element-web/releases/download/v%{version}/element-v%{version}.tar.gz
Source1:        https://github.com/vector-im/element-web/releases/download/v%{version}/element-v%{version}.tar.gz.asc
# Public key is from https://riot.im/packages/keys/riot.asc
Source2:        %{name}.keyring
Source3:        %{name}.apache-vhost
Source4:        %{name}.well-known-client
Source5:        %{name}.nginx
Source99:       %{name}-rpmlintrc
#BuildRequires:  apache2
#BuildRequires:  matrix-js-sdk
#BuildRequires:  matrix-react-sdk
Requires:       nodejs
Provides:       element-web = %{version}
Obsoletes:      elememt-web < %{version}
Provides:       matrix-riot-web = %{version}
Obsoletes:      matrix-riot-web < %{version}
#Recommends:     (%%{name}-apache2 or %%{name}-nginx)
BuildArch:      noarch

%description
Element is a glossy Matrix client built on top of matrix-react-sdk with an emphasis on perfomance and usability.

%package apache
Summary:        Apache integration for element-web
Requires:       %{name} = %{version}
Requires:       apache2

%description apache
This is the %{summary}.

%package nginx
Summary:        Nginx integration for element-web
Requires:       %{name} = %{version}
Requires:       nginx

%description nginx
This is the %{summary}.

%prep
%setup -q -n element-v%{version}

%build
# nothin to build

%install
install -d -m 0755 %{buildroot}%{_datadir}/%{name}/
cp -a * %{buildroot}%{_datadir}/%{name}/
cp %{buildroot}%{_datadir}/%{name}/config.sample.json %{buildroot}%{_datadir}/%{name}/config.json
# apache
install -d -m 0755 %{buildroot}%{_sysconfdir}/apache2/vhosts.d/
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/apache2/vhosts.d/%{name}.conf
install -D -m 0644 %{SOURCE4} %{buildroot}/srv/www/vhosts/matrix/.well-known/matrix/client
# nginx
install -Dpm 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/nginx/default.d/%{name}.conf

%files
%config(noreplace) %{_datadir}/%{name}/config.json
%{_datadir}/%{name}

%files apache
%dir %{_sysconfdir}/apache2
%dir %{_sysconfdir}/apache2/vhosts.d
%dir /srv/www
%dir /srv/www/vhosts
%dir /srv/www/vhosts/matrix
%dir /srv/www/vhosts/matrix/.well-known
%dir /srv/www/vhosts/matrix/.well-known/matrix
%config(noreplace) %{_sysconfdir}/apache2/vhosts.d/%{name}.conf
%config(noreplace) /srv/www/vhosts/matrix/.well-known/matrix/client

%files nginx
%dir %{_sysconfdir}/nginx
%dir %{_sysconfdir}/nginx/default.d
%config %{_sysconfdir}/nginx/default.d/%{name}.conf

%changelog
openSUSE Build Service is sponsored by