3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname tideways_xhprof
7 Summary: %{modname} Tideways XHProf Extension
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: https://github.com/tideways/php-xhprof-extension/archive/v%{version}/%{modname}-%{version}.tar.gz
14 # Source0-md5: 374cf4ff7ba03401a279777abe94815d
15 URL: https://github.com/tideways/php-xhprof-extension
16 BuildRequires: %{php_name}-cli
17 BuildRequires: %{php_name}-devel >= 4:7.0
18 BuildRequires: rpmbuild(macros) >= 1.666
19 %{?requires_php_extension}
20 Provides: php(%{modname}) = %{version}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 Modern XHProf compatible PHP Profiler.
28 mv php-xhprof-extension-%{version}/* .
35 # simple module load test
37 -d extension_dir=modules \
38 -d extension=%{modname}.so \
40 grep %{modname} modules.log
43 rm -rf $RPM_BUILD_ROOT
45 EXTENSION_DIR=%{php_extensiondir} \
46 INSTALL_ROOT=$RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
49 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
50 ; Enable %{modname} extension module
51 extension=%{modname}.so
55 rm -rf $RPM_BUILD_ROOT
58 %php_webserver_restart
62 %php_webserver_restart
66 %defattr(644,root,root,755)
67 %doc README.md CHANGELOG.md NOTICE
68 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
69 %attr(755,root,root) %{php_extensiondir}/%{modname}.so