3 %bcond_without vim # make vim syntax package
5 # build noarch packages only for 7.0 version
6 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "70"
10 %define php_name php%{?php_suffix}
11 %define modname xdebug
12 Summary: %{modname} - provides functions for functions traces and profiling
13 Summary(pl.UTF-8): %{modname} - funkcje do śledzenia i profilowania funkcji
14 Name: %{php_name}-pecl-%{modname}
15 # https://xdebug.org/docs/compat#versions
18 # The Xdebug License, version 1.01
19 # (Based on "The PHP License", version 3.0)
21 Group: Development/Languages/PHP
22 Source0: https://xdebug.org/files/xdebug-%{version}.tgz
23 # Source0-md5: 52891d89de6829fa8dba1132b8c66f75
24 Source1: %{modname}.ini
25 Source2: vim-xt-filetype.vim
26 URL: https://xdebug.org/
27 # Need a PHP version >= 7.2.0 and < 8.2.0
28 BuildRequires: %{php_name}-devel >= 4:7.2.0
29 BuildRequires: %{php_name}-devel < 4:8.2.0
30 BuildRequires: libedit-devel
31 BuildRequires: libtool
32 BuildRequires: rpmbuild(macros) >= 1.650
33 %{?requires_zend_extension}
34 Provides: php(%{modname}) = %{version}
35 Obsoletes: php-pecl-xdebug < 2.2.4-1
36 Conflicts: ZendOptimizer
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 %define _vimdatadir %{_datadir}/vim
42 The Xdebug extension helps you debugging your script by providing a
43 lot of valuable debug information. The debug information that Xdebug
44 can provide includes the following:
46 - stack and function traces in error messages with:
47 - full parameter display for user defined functions
48 - function name, file name and line indications
49 - support for member functions
51 - protection for infinite recursions
55 - profiling information for PHP scripts
56 - code coverage analysis
57 - capabilities to debug your scripts interactively with a debug client
59 %description -l pl.UTF-8
60 Rozszerzenie Xdebug pomaga przy odpluskwianiu skryptu dostarczając
61 dużo wartościowych informacji. Informacje przydatne do śledzenia,
62 które może zapewnić Xdebug, obejmują:
64 - śledzenie stosu i funkcji w komunikatach błędów wraz z:
65 - pełnym wyświetlaniem parametrów dla funkcji zdefiniowanych przez
67 - nazwami funkcji, nazwami plików i numerami linii
69 - przydzielanie pamięci
70 - zabezpieczenie przed nieskończoną rekurencją
72 Xdebug dostarcza także:
74 - informacje do profilowania skryptów PHP
75 - analizę wywołań skryptu
76 - możliwość śledzenia skryptów interaktywnie przy pomocy klienta
79 %package -n vim-syntax-xdebug
80 Summary: Vim syntax: Xdebug trace files
81 Group: Applications/Editors/Vim
82 Requires: vim-rt >= 4:7.2.170
85 %description -n vim-syntax-xdebug
86 This plugin provides syntax highlighting Xdebug trace files (context
93 %{__sed} -e 's#^;zend_extension.*#zend_extension=%{php_extensiondir}/%{modname}.so#' %{SOURCE1} > %{modname}.ini
95 install -d vim/{syntax,ftdetect}
96 mv contrib/xt.vim vim/syntax
97 cp -p %{SOURCE2} vim/ftdetect/xt.vim
105 rm -rf $RPM_BUILD_ROOT
106 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_sysconfdir}/conf.d,%{php_extensiondir}}
108 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
109 %if "%php_major_version.%php_minor_version" >= "7.4"
110 # XDebug should be loaded after opcache
111 cp -a %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/02_%{modname}.ini
113 cp -a %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
118 install -d $RPM_BUILD_ROOT%{_vimdatadir}
119 cp -a vim/* $RPM_BUILD_ROOT%{_vimdatadir}
123 rm -rf $RPM_BUILD_ROOT
126 %php_webserver_restart
129 if [ "$1" = 0 ]; then
130 %php_webserver_restart
134 %defattr(644,root,root,755)
135 %doc README.rst CREDITS contrib
136 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini
137 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
140 %files -n vim-syntax-xdebug
141 %defattr(644,root,root,755)
142 %{_vimdatadir}/ftdetect/xt.vim
143 %{_vimdatadir}/syntax/xt.vim