File php7-phalcon.spec of Package php7-phalcon

# spec file for package php7-phalcon
# Copyright (c) 2016 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

%define _name       phalcon
%define _cname      cphalcon
%define _zname      zephir
%define _zversion   0.9.7

Name:           php7-phalcon
Version:        3.1.2
Release:        0
Summary:        PHP7 Extension Module
License:        BSD-3-Clause
Group:          Development/Libraries/PHP
Source0:        %{_cname}-%{version}.tar.gz
Source1:        %{_zname}-%{_zversion}.tar.gz
BuildRequires:  gcc
BuildRequires:  php7-ctype
BuildRequires:  php7-devel
BuildRequires:  php7-json
BuildRequires:  php7-pdo
BuildRequires:  re2c >= 0.13.4
Requires:       php7-mysql

Phalcon is an open source, full stack framework for PHP 5
written as a C-extension, optimized for high performance.
You don't need learn or use the C language, since the functionality
is exposed as PHP classes ready for you to use. Zephir is a high level
language, something between C and PHP. It’s both dynamic and static
typed and it supports just the features we need to create and maintain
a project like 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}.

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

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

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

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

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



%config(noreplace) %{_sysconfdir}/php7/conf.d/%{_name}.ini

openSUSE Build Service is sponsored by