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