From a098cb285cd0ee031851f7d80724ffbec7fdcb8169f914aa0660e06fe2c4c367 Mon Sep 17 00:00:00 2001 From: Lars Vogdt Date: Tue, 28 Dec 2021 13:37:17 +0000 Subject: [PATCH] - 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 --- roundcubemail.changes | 13 +++++++++++++ roundcubemail.spec | 43 +++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/roundcubemail.changes b/roundcubemail.changes index f683178..4b0df9c 100644 --- a/roundcubemail.changes +++ b/roundcubemail.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Dec 28 13:25:37 UTC 2021 - Lars Vogdt + +- 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 diff --git a/roundcubemail.spec b/roundcubemail.spec index 0c0481f..6b29ad3 100644 --- a/roundcubemail.spec +++ b/roundcubemail.spec @@ -18,7 +18,7 @@ %define roundcubepath %{apache_serverroot}/%{name} %define roundcubeconfigpath %{_sysconfdir}/%{name} -%define php_name %(php -r "print 'php' . PHP_MAJOR_VERSION;") + Name: roundcubemail Version: 1.5.1 Release: 0 @@ -40,17 +40,17 @@ Patch0: %{name}-config_dir.patch BuildRequires: apache-rpm-macros BuildRequires: apache2 BuildRequires: php-cli -Requires: %{php_name}-dom -Requires: %{php_name}-exif -Requires: %{php_name}-gettext -Requires: %{php_name}-iconv -Requires: %{php_name}-intl -Requires: %{php_name}-json -Requires: %{php_name}-mbstring -Requires: %{php_name}-openssl -Requires: apache2-mod_%{php_name} +Requires: php-dom +Requires: php-exif +Requires: php-gettext +Requires: php-iconv +Requires: php-intl +Requires: php-json +Requires: php-mbstring +Requires: php-openssl +Requires(pre): mod_php_any +Requires: mod_php_any ## Requires: for upstream dep package -Requires: %{php_name}-sockets Requires: php-pear-Auth_SASL >= 1.0.6 Requires: php-pear-MDB2_Driver_mysqli 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_Sieve >= 1.4.3 Requires: php-pear-Net_Socket >= 1.0.12 -Requires: (%{php_name}-mysql or %{php_name}-pgsql) -Recommends: %{php_name}-fileinfo -Recommends: %{php_name}-imagick -Recommends: %{php_name}-zip +Requires: php-sockets +Requires: (php-mysql or php-pgsql) +Recommends: php-fileinfo +Recommends: php-imagick +Recommends: php-zip Recommends: logrotate Recommends: php-pear-Crypt_GPG >= 1.6.3 -Suggests: %{php_name}-mysql +Suggests: php-mysql Conflicts: roundcube-framework Provides: roundcube_framework = %{version} BuildArch: noarch @@ -125,8 +126,8 @@ install -d -m 0755 %{buildroot}/%{_sysconfdir}/logrotate.d install %{SOURCE5} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name} # extract roundcube-framework -install -d -m 0755 %{buildroot}/%{_datadir}/%{php_name} -mv program/lib/Roundcube %{buildroot}%{_datadir}/%{php_name}/Roundcube +install -d -m 0755 %{buildroot}/%{_datadir}/php +mv program/lib/Roundcube %{buildroot}%{_datadir}/php/Roundcube # install roundcubemail install -d -m 0755 %{buildroot}/%{roundcubepath} @@ -246,8 +247,9 @@ if [ ${1:-0} -eq 1 ]; then if [ -x %{_sbindir}/a2enmod ]; then # enable required apache modules %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 - %{_sbindir}/a2enmod -q %{php_name} || %{_sbindir}/a2enmod %{php_name} + %{_sbindir}/a2enmod -q $PHP_MODULE || %{_sbindir}/a2enmod $PHP_MODULE fi %endif for module in alias brotli deflate expires filter headers rewrite setenvif version ; do @@ -344,7 +346,8 @@ exit 0 %{roundcubepath}/SQL %{roundcubepath}/temp %{roundcubepath}/vendor/ -%{_datadir}/%{php_name}/Roundcube +%dir %{_datadir}/php +%{_datadir}/php/Roundcube %attr(-, wwwrun, root) %{_localstatedir}/log/%{name} %attr(-, wwwrun, root) %{_localstatedir}/lib/%{name}