3 %bcond_without web # make web package
5 # build web package with php 7.4
6 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "74"
10 %define php_name php%{?php_suffix}
11 %define modname xhprof
12 Summary: PHP extension for XHProf, a Hierarchical Profiler
13 Name: %{php_name}-pecl-xhprof
17 Group: Development/Languages/PHP
18 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
19 # Source0-md5: fc6f5dd8f73b7814d70e86c2184532b4
20 Source1: %{modname}.ini
22 URL: http://pecl.php.net/package/xhprof
23 BuildRequires: %{php_name}-devel >= 4:5.2.0
24 BuildRequires: rpmbuild(macros) >= 1.666
25 %{?requires_php_extension}
26 Provides: php(xhprof) = %{version}
27 Obsoletes: php-pecl-xhprof < 0.9.4-2
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _webapps /etc/webapps
31 %define _webapp %{modname}
32 %define _sysconfdir %{_webapps}/%{_webapp}
33 %define _appdir %{_datadir}/%{_webapp}
36 XHProf is a function-level hierarchical profiler for PHP.
38 This package provides the raw data collection component, implemented
39 in C (as a PHP extension).
41 The HTML based navigational interface is provided in the "xhprof"
45 Summary: A Hierarchical Profiler for PHP - Web interface
46 Group: Development/Tools
47 Requires: %{_bindir}/dot
48 Requires: php(core) >= 5.2.0
49 Requires: php(xhprof) = %{version}
50 %if "%{_rpmversion}" >= "5"
54 %description -n xhprof
55 XHProf is a function-level hierarchical profiler for PHP and has a
56 simple HTML based navigational interface.
58 The raw data collection component, implemented in C (as a PHP
59 extension, provided by the "php-pecl-xhprof" package).
61 The reporting/UI layer is all in PHP. It is capable of reporting
62 function-level inclusive and exclusive wall times, memory usage, CPU
63 times and number of calls for each function.
65 Additionally, it supports ability to compare two runs (hierarchical
66 DIFF reports), or aggregate results from multiple runs.
68 Documentation: %{_docdir}/%{name}-%{version}/docs/index.html
72 mv %{modname}-%{version}/* .
75 mv xhprof_html/docs docs
85 # simple module load test
87 -d extension_dir=extension/modules \
88 -d extension=%{modname}.so \
90 grep %{modname} modules.log
94 rm -rf $RPM_BUILD_ROOT
95 %{__make} install -C extension \
96 INSTALL_ROOT=$RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
99 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
101 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
102 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
104 # Install the web interface
106 install -d $RPM_BUILD_ROOT%{_sysconfdir}
107 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
109 install -d $RPM_BUILD_ROOT%{_datadir}/xhprof
110 cp -a xhprof_html $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_html
111 cp -a xhprof_lib $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_lib
115 rm -rf $RPM_BUILD_ROOT
118 %php_webserver_restart
121 if [ "$1" = 0 ]; then
122 %php_webserver_restart
125 %triggerin -n xhprof -- apache-base
126 %webapp_register httpd %{_webapp}
128 %triggerun -n xhprof -- apache-base
129 %webapp_unregister httpd %{_webapp}
132 %defattr(644,root,root,755)
133 %doc CHANGELOG CREDITS README.md LICENSE
134 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
135 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
136 %{_examplesdir}/%{name}-%{version}
140 %defattr(644,root,root,755)
142 %dir %attr(750,root,http) %{_sysconfdir}
143 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf