1 %define php_name php%{?php_suffix}
3 Summary: PHP extension for XHProf, a Hierarchical Profiler
4 Name: %{php_name}-pecl-xhprof
8 Group: Development/Languages/PHP
9 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
10 # Source0-md5: 275f15d2986f3b9c501f1867703f3cec
11 Source1: %{modname}.ini
13 URL: http://pecl.php.net/package/xhprof
14 BuildRequires: %{php_name}-devel >= 4:5.2.0
15 BuildRequires: rpmbuild(macros) >= 1.666
16 %{?requires_php_extension}
17 Provides: php(xhprof) = %{version}
18 # https://bugs.php.net/61262
19 ExclusiveArch: %{ix86} %{x8664}
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _webapps /etc/webapps
23 %define _webapp %{modname}
24 %define _sysconfdir %{_webapps}/%{_webapp}
25 %define _appdir %{_datadir}/%{_webapp}
28 XHProf is a function-level hierarchical profiler for PHP.
30 This package provides the raw data collection component, implemented
31 in C (as a PHP extension).
33 The HTML based navigational interface is provided in the "xhprof"
37 Summary: A Hierarchical Profiler for PHP - Web interface
38 Group: Development/Tools
39 Requires: %{_bindir}/dot
40 Requires: %{name} = %{version}-%{release}
41 Requires: php(core) >= 5.2.0
42 %if "%{_rpmversion}" >= "5"
46 %description -n xhprof
47 XHProf is a function-level hierarchical profiler for PHP and has a
48 simple HTML based navigational interface.
50 The raw data collection component, implemented in C (as a PHP
51 extension, provided by the "php-pecl-xhprof" package).
53 The reporting/UI layer is all in PHP. It is capable of reporting
54 function-level inclusive and exclusive wall times, memory usage, CPU
55 times and number of calls for each function.
57 Additionally, it supports ability to compare two runs (hierarchical
58 DIFF reports), or aggregate results from multiple runs.
60 Documentation: %{_docdir}/%{name}-%{version}/docs/index.html
64 mv %{modname}-%{version}/* .
67 mv xhprof_html/docs docs
77 # simple module load test
79 -d extension_dir=extension/modules \
80 -d extension=%{modname}.so \
82 grep %{modname} modules.log
86 rm -rf $RPM_BUILD_ROOT
87 %{__make} install -C extension \
88 INSTALL_ROOT=$RPM_BUILD_ROOT
90 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
91 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
93 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
94 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
96 # Install the web interface
97 install -d $RPM_BUILD_ROOT%{_sysconfdir}
98 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
100 install -d $RPM_BUILD_ROOT%{_datadir}/xhprof
101 cp -a xhprof_html $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_html
102 cp -a xhprof_lib $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_lib
105 rm -rf $RPM_BUILD_ROOT
108 %php_webserver_restart
111 if [ "$1" = 0 ]; then
112 %php_webserver_restart
115 %triggerin -n xhprof -- apache-base
116 %webapp_register httpd %{_webapp}
118 %triggerun -n xhprof -- apache-base
119 %webapp_unregister httpd %{_webapp}
122 %defattr(644,root,root,755)
123 %doc CHANGELOG CREDITS README LICENSE
124 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
125 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
126 %{_examplesdir}/%{name}-%{version}
129 %defattr(644,root,root,755)
131 %dir %attr(750,root,http) %{_sysconfdir}
132 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf