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