File rainloop.spec of Package rainloop

# spec file for package rainloop
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

%define serverroot /srv/www/

Name:           rainloop
Version:        1.12.1
Release:        0
Summary:        Simple, modern & fast web-based email client
License:        AGPL-3.0
Group:          Productivity/Networking/Web/Frontends
Source2:        rainloop.httpd
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  apache2
BuildRequires:  coreutils
BuildRequires:  unzip
Requires:       mod_php_any
Requires:       php-curl
Requires:       php-zlib
BuildArch:      noarch

Simple, modern & fast web-based email client.
Modest system requirements, decent performance, simple installation and
upgrade, no database required - all these make RainLoop Webmail a perfect
choice for your email solution.

%setup -c
#%%patch0 -p1
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;


install -d -m 0755 -d %{buildroot}%{_datadir}/%{name}/%{name}
install -d -m 0755 -d %{buildroot}%{_localstatedir}/lib/%{name} 
install -m 0644 index.php %{buildroot}%{_datadir}/%{name}/
cp -av data/* %{buildroot}%{_localstatedir}/lib/%{name}/
cp -av rainloop/ %{buildroot}%{_datadir}/%{name}/

# apache conf
install -D -m0644 %{S:2} %{buildroot}/etc/apache2/conf.d/%{name}.conf
sed -i -e "s|@RAINLOOP_ROOT@|%{_datadir}/%{name}|" %{buildroot}/etc/apache2/conf.d/%{name}.conf
( cd %{buildroot}%{_datadir}/%{name} && ln -s %{_localstatedir}/lib/%{name} data )

%dir %{_datadir}/%{name}
%config(noreplace) /etc/apache2/conf.d/%{name}.conf