File dba-php-5316-uploadprogress.spec of Package dba-php-5316-uploadprogress

# norootforbuild

%define pkg uploadprogress
%define modname pecl-%{pkg}
%define real_vers 1.0.3.1
%define maketest 0

%define php_version     5.3.16
%define php_vers        5316
%define run_tests       0
%define prefix          /DBA/apache/PHP/%{php_version}
%define phpize          %{prefix}/bin/phpize
%define phpconf         %{prefix}/bin/php-config


Name: 		dba-php-%{php_vers}-%{pkg}
Summary: 	An extension to track progress of a file upload.
Version: 	%{real_vers}
Release: 	1
License: 	GPL
Group: 		Productivity/Networking/Web/Servers
Packager:       Holger Manthey <holger.manthey@bertelsmann.de>
URL: 		http://pecl.php.net/package/%{pkg}
Source: 	http://pecl.php.net/get/%{pkg}-%{version}.tgz
Source1: 	%{pkg}.ini
BuildRoot: 	%{_tmppath}/%{name}-%{version}-build

BuildRequires: 	dba-php-%{php_vers}

#!BuildIgnore:  dba-postgresql-839 dba-postgresql-842 dba-postgresql-845 dba-postgresql-846
#!BuildIgnore:  dba-postgresql-901 dba-postgresql-902 dba-postgresql-904 dba-postgresql-910
#!BuildIgnore:  dba-postgresql-911 dba-postgresql-912
#!BuildIgnore:  dba-openssl-098o dba-openssl-098r dba-openssl-098x dba-openssl-101c

%if 0%{?rhel_version} < 600
BuildRequires: 	libssh2-devel
%endif

%if 0%{?suse_version} >= 1200
#!BuildIgnore:  libfreetds
%endif

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks
%endif


%description
See http://cvs.php.net/viewvc.cgi/pecl/uploadprogress/examples/ for a little example.
It is only known to work on Apache with mod_php, other SAPI implementations unfortunately still have issues.
At least PHP 5.2 is needed.


%prep
%setup -q -n %{pkg}-%{real_vers}


%build

CFLAGS="%{optflags} -fno-strict-aliasing"
CXXFLAGS="%{optflags} -fno-strict-aliasing"
%if 0%{?suse_version} > 1000
CFLAGS="$CFLAGS -fstack-protector"
CXXFLAGS="$CXXFLAGS -fstack-protector"
%endif

export CFLAGS
export CXXFLAGS

%{phpize}

%configure \
  --with-libdir=%{_lib} \
  --with-php-config=%{phpconf} \
  --with-%{modname}=shared

%{__make} %{?jobs:-j%jobs}
%if %maketest
%{__make} test PHP_EXECUTABLE=%{prefix}/bin/php
%endif


%install
%{__mkdir} -p %{buildroot}%{prefix}/conf
%{__make} install INSTALL_ROOT="%{buildroot}"
%{__install} -D -m 0644 %{S:1} %{buildroot}%{prefix}/conf/%{pkg}.ini


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root,-)
%dir %{prefix}/lib/php/extensions
%{prefix}/lib/php/extensions/%{pkg}.so
%config(noreplace) %{prefix}/conf/%{pkg}.ini


%changelog
* Tue Sep 11 2012 Holger Manthey <holger.manthey@bertelsmann.de>
- initial package
openSUSE Build Service is sponsored by