File cypht.spec of Package cypht
#
# spec file for package cypht
#
# Copyright (c) 2022 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/
#
%if 0%{?suse_version}
%define ap_usr wwwrun
%define ap_grp www
%else
%define ap_usr nobody
%define ap_grp nogroup
%endif
%define ap_sysconfdir %(apxs -q SYSCONFDIR)
%define installdir /usr/share/php/%{name}
Name: cypht
Version: 1.3.0
Release: 0
Summary: Lightweight Open Source webmail
License: LGPL-2.1-only
URL: https://cypht.org/
Group: Productivity/Networking/Web/Utilities
Source: %{name}-%{version}.tar.gz
#
# zypper install php-composer
# cd cypht-1.2.3
# composer install --no-dev --no-scripts --ignore-platform-reqs
# => check "scripts" section in composer.json
# export version=%%{version}; tar -cvJf ../cypht-${version}-vendor.tar.xz vendor/
#
Source1: %{name}-%{version}-vendor.tar.xz
Requires(pre): php >= 5.4
Requires: mod_php_any >= 5.4
Requires: php-curl
Requires: php-mbstring
Requires: php-fileinfo
Recommends: php-redis
Recommends: php-pdo
Recommends: php-gd
Recommends: php-memcached
Recommends: php-imagick
Recommends: php-gnupg
BuildRequires: apache2-devel
BuildRequires: fdupes
BuildRequires: logrotate
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%if 0%{?suse_version} >= 1500
Requires(pre): user(%ap_usr)
Requires(pre): group(%ap_grp)
%else
Requires(pre): aaa_base
%endif
%description
The driving force behind Cypht development is to provide combined views for
multiple accounts, but it's also a standard E-mail client that lets you browse
and manage IMAP folders and send outbound messages with SMTP.
Cypht is an application built entirely of plugins, or as we call them, module
sets (which is obviously way cooler sounding than plugins), that are executed
by the framework. Modules provide a flexible way to add new features or
customize the program without hacking the code.
%prep
%setup -q
%build
#
%install
install -d -m0755 %{buildroot}/%{installdir}
# copy src from build to buildroot
cp -dR * %{buildroot}/%{installdir}/
# remove not needed files
rm %{buildroot}/%{installdir}/*.md
rm %{buildroot}/%{installdir}/scripts/*.sh
rm %{buildroot}/%{installdir}/{LICENSE,CHANGES,INSTALL,RELEASE_NOTES}
rm -rf %{buildroot}/%{installdir}/tests
# create initial configuration file
cp %{buildroot}/%{installdir}/hm3.sample.ini %{buildroot}/%{installdir}/hm3.ini
# create r/w directory
mkdir -p %{buildroot}/var/lib/hm3/{attachments,users,app_data}
# reduce size, run fdupes
%fdupes %{buildroot}/%{installdir}
%files
%defattr(0644,root,root,0755)
%license LICENSE
%doc CHANGES INSTALL *.md RELEASE_NOTES
%dir %{_datadir}/php
%dir %{installdir}
%config(noreplace) %{installdir}/hm3.ini
%{installdir}/*
%defattr(0644,%{ap_usr},%{ap_grp},0755)
%dir /var/lib/hm3
/var/lib/hm3/*
%changelog