File chwala.spec of Package chwala
#
# spec file for package chwala
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2014-2016 Aeneas Jaissle <aj@ajaissle.de>
# Copyright (c) 2013 Kolab Systems AG, Zuerich, Switzerland.
#
# 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/
#
%global roundcubepath %{apache_datadir}/roundcubemail
%global roundcubeconfigpath %{_sysconfdir}/roundcubemail
Name: chwala
Version: 0.5.12
Release: 0
Summary: Glorified WebDAV, done right
License: AGPL-3.0-or-later
Group: Productivity/Networking/Other
Url: https://kolab.org
Source0: https://cgit.kolab.org/%{name}/snapshot/%{name}-%{version}.tar.gz
Source1: %{name}-httpd.conf
Source2: %{name}.logrotate
BuildArch: noarch
BuildRequires: apache-rpm-macros
# Requiring the configuration from roundcubemail
BuildRequires: roundcubemail >= 1.3
# Requiring the plugins 'kolab_auth', 'libkolab' from roundcubemail-plugins-kolab
BuildRequires: roundcubemail-plugins-kolab >= 3.3
Requires: http_daemon
Requires: php-kolab-Net_LDAP3 >= 1.0.7
Requires: php-pear-Auth_SASL >= 1.1.0
Requires: php-pear-HTTP_Request2 >= 2.3.0
Requires: php-pear-Mail_Mime >= 1.8.5
Requires: php-pear-Net_IDNA2 >= 0.2.0
Requires: php-pear-Net_SMTP >= 1.7.3
Requires: php-pear-Net_Socket >= 1.2.1
Requires: php-pear-Net_URL2 >= 2.2.1
Requires: php-sabre-dav >= 2.1.11
Requires: php-smarty3
# Requiring the configuration from roundcubemail
Requires: roundcubemail >= 1.3
# Requiring the plugins 'kolab_auth', 'libkolab' from roundcubemail-plugins-kolab
Requires: roundcubemail-plugins-kolab >= 3.3
Recommends: logrotate
Suggests: apache2
%description
Chwala is the implementation of a modular, scalable, driver-backed file-
and media-storage, that with using an API, provides generated UI components
based on context and content, for the purpose of integration with 3rd
party applications.
%prep
%setup -q
# remove unused .htaccess file
find . -type f -name ".htaccess" -delete
%build
%install
install -d \
%{buildroot}%{apache_sysconfdir}/conf.d \
%{buildroot}%{_sysconfdir}/logrotate.d \
%{buildroot}%{apache_datadir}/%{name} \
%{buildroot}%{apache_datadir}/%{name}/config \
%{buildroot}%{_localstatedir}/cache/%{name} \
%{buildroot}%{_localstatedir}/lib/%{name} \
%{buildroot}%{_localstatedir}/log/%{name}
# apache config
sed -e "s#__CHWALA_ROOT__#%{apache_datadir}/%{name}#g" %{SOURCE1} > \
%{buildroot}%{apache_sysconfdir}/conf.d/%{name}.conf
cp -a lib %{buildroot}%{apache_datadir}/%{name}/lib
cp -a public_html %{buildroot}%{apache_datadir}/%{name}/public_html
# var links
ln -s %{_localstatedir}/cache/%{name} %{buildroot}%{apache_datadir}/%{name}/cache
ln -s %{_localstatedir}/lib/%{name} %{buildroot}%{apache_datadir}/%{name}/temp
ln -s %{_localstatedir}/log/%{name} %{buildroot}%{apache_datadir}/%{name}/logs
ln -s %{_sysconfdir}/roundcubemail %{buildroot}%{apache_datadir}/%{name}/config
# logrotate config
install -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# roundcube plugins
mkdir -p %{buildroot}%{apache_datadir}/%{name}/lib/drivers/kolab/plugins
for plugin in kolab_auth kolab_folders libkolab; do
ln -s %{roundcubepath}/plugins/${plugin} %{buildroot}%{apache_datadir}/%{name}/lib/drivers/kolab/plugins/${plugin}
done
# roundcube configuration
for config in config defaults; do
ln -s %{roundcubeconfigpath}/${config}.inc.php %{buildroot}%{apache_datadir}/%{name}/config/${config}.inc.php
done
# roundcube autoloader
#ln -s %%{roundcubepath}/vendor %%{buildroot}%%{apache_datadir}/%%{name}/vendor
%pre
if [ -L "%{apache_datadir}/%{name}/config" ]; then
rm -rf "%{apache_datadir}/%{name}/config"
fi
for plugin in kolab_auth libkolab; do
if [ -d "%{apache_datadir}/%{name}/lib/plugins/${plugin}" ]; then
if ! [ -L "%{apache_datadir}/%{name}/lib/plugins/${plugin}" ]; then
rm -rf "%{apache_datadir}/%{name}/lib/plugins/${plugin}"
fi
fi
done
%post
%{apache_datadir}/roundcubemail/bin/updatedb.sh \
--dir %{_docdir}/%{name}/SQL/ \
--package chwala \
>/dev/null 2>&1 || :
exit 0
%files
%license LICENSE
%doc README.md doc/SQL config/config.inc.php.dist
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf
%dir %{apache_datadir}/%{name}
%{apache_datadir}/%{name}/config/
%{apache_datadir}/%{name}/lib/
%{apache_datadir}/%{name}/public_html/
%{apache_datadir}/%{name}/cache
%{apache_datadir}/%{name}/logs
%{apache_datadir}/%{name}/temp
#%%{apache_datadir}/%%{name}/vendor
%attr(0750,%{apache_user},root) %{_localstatedir}/cache/%{name}
%attr(0750,%{apache_user},root) %{_localstatedir}/lib/%{name}
%attr(0750,%{apache_user},root) %{_localstatedir}/log/%{name}
%changelog