File php7-phalcon.spec of Package php5-phalcon

#
# spec file for package php7-phalcon
#
# Copyright (c) 2017 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 _name       phalcon
%define _cname      cphalcon
%define _zname      zephir
%define _zversion   0.9.7
%define _php        php7

Name:           %{_php}-phalcon
Version:        3.1.2
Release:        0
Summary:        A PHP framework
License:        BSD-3-Clause
Group:          Development/Libraries/PHP
Url:            http://phalconphp.com/
Source0:        %{_cname}-%{version}.tar.gz
Source1:        %{_zname}-%{_zversion}.tar.gz
BuildRequires:  %{_php}-ctype
BuildRequires:  %{_php}-devel
BuildRequires:  %{_php}-json
BuildRequires:  %{_php}-pdo
BuildRequires:  gcc
BuildRequires:  re2c >= 0.13.4
Requires:       %{_php}-mysql

%description
Phalcon is a full stack framework for PHP written as a C extension.
Its functionality is exposed as PHP classes. Zephir is a high-level
language, something between C and PHP. It is both dynamicly and
staticly typed and supports features needed by Phalcon.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q -n %{_cname}-%{version}
%setup -qTD -a1 -n %{_cname}-%{version}

%build
export CFLAGS="%{optflags} -g3 -O1 -std=gnu90 -DZEPHIR_RELEASE=1"
cd %{_zname}-%{_zversion}/parser/parser
sh build_linux.sh
cd ..
phpize
./configure --enable-zephir_parser
make %{?_smp_mflags}

cd ../..
php -d memory_limit=512M -d extension=%{_zname}-%{_zversion}/parser/modules/zephir_parser.so %{_zname}-%{_zversion}/compiler.php generate --parser-compiled=yes
cd ext
phpize
%configure --enable-%{_name}
make %{?_smp_mflags}

%install
mkdir -p %{buildroot}%{_libdir}/%{_php}/extensions
mkdir -p %{buildroot}%{_sysconfdir}/%{_php}/conf.d
cd ext
make install INSTALL_ROOT=%{buildroot}

echo "; comment out next line to disable %{_name} extension in php" > %{buildroot}/%{_sysconfdir}/%{_php}/conf.d/%{_name}.ini
echo "extension=%{_name}.so" >> %{buildroot}/%{_sysconfdir}/%{_php}/conf.d/%{_name}.ini

%files
%defattr(644,root,root,755)
%doc CHANGELOG.md CONTRIBUTING.md README.md
%{_libdir}/%{_php}/extensions/%{_name}.so
%config(noreplace) %{_sysconfdir}/%{_php}/conf.d/%{_name}.ini

%changelog
openSUSE Build Service is sponsored by