]> git.pld-linux.org Git - projects/template-specs.git/blame - php-pecl.spec
add tests
[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}
fc1df23f
ER
6%define modname -
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: -
9ec83f18 16URL: http://pecl.php.net/package/modname/
512c7faf 17%{?with_tests:BuildRequires: %{php_name}-cli}
9ec83f18 18BuildRequires: %{php_name}-devel
3ad11c3e 19BuildRequires: rpmbuild(macros) >= 1.666
672c5afc 20%{?requires_php_extension}
a7223ec4
AG
21BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
a7223ec4
AG
23%description
24
9be49f18 25%description -l pl.UTF-8
a7223ec4 26
a7223ec4 27%prep
05e722ff 28%setup -qc
fc1df23f 29mv %{modname}-%{version}/* .
a7223ec4
AG
30
31%build
a7223ec4
AG
32phpize
33%configure
34%{__make}
35
512c7faf
ER
36%if %{with tests}
37# simple module load test
38%{__php} -n -q \
39 -d extension_dir=modules \
40 -d extension=%{modname}.so \
41 -m > modules.log
42grep %{modname} modules.log
43
44export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
45%{__make} test \
46 PHP_EXECUTABLE=%{__php}
47%endif
48
a7223ec4
AG
49%install
50rm -rf $RPM_BUILD_ROOT
f6dd55ea 51install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
9c71ffdc
ER
52install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
53install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
a7223ec4 54
852624ea 55%{__make} install \
0ec203b9
ER
56 EXTENSION_DIR=%{php_extensiondir} \
57 INSTALL_ROOT=$RPM_BUILD_ROOT
01c11931
ER
58
59install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
fc1df23f
ER
60cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
61; Enable %{modname} extension module
62extension=%{modname}.so
ceb2ba66 63EOF
a7223ec4 64
68c7fa4c 65install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
9c71ffdc
ER
66cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
67
a7223ec4
AG
68%clean
69rm -rf $RPM_BUILD_ROOT
70
71%post
6e284c47 72%php_webserver_restart
a7223ec4 73
ceb2ba66
AG
74%postun
75if [ "$1" = 0 ]; then
6e284c47 76 %php_webserver_restart
a7223ec4
AG
77fi
78
79%files
80%defattr(644,root,root,755)
f8cfa67b 81%doc CREDITS EXPERIMENTAL
fc1df23f
ER
82%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
83%attr(755,root,root) %{php_extensiondir}/%{modname}.so
9c71ffdc 84%{_examplesdir}/%{name}-%{version}
This page took 0.240727 seconds and 4 git commands to generate.