[packages/php-pecl-xhprof] new, version 0.9.3

glen glen at pld-linux.org
Wed May 22 21:52:48 CEST 2013


commit 0859de9311e5821678c909b4c03c599c2ff5c17f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed May 22 22:51:44 2013 +0300

    new, version 0.9.3
    
    based on fedora package
    69c229971359d992b053d868843c584fe61a6688

 apache.conf          |  15 ++++++
 php-pecl-xhprof.spec | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++
 xhprof.ini           |   6 +++
 3 files changed, 151 insertions(+)
---
diff --git a/php-pecl-xhprof.spec b/php-pecl-xhprof.spec
new file mode 100644
index 0000000..b34ba88
--- /dev/null
+++ b/php-pecl-xhprof.spec
@@ -0,0 +1,130 @@
+%define	modname xhprof
+Summary:	PHP extension for XHProf, a Hierarchical Profiler
+Name:		php-pecl-xhprof
+Version:	0.9.3
+Release:	1
+License:	Apache v2.0
+Group:		Development/Languages/PHP
+Source0:	http://pecl.php.net/get/%{modname}-%{version}.tgz
+# Source0-md5:	275f15d2986f3b9c501f1867703f3cec
+Source1:	%{modname}.ini
+Source2:	apache.conf
+URL:		http://pecl.php.net/package/xhprof
+BuildRequires:	php-devel >= 4:5.2.0
+BuildRequires:	rpmbuild(macros) >= 1.519
+%{?requires_php_extension}
+# https://bugs.php.net/61262
+ExclusiveArch:	%{ix86} %{x8664}
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_webapps	/etc/webapps
+%define		_webapp		%{modname}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
+%define		_appdir		%{_datadir}/%{_webapp}
+
+%description
+XHProf is a function-level hierarchical profiler for PHP.
+
+This package provides the raw data collection component, implemented
+in C (as a PHP extension).
+
+The HTML based navigational interface is provided in the "xhprof"
+package.
+
+%package -n xhprof
+Summary:	A Hierarchical Profiler for PHP - Web interface
+Group:		Development/Tools
+Requires:	%{_bindir}/dot
+Requires:	php(core) >= 5.2.0
+Requires:	php-pecl-xhprof = %{version}-%{release}
+%if "%{_rpmversion}" >= "5"
+BuildArch:	noarch
+%endif
+
+%description -n xhprof
+XHProf is a function-level hierarchical profiler for PHP and has a
+simple HTML based navigational interface.
+
+The raw data collection component, implemented in C (as a PHP
+extension, provided by the "php-pecl-xhprof" package).
+
+The reporting/UI layer is all in PHP. It is capable of reporting
+function-level inclusive and exclusive wall times, memory usage, CPU
+times and number of calls for each function.
+
+Additionally, it supports ability to compare two runs (hierarchical
+DIFF reports), or aggregate results from multiple runs.
+
+Documentation: %{_docdir}/%{name}-%{version}/docs/index.html
+
+%prep
+%setup -qc
+mv %{modname}-%{version}/* .
+
+# not to be installed
+mv xhprof_html/docs docs
+
+%build
+cd extension
+phpize
+%configure
+%{__make}
+cd -
+
+%if %{with tests}
+# simple module load test
+%{__php} --no-php-ini \
+	--define extension_dir=extension/modules \
+	--define extension=%{modname}.so \
+	--modules | grep %{modname}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install -C extension \
+	INSTALL_ROOT=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+# Install the web interface
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+
+install -d $RPM_BUILD_ROOT%{_datadir}/xhprof
+cp -a xhprof_html $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_html
+cp -a xhprof_lib  $RPM_BUILD_ROOT%{_datadir}/xhprof/xhprof_lib
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%php_webserver_restart
+
+%postun
+if [ "$1" = 0 ]; then
+	%php_webserver_restart
+fi
+
+%triggerin -n xhprof -- apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -n xhprof -- apache-base
+%webapp_unregister httpd %{_webapp}
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG CREDITS README LICENSE
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{modname}.so
+%{_examplesdir}/%{name}-%{version}
+
+%files -n xhprof
+%defattr(644,root,root,755)
+%doc docs/*
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%{_datadir}/xhprof
diff --git a/apache.conf b/apache.conf
new file mode 100644
index 0000000..f0f30cc
--- /dev/null
+++ b/apache.conf
@@ -0,0 +1,15 @@
+Alias /xhprof /usr/share/xhprof/xhprof_html
+
+<Directory /usr/share/xhprof/xhprof_html>
+	<IfModule mod_authz_core.c>
+		# Apache 2.4
+		Require local
+	</IfModule>
+	<IfModule !mod_authz_core.c>
+		# Apache 2.2
+		Order Deny,Allow
+		Deny from All
+		Allow from 127.0.0.1
+		Allow from ::1
+	</IfModule>
+</Directory>
diff --git a/xhprof.ini b/xhprof.ini
new file mode 100644
index 0000000..9dc60bf
--- /dev/null
+++ b/xhprof.ini
@@ -0,0 +1,6 @@
+; Enable xhprof extension module
+extension = xhprof.so
+
+; You can either pass the directory location as an argument to the constructor
+; for XHProfRuns_Default() or set xhprof.output_dir ini param.
+xhprof.output_dir = /tmp
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-xhprof.git/commitdiff/0859de9311e5821678c909b4c03c599c2ff5c17f



More information about the pld-cvs-commit mailing list