]> git.pld-linux.org Git - projects/template-specs.git/blob - php-pecl.spec
dokuwiki-plugin.spec: Fix packaging languages with rpm 4.12
[projects/template-specs.git] / php-pecl.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname MODULE_NAME
7 Summary:        %{modname} -
8 Summary(pl.UTF-8):      %{modname} -
9 Name:           %{php_name}-pecl-%{modname}
10 Version:        1.0
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:  -
16 URL:            https://pecl.php.net/package/MODULE_NAME/
17 BuildRequires:  %{php_name}-cli
18 BuildRequires:  %{php_name}-devel
19 BuildRequires:  rpmbuild(macros) >= 1.666
20 %if %{with tests}
21 BuildRequires:  %{php_name}-pcre
22 %endif
23 %{?requires_php_extension}
24 Requires:       %{php_name}-spl
25 Provides:       php(%{modname}) = %{version}
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29
30 %description -l pl.UTF-8
31
32 %prep
33 %setup -qc
34 mv %{modname}-%{version}/* .
35
36 cat <<'EOF' > run-tests.sh
37 #!/bin/sh
38 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
39 exec %{__make} test \
40         PHP_EXECUTABLE=%{__php} \
41         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl pdo session" \
42         RUN_TESTS_SETTINGS="-q $*"
43 EOF
44 chmod +x run-tests.sh
45
46 xfail() {
47         local t=$1
48         test -f $t
49         cat >> $t <<-EOF
50
51         --XFAIL--
52         Skip
53         EOF
54 }
55
56 while read line; do
57         t=${line##*\[}; t=${t%\]}
58         xfail $t
59 done << 'EOF'
60 Test for blowfish compatibility [tests/blowfish.phpt]
61 Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt]
62 EOF
63
64 %build
65 phpize
66 %configure
67 %{__make}
68
69 # simple module load test
70 %{__php} -n -q \
71         -d extension_dir=modules \
72         -d extension=%{php_extensiondir}/spl.so \
73         -d extension=%{modname}.so \
74         -m > modules.log
75 grep %{modname} modules.log
76
77 %if %{with tests}
78 ./run-tests.sh --show-diff
79 %endif
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
84 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
85 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
86
87 %{__make} install \
88         EXTENSION_DIR=%{php_extensiondir} \
89         INSTALL_ROOT=$RPM_BUILD_ROOT
90
91 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
92 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
93 ; Enable %{modname} extension module
94 extension=%{modname}.so
95 EOF
96
97 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
98 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %post
104 %php_webserver_restart
105
106 %postun
107 if [ "$1" = 0 ]; then
108         %php_webserver_restart
109 fi
110
111 %files
112 %defattr(644,root,root,755)
113 %doc CREDITS EXPERIMENTAL
114 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
115 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
116 %{_examplesdir}/%{name}-%{version}
This page took 0.096089 seconds and 4 git commands to generate.