]> git.pld-linux.org Git - projects/template-specs.git/blame_incremental - php-pecl.spec
- unified -devel description
[projects/template-specs.git] / php-pecl.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
5%define php_name php%{?php_suffix}
6%define modname MODULE_NAME
7Summary: %{modname} -
8Summary(pl.UTF-8): %{modname} -
9Name: %{php_name}-pecl-%{modname}
10Version: 1.0
11Release: 1
12License: PHP 3.01
13Group: Development/Languages/PHP
14Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
15# Source0-md5: -
16URL: https://pecl.php.net/package/MODULE_NAME/
17BuildRequires: %{php_name}-cli
18BuildRequires: %{php_name}-devel
19BuildRequires: rpmbuild(macros) >= 1.666
20%if %{with tests}
21BuildRequires: %{php_name}-pcre
22%endif
23%{?requires_php_extension}
24Requires: %{php_name}-spl
25Provides: php(%{modname}) = %{version}
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%description
29
30%description -l pl.UTF-8
31
32%prep
33%setup -qc
34mv %{modname}-%{version}/* .
35
36cat <<'EOF' > run-tests.sh
37#!/bin/sh
38export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
39exec %{__make} test \
40 PHP_EXECUTABLE=%{__php} \
41 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl pdo session" \
42 RUN_TESTS_SETTINGS="-q $*"
43EOF
44chmod +x run-tests.sh
45
46xfail() {
47 local t=$1
48 test -f $t
49 cat >> $t <<-EOF
50
51 --XFAIL--
52 Skip
53 EOF
54}
55
56while read line; do
57 t=${line##*\[}; t=${t%\]}
58 xfail $t
59done << 'EOF'
60Test for blowfish compatibility [tests/blowfish.phpt]
61Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt]
62EOF
63
64%build
65phpize
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
75grep %{modname} modules.log
76
77%if %{with tests}
78./run-tests.sh --show-diff
79%endif
80
81%install
82rm -rf $RPM_BUILD_ROOT
83install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
84install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
85install -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
91install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
92cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
93; Enable %{modname} extension module
94extension=%{modname}.so
95EOF
96
97install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
98cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99
100%clean
101rm -rf $RPM_BUILD_ROOT
102
103%post
104%php_webserver_restart
105
106%postun
107if [ "$1" = 0 ]; then
108 %php_webserver_restart
109fi
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.02741 seconds and 4 git commands to generate.