File jitsi-jigasi.spec of Package jitsi-jigasi

#
# spec file for package jitsi-jigasi
#
# 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/
#

%define group_name jitsi
%define short_name jigasi

Name:           jitsi-jigasi
Version:        2.0.9753
Release:        0
Summary:        Jitsi telephone dial in server component
License:        Apache-2.0
Group:          Applications/Communications
URL:            https://github.com/jitsi/jigasi
Source0:        jitsi-jigasi.tar.bz2
Source1:        maven_repo.tar.bz2
Source2:        %{short_name}-user.conf
Source3:        logging.properties
Source4:        sip-communicator.properties
%if 0%{?suse_version} > 1500
BuildRequires:  alts
%endif
BuildRequires:  maven
BuildRequires:  unzip
BuildRequires:  sysuser-tools
BuildRequires:  java-17-openjdk-devel
%sysusers_requires
Requires(post): sed
Requires(post): hostname
Requires:       java-headless

%description
Jigasi: a server-side application acting as a gateway to Jitsi Meet
conferences. Currently allows regular SIP clients to join meetings and
provides transcription capabilities.

%prep
%setup -q -n %{name}
%setup -q -T -D -a 1 -n %{name}

%pre -f %{short_name}.pre

%build
mvn package -o -DskipTests -Dmaven.repo.local=./maven_repo -Dassembly.skipAssembly=false
%sysusers_generate_pre %{S:2} %{short_name}

%install
mkdir -p %{buildroot}%{_sysusersdir}/
install -m 0644 %{S:2} %{buildroot}%{_sysusersdir}/

# Extract source
mkdir -p %{buildroot}%{_datadir}/%{group_name}/%{short_name}
mkdir -p %{buildroot}%{_libdir}/%{short_name}
unzip -qq %{_builddir}/%{name}/target/jigasi-linux-x64-1.1-SNAPSHOT.zip -d %{buildroot}%{_datadir}/%{group_name}/%{short_name}
mv %{buildroot}%{_datadir}/%{group_name}/%{short_name}/jigasi-linux-x64-1.1-SNAPSHOT/* %{buildroot}%{_datadir}/%{group_name}/%{short_name}
rm -r %{buildroot}%{_datadir}/%{group_name}/%{short_name}/jigasi-linux-x64-1.1-SNAPSHOT

# Install configs
install -D -T -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/%{group_name}/%{short_name}/logging.properties
install -D -T -m 0644 %{S:4} %{buildroot}%{_sysconfdir}/%{group_name}/%{short_name}/sip-communicator.properties

%post -n %{group_name}-%{short_name} -p /sbin/ldconfig
%postun -n %{group_name}-%{short_name} -p /sbin/ldconfig

%files
%{_sysusersdir}/%{short_name}-user.conf
%dir %{_datadir}/%{group_name}
%dir %{_sysconfdir}/%{group_name}
%dir %attr(-,%{short_name},%{group_name}) %{_sysconfdir}/%{group_name}/%{short_name}
%config(noreplace) %attr(-,%{short_name},%{group_name}) %{_sysconfdir}/%{group_name}/%{short_name}/logging.properties
%config(noreplace) %attr(-,%{short_name},%{group_name}) %{_sysconfdir}/%{group_name}/%{short_name}/sip-communicator.properties
%attr(0644,%{short_name},%{group_name}) %{_datadir}/%{group_name}/%{short_name}
%dir %{_libdir}/%{short_name}

%license LICENSE
%doc README.md

%changelog

openSUSE Build Service is sponsored by