3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
7 Summary: mcrypt extension module for PHP
8 Summary(pl.UTF-8): Moduł mcrypt dla PHP
9 Name: %{php_name}-pecl-%{modname}
13 Group: Development/Languages/PHP
14 Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
15 # Source0-md5: 0ef94382a4d214b1ed10af8a047a68c7
16 URL: https://php.net/manual/en/book.mcrypt.php
17 %{?with_tests:BuildRequires: %{php_name}-cli}
18 BuildRequires: %{php_name}-devel >= 4:7.2.0
19 BuildRequires: libmcrypt-devel >= 2.5.6
20 BuildRequires: rpmbuild(macros) >= 1.666
22 BuildRequires: %{php_name}-cli
23 BuildRequires: %{php_name}-pcre
25 %{?requires_php_extension}
26 Requires: libmcrypt >= 2.5.6
27 Provides: php(%{modname}) = %{version}
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 This is a dynamic shared object (DSO) for PHP that will add mcrypt
35 - This extension is DEPRECATED since PHP 7.1.0
37 Alternatives to this extension include:
38 - Sodium (available as of PHP 7.2.0)
41 %description -l pl.UTF-8
42 Moduł PHP dodający możliwość szyfrowania poprzez bibliotekę mcrypt.
46 mv %{modname}-%{version}/* .
58 # failed tests. investigate later
60 t=${line##*\[}; t=${t%\]}
63 Test for blowfish compatibility [tests/blowfish.phpt]
64 Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt]
73 # simple module load test
75 -d extension_dir=modules \
76 -d extension=%{modname}.so \
78 grep %{modname} modules.log
80 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
82 PHP_EXECUTABLE=%{__php} \
83 PHP_TEST_SHARED_SYSTEM_EXTENSIONS=""
87 rm -rf $RPM_BUILD_ROOT
89 EXTENSION_DIR=%{php_extensiondir} \
90 INSTALL_ROOT=$RPM_BUILD_ROOT
92 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
93 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
94 ; Enable %{modname} extension module
95 extension=%{modname}.so
99 rm -rf $RPM_BUILD_ROOT
102 %php_webserver_restart
105 if [ "$1" = 0 ]; then
106 %php_webserver_restart
110 %defattr(644,root,root,755)
112 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
113 %attr(755,root,root) %{php_extensiondir}/%{modname}.so