[packages/phpspy] Initial

arekm arekm at pld-linux.org
Tue May 19 13:10:31 CEST 2026


commit 63ec7a59437ff94cd0d8f39ca2426a0c7695a86e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue May 19 13:09:43 2026 +0200

    Initial

 phpspy-makefile.patch |  8 ++++++
 phpspy-shebang.patch  |  8 ++++++
 phpspy.spec           | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 95 insertions(+)
---
diff --git a/phpspy.spec b/phpspy.spec
new file mode 100644
index 0000000..3e09dd0
--- /dev/null
+++ b/phpspy.spec
@@ -0,0 +1,79 @@
+#
+# Conditional build:
+%bcond_with	zend	# build against Zend headers instead of bundled PHP structs
+%bcond_with	tests	# run upstream tests (needs PHP CLI)
+#
+%define		termbox2_commit	915b186bdc94c6a79537dbe1e7479af2d26f5081
+
+Summary:	Low-overhead sampling profiler for PHP
+Summary(pl.UTF-8):	Próbkujący profiler PHP o niskim narzucie
+Name:		phpspy
+Version:	0.7.0
+Release:	1
+License:	MIT
+Group:		Development/Tools
+#Source0Download: https://github.com/adsr/phpspy/releases
+Source0:	https://github.com/adsr/phpspy/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	082780c9f5e186d9e23cf87c6d8cdfb5
+Source1:	https://github.com/termbox/termbox2/archive/%{termbox2_commit}/termbox2-%(echo %{termbox2_commit} | cut -c1-8).tar.gz
+# Source1-md5:	f483831b8cf72aee8dcbb100e19f8a0c
+Patch0:		%{name}-shebang.patch
+Patch1:		%{name}-makefile.patch
+URL:		https://github.com/adsr/phpspy
+%{?with_zend:BuildRequires:	php-devel >= 3:7.0.0}
+BuildRequires:	rpm-build >= 4.6
+BuildRequires:	rpmbuild(macros) >= 1.605
+%if %{with tests}
+BuildRequires:	php-cli >= 3:7.0.0
+%endif
+Requires:	perl-base
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+phpspy is a low-overhead sampling profiler for PHP. It reads remote
+process memory via process_vm_readv(2) and uses ptrace(2) only briefly
+to attach, so the target PHP process keeps running with negligible
+slowdown. Captured stack traces can be fed into Brendan Gregg's
+FlameGraph or other downstream tooling.
+
+%description -l pl.UTF-8
+phpspy to próbkujący profiler PHP o niskim narzucie. Odczytuje pamięć
+zdalnego procesu przez process_vm_readv(2) i używa ptrace(2) tylko
+chwilowo do podłączenia się, dzięki czemu profilowany proces PHP
+działa dalej z pomijalnym spowolnieniem. Zebrane ślady stosu można
+podać do FlameGraph Brendana Gregga lub innych narzędzi.
+
+%prep
+%setup -q -a1
+%{__rm} -r vendor/termbox2
+%{__mv} termbox2-%{termbox2_commit} vendor/termbox2
+%patch -P0 -p1
+%patch -P1 -p1
+
+%build
+%{__make} \
+	CC="%{__cc}" \
+	CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+	LDFLAGS="%{rpmldflags}" \
+	%{?with_zend:USE_ZEND=1}
+
+%if %{with tests}
+%{__make} test
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT \
+	prefix=%{_prefix}
+
+install -p stackcollapse-phpspy.pl $RPM_BUILD_ROOT%{_bindir}/stackcollapse-phpspy.pl
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%attr(755,root,root) %{_bindir}/phpspy
+%attr(755,root,root) %{_bindir}/stackcollapse-phpspy.pl
diff --git a/phpspy-makefile.patch b/phpspy-makefile.patch
new file mode 100644
index 0000000..1837486
--- /dev/null
+++ b/phpspy-makefile.patch
@@ -0,0 +1,8 @@
+--- phpspy-0.7.0/Makefile.orig
++++ phpspy-0.7.0/Makefile
+@@ -64,4 +64,4 @@
+ 	cd vendor/termbox2 && $(MAKE) clean
+ 	rm -f phpspy
+
+-.PHONY: all test install clean phpspy
++.PHONY: all test install clean
diff --git a/phpspy-shebang.patch b/phpspy-shebang.patch
new file mode 100644
index 0000000..f84270b
--- /dev/null
+++ b/phpspy-shebang.patch
@@ -0,0 +1,8 @@
+--- phpspy-0.7.0/stackcollapse-phpspy.pl.orig
++++ phpspy-0.7.0/stackcollapse-phpspy.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env perl
++#!/usr/bin/perl
+ #
+ # stackcolllapse-phpspy.pl  collapse phpspy samples into single lines.
+ #
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/phpspy.git/commitdiff/63ec7a59437ff94cd0d8f39ca2426a0c7695a86e



More information about the pld-cvs-commit mailing list