]> git.pld-linux.org Git - packages/php-pecl-uopz.git/blob - php-pecl-uopz.spec
up to 5.0.2; requires php7
[packages/php-pecl-uopz.git] / php-pecl-uopz.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname uopz
7 Summary:        User Operations for Zend
8 Name:           %{php_name}-pecl-%{modname}
9 Version:        5.0.2
10 Release:        1
11 License:        PHP 3.01
12 Group:          Development/Languages/PHP
13 Source0:        https://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5:  017d5b778e404fd5c324552c83b84b60
15 URL:            https://pecl.php.net/package/uopz
16 %{?with_tests:BuildRequires:    %{php_name}-cli}
17 BuildRequires:  %{php_name}-devel >= 4:7.0.0
18 BuildRequires:  rpmbuild(macros) >= 1.666
19 %if %{with tests}
20 BuildRequires:  %{php_name}-cli
21 BuildRequires:  %{php_name}-pcre
22 BuildRequires:  %{php_name}-session
23 BuildRequires:  %{php_name}-spl
24 %endif
25 %{?requires_php_extension}
26 Provides:       php(uopz) = %{version}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 The uopz extension exposes Zend engine functionality normally used at
31 compilation and execution time in order to allow modification of the
32 internal structures that represent PHP code.
33
34 It supports the following activities:
35 - Overloading some Zend opcodes including exit/new and composure
36   opcodes
37 - Renaming functions and methods
38 - Deletion of functions and methods
39 - Copying of functions and methods
40 - Redefinition of constants
41 - Deletion of constants
42 - Runtime composition and modification of classes
43
44 Note: All of the above activities are compatible with opcache,
45 including overloading ZEND_EXIT
46
47 %prep
48 %setup -qc
49 mv %{modname}-%{version}/* .
50
51 %build
52 phpize
53 %configure
54 %{__make}
55
56 %if %{with tests}
57 # simple module load test
58 %{__php} -n -q \
59         -d extension_dir=modules \
60         -d extension=%{modname}.so \
61         -m > modules.log
62 grep %{modname} modules.log
63
64 cat <<'EOF' > run-tests.sh
65 #!/bin/sh
66 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
67 %{__make} test \
68         PHP_EXECUTABLE=%{__php} \
69         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
70         RUN_TESTS_SETTINGS="-q $*"
71 EOF
72
73 chmod +x run-tests.sh
74 ./run-tests.sh -w failed.log
75 test -f failed.log -a ! -s failed.log
76 %endif
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 %{__make} install \
81         EXTENSION_DIR=%{php_extensiondir} \
82         INSTALL_ROOT=$RPM_BUILD_ROOT
83
84 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
85 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
86 ; Enable %{modname} extension module
87 extension=%{modname}.so
88 EOF
89
90 %clean
91 rm -rf $RPM_BUILD_ROOT
92
93 %post
94 %php_webserver_restart
95
96 %postun
97 if [ "$1" = 0 ]; then
98         %php_webserver_restart
99 fi
100
101 %files
102 %defattr(644,root,root,755)
103 %doc README.md LICENSE
104 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
105 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.09682 seconds and 3 git commands to generate.