3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname uri_template
7 Summary: Implementation of URI Template(RFC6570) specification for PHP
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: 652dbdb85da3c820f369526155355522
15 URL: http://pecl.php.net/package/uri_template
16 %{?with_tests:BuildRequires: %{php_name}-cli}
17 BuildRequires: %{php_name}-devel >= 4:5.3.1
18 BuildRequires: rpmbuild(macros) >= 1.686
19 %{?requires_php_extension}
20 Provides: php(%{modname}) = %{version}
21 Obsoletes: php-pecl-uri_template < 1.0-3
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 URI Template PHP Extension implementation of RFC-6570.
29 mv %{modname}-%{version}/* .
37 # simple module load test
39 -d extension_dir=modules \
40 -d extension=%{modname}.so \
42 grep %{modname} modules.log
44 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
45 unset TZ LANG LC_ALL || :
47 PHP_EXECUTABLE=%{__php}
51 rm -rf $RPM_BUILD_ROOT
53 EXTENSION_DIR=%{php_extensiondir} \
54 INSTALL_ROOT=$RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
57 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
58 ; Enable %{modname} extension module
59 extension=%{modname}.so
62 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
63 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
66 rm -rf $RPM_BUILD_ROOT
69 %php_webserver_restart
73 %php_webserver_restart
77 %defattr(644,root,root,755)
78 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
79 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
80 %{_examplesdir}/%{name}-%{version}