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