]> git.pld-linux.org Git - SPECS.git/blob - php-pecl-mcrypt.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / php-pecl-mcrypt.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname mcrypt
7 Summary:        mcrypt extension module for PHP
8 Summary(pl.UTF-8):      Moduł mcrypt dla PHP
9 Name:           %{php_name}-pecl-%{modname}
10 Version:        1.0.3
11 Release:        1
12 License:        PHP 3.01
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
21 %if %{with tests}
22 BuildRequires:  %{php_name}-cli
23 BuildRequires:  %{php_name}-pcre
24 %endif
25 %{?requires_php_extension}
26 Requires:       libmcrypt >= 2.5.6
27 Provides:       php(%{modname}) = %{version}
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 This is a dynamic shared object (DSO) for PHP that will add mcrypt
32 support.
33
34 Warning:
35 - This extension is DEPRECATED since PHP 7.1.0
36
37 Alternatives to this extension include:
38 - Sodium (available as of PHP 7.2.0)
39 - OpenSSL
40
41 %description -l pl.UTF-8
42 Moduł PHP dodający możliwość szyfrowania poprzez bibliotekę mcrypt.
43
44 %prep
45 %setup -qc
46 mv %{modname}-%{version}/* .
47
48 xfail() {
49         local t=$1
50         test -f $t
51         cat >> $t <<-EOF
52
53         --XFAIL--
54         Skip
55         EOF
56 }
57
58 # failed tests. investigate later
59 while read line; do
60         t=${line##*\[}; t=${t%\]}
61         xfail $t
62 done << 'EOF'
63 Test for blowfish compatibility [tests/blowfish.phpt]
64 Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt]
65 EOF
66
67 %build
68 phpize
69 %configure
70 %{__make}
71
72 %if %{with tests}
73 # simple module load test
74 %{__php} -n -q \
75         -d extension_dir=modules \
76         -d extension=%{modname}.so \
77         -m > modules.log
78 grep %{modname} modules.log
79
80 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
81 %{__make} test \
82         PHP_EXECUTABLE=%{__php} \
83         PHP_TEST_SHARED_SYSTEM_EXTENSIONS=""
84 %endif
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 %{__make} install \
89         EXTENSION_DIR=%{php_extensiondir} \
90         INSTALL_ROOT=$RPM_BUILD_ROOT
91
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
96 EOF
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %post
102 %php_webserver_restart
103
104 %postun
105 if [ "$1" = 0 ]; then
106         %php_webserver_restart
107 fi
108
109 %files
110 %defattr(644,root,root,755)
111 %doc LICENSE
112 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
113 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.114215 seconds and 3 git commands to generate.