]> git.pld-linux.org Git - packages/php-pecl-archive.git/blob - php-pecl-archive.spec
run project tests
[packages/php-pecl-archive.git] / php-pecl-archive.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname         archive
7 %define         status          beta
8 Summary:        %{modname} - manipulate tar/cpio archives
9 Summary(pl.UTF-8):      %{modname} - obróbka archiwów tar/cpio
10 Name:           %{php_name}-pecl-%{modname}
11 Version:        0.3.1
12 Release:        1
13 License:        PHP 3.01
14 Group:          Development/Languages/PHP
15 Source0:        http://pecl.php.net/get/%{modname}-0.2.tgz
16 # Source0-md5:  1b121440b2c460b2a1af46e31f23e46e
17 Patch100:       branch.diff
18 URL:            http://pecl.php.net/package/archive/
19 BuildRequires:  %{php_name}-devel >= 3:5.0.4
20 BuildRequires:  libarchive-devel
21 BuildRequires:  rpmbuild(macros) >= 1.650
22 %{?with_tests:BuildRequires:    %{php_name}-cli}
23 %{?requires_php_extension}
24 Provides:       php(%{modname}) = %{version}
25 Obsoletes:      php-pecl-archive < 0.2-17
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 archive extension allows to read and write tar and cpio archives using
30 libarchive.
31
32 In PECL status of this extension is: %{status}.
33
34 %description -l pl.UTF-8
35 Rozszerzenie archive pozwala na odczyt i zapis archiwów tar oraz cpio
36 przy użyciu biblioteki libarchive.
37
38 To rozszerzenie ma w PECL status: %{status}.
39
40 %prep
41 %setup -qc
42 mv %{modname}-*/* .
43 %patch100 -p1
44
45 # these segfault
46 rm tests/add_bz2/001.phpt
47 rm tests/add_gz/001.phpt
48
49 # print_r of exception object differs in php 5.5
50 rm tests/list_gz/001.phpt
51 rm tests/list/001.phpt
52 rm tests/list_bz2/001.phpt
53
54 %build
55 phpize
56 %configure
57 %{__make}
58
59 %if %{with tests}
60 # simple module load test
61 %{__php} -n \
62         -dextension_dir=modules \
63         -dextension=%{modname}.so \
64         -m > modules.log
65 grep %{modname} modules.log
66
67 cat <<'EOF' > run-tests.sh
68 #!/bin/sh
69 %{__make} test \
70         PHP_EXECUTABLE=%{__php} \
71         RUN_TESTS_SETTINGS="-q $*"
72 EOF
73
74 chmod +x run-tests.sh
75 ./run-tests.sh -w failed.log --show-out
76 test -f failed.log -a ! -s failed.log
77 %endif
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
82 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
83 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
84 ; Enable %{modname} extension module
85 extension=%{modname}.so
86 EOF
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %post
92 %php_webserver_restart
93
94 %postun
95 if [ "$1" = 0 ]; then
96         %php_webserver_restart
97 fi
98
99 %files
100 %defattr(644,root,root,755)
101 %doc API.txt CREDITS tests
102 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
103 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.029281 seconds and 3 git commands to generate.