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
13 Summary: %{modname} - provides functions for functions traces and profiling
14 Summary(pl.UTF-8): %{modname} - funkcje do śledzenia i profilowania funkcji
15 Name: %{php_name}-pecl-%{modname}
16 # https://xdebug.org/docs/compat#versions
18 Release: 0.%{subver}.1
19 # The Xdebug License, version 1.01
20 # (Based on "The PHP License", version 3.0)
22 Group: Development/Languages/PHP
23 Source0: https://xdebug.org/files/xdebug-%{version}%{subver}.tgz
24 # Source0-md5: 0263d908fb81e627faa3e6ba74c69250
25 Source1: %{modname}.ini
26 Source2: vim-xt-filetype.vim
27 URL: https://xdebug.org/
28 # Need a PHP version >= 8.0.0 and < 8.3.0
29 BuildRequires: %{php_name}-devel >= 4:8.0.0
30 BuildRequires: %{php_name}-devel < 4:8.3.0
31 BuildRequires: libedit-devel
32 BuildRequires: libtool
33 BuildRequires: rpmbuild(macros) >= 1.650
34 %{?requires_zend_extension}
35 Provides: php(%{modname}) = %{version}
36 Obsoletes: php-pecl-xdebug < 2.2.4-1
37 Conflicts: ZendOptimizer
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define _vimdatadir %{_datadir}/vim
43 The Xdebug extension helps you debugging your script by providing a
44 lot of valuable debug information. The debug information that Xdebug
45 can provide includes the following:
47 - stack and function traces in error messages with:
48 - full parameter display for user defined functions
49 - function name, file name and line indications
50 - support for member functions
52 - protection for infinite recursions
56 - profiling information for PHP scripts
57 - code coverage analysis
58 - capabilities to debug your scripts interactively with a debug client
60 %description -l pl.UTF-8
61 Rozszerzenie Xdebug pomaga przy odpluskwianiu skryptu dostarczając
62 dużo wartościowych informacji. Informacje przydatne do śledzenia,
63 które może zapewnić Xdebug, obejmują:
65 - śledzenie stosu i funkcji w komunikatach błędów wraz z:
66 - pełnym wyświetlaniem parametrów dla funkcji zdefiniowanych przez
68 - nazwami funkcji, nazwami plików i numerami linii
70 - przydzielanie pamięci
71 - zabezpieczenie przed nieskończoną rekurencją
73 Xdebug dostarcza także:
75 - informacje do profilowania skryptów PHP
76 - analizę wywołań skryptu
77 - możliwość śledzenia skryptów interaktywnie przy pomocy klienta
80 %package -n vim-syntax-xdebug
81 Summary: Vim syntax: Xdebug trace files
82 Group: Applications/Editors/Vim
83 Requires: vim-rt >= 4:7.2.170
86 %description -n vim-syntax-xdebug
87 This plugin provides syntax highlighting Xdebug trace files (context
94 %{__sed} -e 's#^;zend_extension.*#zend_extension=%{php_extensiondir}/%{modname}.so#' %{SOURCE1} > %{modname}.ini
96 install -d vim/{syntax,ftdetect}
97 mv contrib/xt.vim vim/syntax
98 cp -p %{SOURCE2} vim/ftdetect/xt.vim
106 rm -rf $RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_sysconfdir}/conf.d,%{php_extensiondir}}
109 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
110 %if "%php_major_version.%php_minor_version" >= "7.4"
111 # XDebug should be loaded after opcache
112 cp -a %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/02_%{modname}.ini
114 cp -a %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
119 install -d $RPM_BUILD_ROOT%{_vimdatadir}
120 cp -a vim/* $RPM_BUILD_ROOT%{_vimdatadir}
124 rm -rf $RPM_BUILD_ROOT
127 %php_webserver_restart
130 if [ "$1" = 0 ]; then
131 %php_webserver_restart
135 %defattr(644,root,root,755)
136 %doc README.rst CREDITS contrib
137 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini
138 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
141 %files -n vim-syntax-xdebug
142 %defattr(644,root,root,755)
143 %{_vimdatadir}/ftdetect/xt.vim
144 %{_vimdatadir}/syntax/xt.vim