]>
Commit | Line | Data |
---|---|---|
c2426d47 ER |
1 | %define php_name php%{?php_suffix} |
2 | %define modname xhprof | |
0859de93 | 3 | Summary: PHP extension for XHProf, a Hierarchical Profiler |
c2426d47 | 4 | Name: %{php_name}-pecl-xhprof |
8c6e6389 | 5 | Version: 0.9.4 |
6c237923 | 6 | Release: 3 |
0859de93 ER |
7 | License: Apache v2.0 |
8 | Group: Development/Languages/PHP | |
9 | Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz | |
8c6e6389 | 10 | # Source0-md5: ab4062a7337e3bdaa2fd7065a7942b8d |
0859de93 ER |
11 | Source1: %{modname}.ini |
12 | Source2: apache.conf | |
13 | URL: http://pecl.php.net/package/xhprof | |
c2426d47 | 14 | BuildRequires: %{php_name}-devel >= 4:5.2.0 |
62ad4ea7 | 15 | BuildRequires: rpmbuild(macros) >= 1.666 |
0859de93 | 16 | %{?requires_php_extension} |
ad8f59fb | 17 | Provides: php(xhprof) = %{version} |
6c237923 | 18 | Obsoletes: php-pecl-xhprof < 0.9.4-2 |
0859de93 ER |
19 | # https://bugs.php.net/61262 |
20 | ExclusiveArch: %{ix86} %{x8664} | |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | %define _webapps /etc/webapps | |
24 | %define _webapp %{modname} | |
25 | %define _sysconfdir %{_webapps}/%{_webapp} | |
26 | %define _appdir %{_datadir}/%{_webapp} | |
27 | ||
28 | %description | |
29 | XHProf is a function-level hierarchical profiler for PHP. | |
30 | ||
31 | This package provides the raw data collection component, implemented | |
32 | in C (as a PHP extension). | |
33 | ||
34 | The HTML based navigational interface is provided in the "xhprof" | |
35 | package. | |
36 | ||
37 | %package -n xhprof | |
38 | Summary: A Hierarchical Profiler for PHP - Web interface | |
39 | Group: Development/Tools | |
40 | Requires: %{_bindir}/dot | |
ad8f59fb | 41 | Requires: php(core) >= 5.2.0 |
6c237923 | 42 | Requires: php(xhprof) = %{version} |
0859de93 ER |
43 | %if "%{_rpmversion}" >= "5" |
44 | BuildArch: noarch | |
45 | %endif | |
46 | ||
47 | %description -n xhprof | |
48 | XHProf is a function-level hierarchical profiler for PHP and has a | |
49 | simple HTML based navigational interface. | |
50 | ||
51 | The raw data collection component, implemented in C (as a PHP | |
52 | extension, provided by the "php-pecl-xhprof" package). | |
53 | ||
54 | The reporting/UI layer is all in PHP. It is capable of reporting | |
55 | function-level inclusive and exclusive wall times, memory usage, CPU | |
56 | times and number of calls for each function. | |
57 | ||
58 | Additionally, it supports ability to compare two runs (hierarchical | |
59 | DIFF reports), or aggregate results from multiple runs. | |
60 | ||
61 | Documentation: %{_docdir}/%{name}-%{version}/docs/index.html | |
62 | ||
63 | %prep | |
64 | %setup -qc | |
65 | mv %{modname}-%{version}/* . | |
66 | ||
67 | # not to be installed | |
68 | mv xhprof_html/docs docs | |
69 | ||
70 | %build | |
71 | cd extension | |
72 | phpize | |
73 | %configure | |
74 | %{__make} | |
75 | cd - | |
76 | ||
77 | %if %{with tests} | |
78 | # simple module load test | |
62ad4ea7 ER |
79 | %{__php} -n -q \ |
80 | -d extension_dir=extension/modules \ | |
81 | -d extension=%{modname}.so \ | |
82 | -m > modules.log | |
83 | grep %{modname} modules.log | |
0859de93 ER |
84 | %endif |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | %{__make} install -C extension \ | |
89 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
90 | ||
91 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
92 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
93 | ||
94 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
95 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
96 | ||
97 | # Install the web interface | |
98 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
99 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
100 | ||
101 | install -d $RPM_BUILD_ROOT%{_datadir}/xhprof | |
102 | cp -a xhprof_html $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_html | |
103 | cp -a xhprof_lib $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_lib | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %post | |
109 | %php_webserver_restart | |
110 | ||
111 | %postun | |
112 | if [ "$1" = 0 ]; then | |
113 | %php_webserver_restart | |
114 | fi | |
115 | ||
116 | %triggerin -n xhprof -- apache-base | |
117 | %webapp_register httpd %{_webapp} | |
118 | ||
119 | %triggerun -n xhprof -- apache-base | |
120 | %webapp_unregister httpd %{_webapp} | |
121 | ||
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc CHANGELOG CREDITS README LICENSE | |
125 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
126 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so | |
127 | %{_examplesdir}/%{name}-%{version} | |
128 | ||
129 | %files -n xhprof | |
130 | %defattr(644,root,root,755) | |
131 | %doc docs/* | |
132 | %dir %attr(750,root,http) %{_sysconfdir} | |
133 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
134 | %{_datadir}/xhprof |