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