changes for build of openSUSE LEAP 15.x and SLE 15 and other pending changes in spec file

This commit is contained in:
Ralf Becker 2019-05-29 13:51:50 +02:00
parent 023e99673c
commit 4e5b7aa893
2 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,5 @@
Name: egroupware-epl
Version: 17.1.20180118
Version: 17.1.20190402
Release:
Summary: EGroupware is a web-based groupware suite written in php
Group: Web/Database
@ -38,7 +38,7 @@ Prefix: /usr/share
%define extra_requires apache2 apache2-mod_php5 php_any_db %{php}-dom %{php}-bz2 %{php}-openssl %{php}-zip %{php}-ctype %{php}-sqlite %{php}-xml %{php}-xmlreader %{php}-xmlwriter %{php}-dom
%else
# SLES 12 and openSUSE Leap no longer sets sles_version, but suse_version == 1315: contains now php7 packages, but no php7-xml
%if 0%{?suse_version} == 1315
%if 0%{?suse_version} >= 1315
%define php php7
%define extra_requires apache2 apache2-mod_%{php} %{php}-opcache php_any_db %{php}-dom %{php}-bz2 %{php}-openssl %{php}-zip %{php}-ctype %{php}-sqlite %{php}-xmlreader %{php}-xmlwriter %{php}-dom %{php}-posix
%else
@ -57,8 +57,10 @@ Suggests: %{name}-phpbrain = %{version}
Suggests: %{name}-phpfreechat = %{version}
Suggests: %{name}-sambaadmin = %{version}
Suggests: %{name}-sitemgr = %{version}
Recommends: %{php}-APCu
# recommend some packages so install of just egroupware-epl works fine
Recommends: %{php}-APCu
Recommends: mariadb-server
%else
%define php php
%define httpdconfd /etc/httpd/conf.d
@ -111,6 +113,11 @@ BuildRoot: %{_tmppath}/%{name}-buildroot
#otherwise build fails because of jar files in G2
BuildRequires: unzip sed
# fixing unknown user wwwrun in automatic install after build
%if 0%{?suse_version} >= 1500
BuildRequires: apache2
%endif
Buildarch: noarch
AutoReqProv: no
@ -185,9 +192,9 @@ Obsoletes: %{name}-developer_tools
# Check binary paths and create links for opensuse/sles
# create symlink for suse to get scripts with /usr/bin/php working
%if 0%{?suse_version}
if [ ! -f /usr/bin/php -a -x /usr/bin/php5 ]; then \
echo "Installing php -> php5 alternative"; \
/usr/sbin/update-alternatives --install /usr/bin/php php /usr/bin/php5 99; \
if [ ! -f /usr/bin/php -a -x /usr/bin/%{php} ]; then \
echo "Installing php -> %{php} alternative"; \
/usr/sbin/update-alternatives --install /usr/bin/php php /usr/bin/%{php} 99; \
fi
%endif
%if 0%{?rhel_version} || 0%{?fedora_version} || 0%{?centos_version}
@ -225,7 +232,7 @@ Further contributed applications are available as separate packages.
Summary: The EGroupware core
Group: Web/Database
Requires: %{php} >= 5.6.0
Requires: %{php}-mbstring %{php}-gd %{extra_requires} %{cron} zip %{php}-json %{php}-xsl %{php}-bcmath
Requires: %{php}-mbstring %{php}-gd %{extra_requires} %{cron} zip %{php}-json %{php}-xsl
Provides: egw-core %{version}
Provides: egw-addressbook %{version}
%if 0%{?suse_version}
@ -620,6 +627,7 @@ ln -s ../../..%{egwdatadir}/header.inc.php
%{egwdir}/updateGruntfile.php
%{egwdir}/groupdav.htaccess
%{egwdir}/webdav.php
%{egwdir}/install-cli.php
%{egwdir}/addressbook
%{egwdir}/admin
%{egwdir}/api

View File

@ -1,11 +1,11 @@
#!/usr/bin/env php
<?php
/**
* EGroupware - RPM post install: automatic install or update EGroupware
* EGroupware - RPM/DEB post install: automatic install or update EGroupware
*
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @author RalfBecker@outdoor-training.de
* @author rb@egroupware.org
*/
if (php_sapi_name() !== 'cli') // security precaution: forbit calling post_install as web-page
@ -110,7 +110,6 @@ function set_distro_defaults($distro=null)
{
case 'suse': case 'opensuse-leap': case 'opensuse':
// openSUSE 12.1+ no longer uses php5
if (file_exists('/usr/bin/php5')) $config['php'] = '/usr/bin/php5';
if (file_exists('/usr/bin/php7')) $config['php'] = '/usr/bin/php7';
$config['start_db'] = '/sbin/service mysql';
$config['autostart_db'] = '/sbin/chkconfig --level 345 mysql on';
@ -124,6 +123,11 @@ function set_distro_defaults($distro=null)
$config['ldap_group_context'] = 'ou=group,$base';
$config['webserver_user'] = 'wwwrun';
$config['apache_config'] = '/etc/apache2/conf.d/egroupware.conf';
// at least openSUSE 15.1 does no longer enable mod_php by default
if (file_exists('/usr/sbin/a2enmod'))
{
$config['php5enmod'] = '/usr/sbin/a2enmod '.basename($config['php']);
}
break;
case 'debian': case 'ubuntu':
// service not in Debian5, only newer Ubuntu, which complains about /etc/init.d/xx