File jitsi-meet.spec of Package jitsi-meet

#
# spec file for package jitsi-meet
#
# Copyright (c) 2020 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:           jitsi-meet
Version:        2.0.6726
Release:        0
Summary:        Jitsi Meet - Video conferencing software
License:        Apache-2.0
%if 0%{?suse_version}
Group:          Productivity/Networking/Web/Frontends
%else
Group:          Applications/Communications
%endif
URL:            https://github.com/jitsi/jitsi-meet
BuildRequires:  nodejs
BuildRequires:  npm
BuildRequires:  nodejs-jetifier
BuildRequires:  nodejs-patch-package
BuildRequires:  tar
BuildRequires:  bzip2
Requires:       %{name}-branding = %{version}
Requires:       %{name}-prosody-plugins
Source0:        %{name}-%{version}.tar.gz
Source1:        jitsi-meet-dependencies.tar.gz
Source2:        jitsi-meet.conf
Patch0:         npmrc.patch
Suggests:       nginx
BuildArch:      noarch

%description
Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

%package branding-upstream
Summary:        Upstream branding of jitsi-meet
Group:          Productivity/Networking/Web/Frontends
Requires(pre):  %{name} = %{version}
Provides:       %{name}-branding = %{version}
Supplements:    packageand(%{name}:branding-upstream)
Conflicts:      otherproviders(%{name}-branding)
BuildArch:      noarch
#BRAND: favicon.ico: MS Windows icon resource - 3 icons, 16x16, 32 bits/pixel, 32x32, 32 bits/pixel
#BRAND: all.css:     CSS stylesheet containing the color definitions
#BRAND: *.html:      adjusted HTML layout pages

%package prosody-plugins
Summary:       Prosody Plugins for Jitsi-Meet
Group:         Productivity/Networking/Web/Frontends
Requires:      prosody
BuildArch:     noarch

%description branding-upstream
Provides logos and customization for the Jitsi Meet online page.

This package contains the original upstream theme.

%description prosody-plugins
Provides the Prosody plugins which are required for Jitsi-Meet to work
correctly.

%prep
%setup -q -n %{name}-%{version}
%setup -q -D -T -a 1 -n %{name}-%{version}
find . -name .eslintrc.js -delete
%patch0 -p1

%build
npm install --offline
for c in $(ls node_modules/i18n-iso-countries/langs); do cp node_modules/i18n-iso-countries/langs/${c} lang/countries-${c}; done
./node_modules/.bin/webpack
make deploy
make clean
make source-package

%install
mkdir -p $RPM_BUILD_ROOT/srv/%{name}
tar -xf jitsi-meet.tar.bz2 -C $RPM_BUILD_ROOT/srv/
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/jitsi/meet/
cp -r resources/prosody-plugins/ $RPM_BUILD_ROOT/%{_datadir}/jitsi/meet/prosody-plugins
install -D -T -m 0644 %{S:2} $RPM_BUILD_ROOT/%{_sysconfdir}/nginx/vhosts.d/jitsi-meet.conf

%post
# Replace config values
if hostname -f ; then
    sed -i "s/\${FQDN}/$(hostname -f)/g" /srv/%{name}/config.js
    sed -i "s/\${FQDN}/$(hostname -f)/g" %{_sysconfdir}/nginx/vhosts.d/jitsi-meet.conf
else
    echo "You still need to setup your Fully-Qualified Domain Name!"
fi

%files
/srv/%{name}/
%config(noreplace) /srv/%{name}/config.js
%config(noreplace) /srv/%{name}/logging_config.js
%dir %{_sysconfdir}/nginx
%dir %{_sysconfdir}/nginx/vhosts.d
%config(noreplace) %{_sysconfdir}/nginx/vhosts.d/jitsi-meet.conf
%license LICENSE
%exclude /srv/%{name}/interface_config.js
%exclude /srv/%{name}/images/favicon.ico
%exclude /srv/%{name}/static/welcomePageAdditionalContent.html
%exclude /srv/%{name}/static/settingsToolbarAdditionalContent.html
%exclude /srv/%{name}/static/welcomePageAdditionalCard.html

%files branding-upstream
%license LICENSE
%config(noreplace) /srv/%{name}/interface_config.js
/srv/%{name}/images/favicon.ico
/srv/%{name}/static/welcomePageAdditionalContent.html
/srv/%{name}/static/settingsToolbarAdditionalContent.html
/srv/%{name}/static/welcomePageAdditionalCard.html

%files prosody-plugins
%dir /%{_datadir}/jitsi
%dir /%{_datadir}/jitsi/meet
%dir /%{_datadir}/jitsi/meet/prosody-plugins
/%{_datadir}/jitsi/meet/prosody-plugins/


%changelog
openSUSE Build Service is sponsored by