File riot-web.spec of Package riot-web

#
# spec file for package riot-web
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2020 Stasiek Michalski <stasiek@michalski.cc>.
#
# 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/
#

%define serverroot /srv/www/htdocs
Name:           riot-web
Version:        1.7.22
Release:        0
Summary:        Riot Matrix Web Client
License:        Apache-2.0
URL:            https://github.com/vector-im/%{name}
Source0:        https://github.com/vector-im/%{name}/releases/download/v%{version}/element-v%{version}.tar.gz
Source1:        %{name}-nginx.conf
BuildRequires:  fdupes
BuildArch:      noarch

%package nginx
Summary:        Nginx integration for Riot
Requires:       %{name} = %{version}
Requires:       nginx

%description nginx
%{summary}.

%description
A glossy Matrix collaboration client for the web.

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

%build
# Skip build

%install
mkdir -p %{buildroot}%{serverroot}/riot
cp -r * %{buildroot}%{serverroot}/riot
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp config.sample.json %{buildroot}%{_sysconfdir}/%{name}/config.json
ln -sf %{_sysconfdir}/%{name}/config.json %{buildroot}%{serverroot}/riot/config.json
install -Dpm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/nginx/default.d/%{name}.conf

%fdupes -s %{buildroot}/srv/www/htdocs/riot

%files
%{serverroot}/riot
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/config.json

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

%changelog
openSUSE Build Service is sponsored by