]> git.pld-linux.org Git - packages/php-pecl-imagick.git/blob - php-pecl-imagick.spec
use xfail; skip more tests on x32
[packages/php-pecl-imagick.git] / php-pecl-imagick.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname         imagick
7 %define         status          stable
8 Summary:        %{modname} - PHP wrapper to the Image Magick Library
9 Summary(pl.UTF-8):      %{modname} - PHP-owy wrapper do biblioteki Image Magick
10 Name:           %{php_name}-pecl-%{modname}
11 Version:        3.4.2
12 Release:        3
13 License:        PHP 3.01
14 Group:          Development/Languages/PHP
15 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
16 # Source0-md5:  3f80e35c2434636cdb5df01b221b3ffa
17 Patch0:         skip_version_check.patch
18 URL:            http://pecl.php.net/package/imagick/
19 BuildRequires:  %{php_name}-devel >= 4:5.3
20 BuildRequires:  ImageMagick-devel >= 1:6.2.4.0
21 BuildRequires:  pkgconfig
22 BuildRequires:  re2c
23 BuildRequires:  rpmbuild(macros) >= 1.650
24 %if %{with tests}
25 BuildRequires:  %{php_name}-cli
26 BuildRequires:  %{php_name}-pcre
27 BuildRequires:  %{php_name}-spl
28 BuildRequires:  ImageMagick-coder-jpeg
29 BuildRequires:  ImageMagick-coder-png
30 BuildRequires:  ImageMagick-coder-tiff
31 %endif
32 %{?requires_php_extension}
33 Requires(triggerpostun):        sed >= 4.0
34 Requires:       %{php_name}-spl
35 Suggests:       ImageMagick-coder-jpeg
36 Suggests:       ImageMagick-coder-png
37 Suggests:       ImageMagick-coder-tiff
38 Provides:       php(imagick) = %{version}
39 Obsoletes:      php-pecl-imagick < 3.1.2-2
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 ImageMagick is a robust collection of tools and libraries to read,
44 write, and manipulate an image in many image formats (over 68 major
45 formats) including popular formats like TIFF, JPEG, PNG, PDF, PhotoCD,
46 and GIF. With ImageMagick you can create images dynamically, making it
47 suitable for Web applications. You can also resize, rotate, sharpen,
48 color reduce, or add special effects to an image and save your
49 completed work in the same or differing image format.
50
51 In PECL status of this package is: %{status}.
52
53 %description -l pl.UTF-8
54 ImageMagick to duży zestaw narzędzi i bibliotek do odczytu, zapisu i
55 modyfikowania obrazków w wielu formatach (ponad 68 głównych), w tym
56 popularnych, takich jak TIFF, JPEG, PNG, PDF, PhotoCD i GIF. Za pomocą
57 ImageMagick można dynamicznie tworzyć obrazki, co jest przydatne w
58 aplikacjach WWW. Można je także przeskalowywać, obracać, wyostrzać,
59 zmniejszać ilość kolorów - w tym samym lub innym formacie.
60
61 To rozszerzenie ma w PECL status: %{status}.
62
63 %prep
64 %setup -qc
65 mv %{modname}-%{version}/* .
66 %patch0 -p1
67
68 xfail() {
69         t=$1
70         cat >> $t <<-EOF
71
72         --XFAIL--
73         Skip
74         EOF
75 }
76 Test() {
77         nf=$(eval echo \$$#)
78         t=$nf; t=${t#\[}; t=${t%\]}
79         xfail $t
80 }
81 # skip failing tests
82 Test Imagick, annotateImage [tests/034_Imagick_annotateImage_basic.phpt]
83 Test ImagickDraw, composite [tests/177_ImagickDraw_composite_basic.phpt]
84 Test ImagickDraw, setFontSize [tests/206_ImagickDraw_setFontSize_basic.phpt]
85 Test ImagickDraw, setFontFamily [tests/207_ImagickDraw_setFontFamily_basic.phpt]
86 Test ImagickDraw, setFontStretch [tests/208_ImagickDraw_setFontStretch_basic.phpt]
87 Test ImagickDraw, setFontWeight [tests/209_ImagickDraw_setFontWeight_basic.phpt]
88 Test ImagickDraw, setFontStyle [tests/210_ImagickDraw_setFontStyle_basic.phpt]
89 Test ImagickDraw, setGravity [tests/212_ImagickDraw_setGravity_basic.phpt]
90 Test ImagickDraw, setTextAlignment [tests/222_ImagickDraw_setTextAlignment_basic.phpt]
91 Test ImagickDraw, setTextAntialias [tests/223_ImagickDraw_setTextAntialias_basic.phpt]
92 Test ImagickDraw, setTextUnderColor [tests/224_ImagickDraw_setTextUnderColor_basic.phpt]
93 Test ImagickDraw, setTextDecoration [tests/225_ImagickDraw_setTextDecoration_basic.phpt]
94 Test Tutorial, psychedelicFont [tests/241_Tutorial_psychedelicFont_basic.phpt]
95 Test Tutorial, svgExample [tests/243_Tutorial_svgExample_basic.phpt]
96 Test Tutorial, psychedelicFontGif [tests/244_Tutorial_psychedelicFontGif_basic.phpt]
97 %ifarch x32
98 # Fail on 7.0
99 Test Imagick, quantizeImage [tests/101_Imagick_quantizeImage_basic.phpt]
100 Test Imagick, uniqueImageColors [tests/163_Imagick_uniqueImageColors_basic.phpt]
101 Test Tutorial, deconstructGif [tests/237_Tutorial_deconstructGif_basic.phpt]
102 Test ImagickPixelIterator, setIteratorRow [tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt]
103 %endif
104
105 %build
106 phpize
107 %configure \
108         php_cv_cc_dashr=false
109
110 %{__make} \
111         CFLAGS_CLEAN="%{rpmcflags}"
112
113 %if %{with tests}
114 %{__php} -n -q \
115         -d extension_dir=modules \
116         -d extension=%{php_extensiondir}/pcre.so \
117         -d extension=%{php_extensiondir}/spl.so \
118         -d extension=%{modname}.so \
119         -m > modules.log
120 grep %{modname} modules.log
121
122 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
123 %{__make} test \
124         PHP_EXECUTABLE=%{__php} \
125         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl" \
126 %endif
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
131 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
132 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
133 ; Enable %{modname} extension module
134 extension=%{modname}.so
135 EOF
136 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %post
142 %php_webserver_restart
143
144 %postun
145 if [ "$1" = 0 ]; then
146         %php_webserver_restart
147 fi
148
149 %triggerpostun -- %{name} < 0.9.11-2.1
150 %{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*%{modname}\.so/d' %{php_sysconfdir}/php.ini
151
152 %files
153 %defattr(644,root,root,755)
154 %doc CREDITS
155 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
156 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
157 %{_examplesdir}/%{name}-%{version}
This page took 0.074933 seconds and 4 git commands to generate.