]> git.pld-linux.org Git - projects/template-specs.git/blame - php-pecl.spec
dokuwiki: add less support info
[projects/template-specs.git] / php-pecl.spec
CommitLineData
fc1df23f
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
9ec83f18 5%define php_name php%{?php_suffix}
abe712a7 6%define modname MODULE_NAME
fc1df23f
ER
7Summary: %{modname} -
8Summary(pl.UTF-8): %{modname} -
9ec83f18 9Name: %{php_name}-pecl-%{modname}
a7223ec4
AG
10Version: 1.0
11Release: 1
4099af7d 12License: PHP 3.01
a7223ec4 13Group: Development/Languages/PHP
fc1df23f 14Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
dc5e1efb 15# Source0-md5: -
abe712a7 16URL: http://pecl.php.net/package/MODULE_NAME/
512c7faf 17%{?with_tests:BuildRequires: %{php_name}-cli}
9ec83f18 18BuildRequires: %{php_name}-devel
3ad11c3e 19BuildRequires: rpmbuild(macros) >= 1.666
672c5afc 20%{?requires_php_extension}
abe712a7 21Provides: php(MODULE_NAME) = %{version}
a7223ec4
AG
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
a7223ec4
AG
24%description
25
9be49f18 26%description -l pl.UTF-8
a7223ec4 27
a7223ec4 28%prep
05e722ff 29%setup -qc
fc1df23f 30mv %{modname}-%{version}/* .
a7223ec4
AG
31
32%build
a7223ec4
AG
33phpize
34%configure
35%{__make}
36
512c7faf
ER
37%if %{with tests}
38# simple module load test
39%{__php} -n -q \
40 -d extension_dir=modules \
41 -d extension=%{modname}.so \
42 -m > modules.log
43grep %{modname} modules.log
44
45export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
46%{__make} test \
47 PHP_EXECUTABLE=%{__php}
023d6644
ER
48
49# or:
50cat <<'EOF' > run-tests.sh
51#!/bin/sh
52export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
53%{__make} test \
54 PHP_EXECUTABLE=%{__php} \
55 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl pdo session" \
56 RUN_TESTS_SETTINGS="-q $*"
57EOF
58
59chmod +x run-tests.sh
60./run-tests.sh -w failed.log
61test -f failed.log -a ! -s failed.log
512c7faf
ER
62%endif
63
a7223ec4
AG
64%install
65rm -rf $RPM_BUILD_ROOT
f6dd55ea 66install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
9c71ffdc
ER
67install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
68install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
a7223ec4 69
852624ea 70%{__make} install \
0ec203b9
ER
71 EXTENSION_DIR=%{php_extensiondir} \
72 INSTALL_ROOT=$RPM_BUILD_ROOT
01c11931
ER
73
74install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
fc1df23f
ER
75cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
76; Enable %{modname} extension module
77extension=%{modname}.so
ceb2ba66 78EOF
a7223ec4 79
68c7fa4c 80install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
9c71ffdc
ER
81cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
82
a7223ec4
AG
83%clean
84rm -rf $RPM_BUILD_ROOT
85
86%post
6e284c47 87%php_webserver_restart
a7223ec4 88
ceb2ba66
AG
89%postun
90if [ "$1" = 0 ]; then
6e284c47 91 %php_webserver_restart
a7223ec4
AG
92fi
93
94%files
95%defattr(644,root,root,755)
f8cfa67b 96%doc CREDITS EXPERIMENTAL
fc1df23f
ER
97%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
98%attr(755,root,root) %{php_extensiondir}/%{modname}.so
9c71ffdc 99%{_examplesdir}/%{name}-%{version}
This page took 2.979632 seconds and 4 git commands to generate.