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