1
0
forked from pool/roundcubemail

- use the virtual provides from each PHP module, to allow the installation

of roundcubemail with various PHP version. 
  The only problem, we are currently facing is the automatic 
  enablement of the PHP apache module during post-installation. 
  Trying to evaluate the correct PHP module now during post as well, 
  which should eleminate the pre-definition of the required 
  PHP-Version during build completely.
  See https://build.opensuse.org/request/show/940859 for the initial
  discussion.

OBS-URL: https://build.opensuse.org/package/show/server:php:applications/roundcubemail?expand=0&rev=157
This commit is contained in:
Lars Vogdt 2021-12-28 13:37:17 +00:00 committed by Git OBS Bridge
parent 36e589e25e
commit a098cb285c
2 changed files with 36 additions and 20 deletions

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Dec 28 13:25:37 UTC 2021 - Lars Vogdt <lars@linux-schulserver.de>
- use the virtual provides from each PHP module, to allow the installation
of roundcubemail with various PHP version.
The only problem, we are currently facing is the automatic
enablement of the PHP apache module during post-installation.
Trying to evaluate the correct PHP module now during post as well,
which should eleminate the pre-definition of the required
PHP-Version during build completely.
See https://build.opensuse.org/request/show/940859 for the initial
discussion.
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Nov 28 20:14:40 UTC 2021 - Michael Ströder <michael@stroeder.com> Sun Nov 28 20:14:40 UTC 2021 - Michael Ströder <michael@stroeder.com>

View File

@ -18,7 +18,7 @@
%define roundcubepath %{apache_serverroot}/%{name} %define roundcubepath %{apache_serverroot}/%{name}
%define roundcubeconfigpath %{_sysconfdir}/%{name} %define roundcubeconfigpath %{_sysconfdir}/%{name}
%define php_name %(php -r "print 'php' . PHP_MAJOR_VERSION;")
Name: roundcubemail Name: roundcubemail
Version: 1.5.1 Version: 1.5.1
Release: 0 Release: 0
@ -40,17 +40,17 @@ Patch0: %{name}-config_dir.patch
BuildRequires: apache-rpm-macros BuildRequires: apache-rpm-macros
BuildRequires: apache2 BuildRequires: apache2
BuildRequires: php-cli BuildRequires: php-cli
Requires: %{php_name}-dom Requires: php-dom
Requires: %{php_name}-exif Requires: php-exif
Requires: %{php_name}-gettext Requires: php-gettext
Requires: %{php_name}-iconv Requires: php-iconv
Requires: %{php_name}-intl Requires: php-intl
Requires: %{php_name}-json Requires: php-json
Requires: %{php_name}-mbstring Requires: php-mbstring
Requires: %{php_name}-openssl Requires: php-openssl
Requires: apache2-mod_%{php_name} Requires(pre): mod_php_any
Requires: mod_php_any
## Requires: for upstream dep package ## Requires: for upstream dep package
Requires: %{php_name}-sockets
Requires: php-pear-Auth_SASL >= 1.0.6 Requires: php-pear-Auth_SASL >= 1.0.6
Requires: php-pear-MDB2_Driver_mysqli Requires: php-pear-MDB2_Driver_mysqli
Requires: php-pear-Mail_Mime >= 1.10.0 Requires: php-pear-Mail_Mime >= 1.10.0
@ -59,13 +59,14 @@ Requires: php-pear-Net_LDAP2
Requires: php-pear-Net_SMTP >= 1.8.1 Requires: php-pear-Net_SMTP >= 1.8.1
Requires: php-pear-Net_Sieve >= 1.4.3 Requires: php-pear-Net_Sieve >= 1.4.3
Requires: php-pear-Net_Socket >= 1.0.12 Requires: php-pear-Net_Socket >= 1.0.12
Requires: (%{php_name}-mysql or %{php_name}-pgsql) Requires: php-sockets
Recommends: %{php_name}-fileinfo Requires: (php-mysql or php-pgsql)
Recommends: %{php_name}-imagick Recommends: php-fileinfo
Recommends: %{php_name}-zip Recommends: php-imagick
Recommends: php-zip
Recommends: logrotate Recommends: logrotate
Recommends: php-pear-Crypt_GPG >= 1.6.3 Recommends: php-pear-Crypt_GPG >= 1.6.3
Suggests: %{php_name}-mysql Suggests: php-mysql
Conflicts: roundcube-framework Conflicts: roundcube-framework
Provides: roundcube_framework = %{version} Provides: roundcube_framework = %{version}
BuildArch: noarch BuildArch: noarch
@ -125,8 +126,8 @@ install -d -m 0755 %{buildroot}/%{_sysconfdir}/logrotate.d
install %{SOURCE5} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name} install %{SOURCE5} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
# extract roundcube-framework # extract roundcube-framework
install -d -m 0755 %{buildroot}/%{_datadir}/%{php_name} install -d -m 0755 %{buildroot}/%{_datadir}/php
mv program/lib/Roundcube %{buildroot}%{_datadir}/%{php_name}/Roundcube mv program/lib/Roundcube %{buildroot}%{_datadir}/php/Roundcube
# install roundcubemail # install roundcubemail
install -d -m 0755 %{buildroot}/%{roundcubepath} install -d -m 0755 %{buildroot}/%{roundcubepath}
@ -246,8 +247,9 @@ if [ ${1:-0} -eq 1 ]; then
if [ -x %{_sbindir}/a2enmod ]; then if [ -x %{_sbindir}/a2enmod ]; then
# enable required apache modules # enable required apache modules
%if 0%{?suse_version} > 01500 %if 0%{?suse_version} > 01500
PHP_MODULE=$(php -r "print 'php' . PHP_MAJOR_VERSION;")
if ! grep -q php %{_sysconfdir}/sysconfig/apache2 1>&2 2>/dev/null; then if ! grep -q php %{_sysconfdir}/sysconfig/apache2 1>&2 2>/dev/null; then
%{_sbindir}/a2enmod -q %{php_name} || %{_sbindir}/a2enmod %{php_name} %{_sbindir}/a2enmod -q $PHP_MODULE || %{_sbindir}/a2enmod $PHP_MODULE
fi fi
%endif %endif
for module in alias brotli deflate expires filter headers rewrite setenvif version ; do for module in alias brotli deflate expires filter headers rewrite setenvif version ; do
@ -344,7 +346,8 @@ exit 0
%{roundcubepath}/SQL %{roundcubepath}/SQL
%{roundcubepath}/temp %{roundcubepath}/temp
%{roundcubepath}/vendor/ %{roundcubepath}/vendor/
%{_datadir}/%{php_name}/Roundcube %dir %{_datadir}/php
%{_datadir}/php/Roundcube
%attr(-, wwwrun, root) %{_localstatedir}/log/%{name} %attr(-, wwwrun, root) %{_localstatedir}/log/%{name}
%attr(-, wwwrun, root) %{_localstatedir}/lib/%{name} %attr(-, wwwrun, root) %{_localstatedir}/lib/%{name}