LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File php7-pecl_http.spec of Package php7-pecl_http (Project home:bjoern_beutel)

# spec file for package php7-pecl_http
# 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 http://bugs.opensuse.org/

%define pkg_name    pecl_http
Name:           php7-pecl_http
Version:        3.1.0
Release:        0
Summary:        Extended HTTP Support
License:        BSD
Group:          Productivity/Networking/Web/Servers
Url:            http://pecl.php.net/pecl_http
Source:         https://pecl.php.net/get/%{pkg_name}-%{version}.tgz
Source1:        http.ini
BuildRequires:  curl-devel
BuildRequires:  file-devel
BuildRequires:  openssl-devel
#yes, PHP modules are required for build, as configure tests it's precence, to enable
#or disable features.
BuildRequires:  php7-devel
BuildRequires:  php7-iconv
BuildRequires:  php7-json
BuildRequires:  php7-propro
BuildRequires:  php7-raphf
Requires:       php7-iconv
Requires:       php7-json
Requires:       php7-propro
Requires:       php7-raphf
Conflicts:      php7-event
Provides:       php-pecl_http = %{version}
Obsoletes:      php-pecl_http < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1100
BuildRequires:  libevent-devel
BuildRequires:  libevent
%if %{?php_zend_api}0
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
%requires_eq    php7

Extended HTTP Support

%package         devel
Summary:        Include files of php7-pecl_http
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version} php7-devel curl-devel file-devel
%if 0%{?suse_version} > 1100
Requires:       libevent-devel
Requires:       libevent

%description   devel
Extended HTTP Support

%setup -q -n %{pkg_name}-%{version}

# There is bug in php-config that does not correctly detect php cli binary
# ($php_cli_binary variable, reason: in $php_sapis is not 'cli') and thus
# returns /usr/bin/php-cgi instead. php-cgi is not present on the build system
# though, so it can be used to detect installed extensions, and this
# is what configure later does.
sed -i 's:^PHP_EXECUTABLE.*:PHP_EXECUTABLE=%{_bindir}/php:' configure
#pushd %{name}
export CFLAGS="%{optflags} -DPHP_HTTP_HAVE_EXT_ICONV -fvisibility=hidden"
%configure \
--with-http-magic-mime=%{_usr} \
--with-http-zlib-compression=%{_usr} \
--with-http-curl-requests=%{_usr} \
make %{?_smp_mflags}
#make %{?_smp_mflags} test

make DESTDIR=%{buildroot} install %{?_smp_mflags} INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/php7/conf.d
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/php7/conf.d/http.ini

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

%files devel
%dir %{_includedir}/php7/ext/http