File snappymail.spec of Package snappymail
#
# spec file for package snappymail
#
# 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 http://bugs.opensuse.org/
#
%define serverroot /srv/www/
Name: snappymail
Version: 2.36.0
Release: 0
Summary: Simple, modern & fast web-based email client
License: AGPL-3.0
Group: Productivity/Networking/Web/Frontends
Url: http://www.snappymail.eu
Source: https://github.com/the-djmaze/snappymail/releases/download/v%{version}/snappymail-%{version}.tar.gz
Source2: snappymail.httpd
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: apache2
BuildRequires: coreutils
BuildRequires: unzip
BuildRequires: fdupes
Requires: mod_php_any
Requires: php-curl
Requires: php-zlib
BuildArch: noarch
%description
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.
%prep
%setup -c
#%%patch0 -p1
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
%build
%install
install -d -m 0755 -d %{buildroot}%{_datadir}/%{name}/%{name}
install -d -m 0755 -d %{buildroot}%{_localstatedir}/lib/%{name}
#install -m 0644 serviceworker.min.js %{buildroot}%{_datadir}/%{name}/
install -m 0644 .htaccess %{buildroot}%{_datadir}/%{name}/
install -m 0644 _include.php %{buildroot}%{_datadir}/%{name}/
install -m 0644 index.php %{buildroot}%{_datadir}/%{name}/
cp -av data/* %{buildroot}%{_localstatedir}/lib/%{name}/
cp -av data/.htaccess %{buildroot}%{_localstatedir}/lib/%{name}/
cp -av snappymail/ %{buildroot}%{_datadir}/%{name}/
%fdupes %{buildroot}
# apache conf
install -D -m0644 %{S:2} %{buildroot}/etc/apache2/conf.d/%{name}.conf
sed -i -e "s|@SNAPPYMAIL_ROOT@|%{_datadir}/%{name}|" %{buildroot}/etc/apache2/conf.d/%{name}.conf
( cd %{buildroot}%{_datadir}/%{name} && ln -s %{_localstatedir}/lib/%{name} data )
%files
%defattr(-,root,root)
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/.htaccess
%{_datadir}/%{name}/index.php
%{_datadir}/%{name}/_include.php
#%{_datadir}/%{name}/serviceworker.min.js
%{_datadir}/%{name}/data
%{_datadir}/%{name}/%{name}
%config(noreplace) /etc/apache2/conf.d/%{name}.conf
%defattr(-,wwwrun,root)
%{_localstatedir}/lib/%{name}
%changelog