]> git.pld-linux.org Git - packages/php-pecl-imagick.git/blob - php-pecl-imagick.spec
ce2c2a11e43362a519b30780c617e5eeaa091101
[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 %define         libversion      %(pkg-config --modversion MagickCore 2>/dev/null || echo ERROR)
9 Summary:        %{modname} - PHP wrapper to the Image Magick Library
10 Summary(pl.UTF-8):      %{modname} - PHP-owy wrapper do biblioteki Image Magick
11 Name:           %{php_name}-pecl-%{modname}
12 Version:        3.7.0
13 Release:        1
14 License:        PHP 3.01
15 Group:          Development/Languages/PHP
16 Source0:        https://pecl.php.net/get/%{modname}-%{version}.tgz
17 # Source0-md5:  0687774a6126467d4e5ede02171e981d
18 Patch0:         skip_version_check.patch
19 URL:            https://pecl.php.net/package/imagick
20 BuildRequires:  %{php_name}-cli
21 BuildRequires:  %{php_name}-devel >= 4:5.3
22 BuildRequires:  %{php_name}-pcre
23 BuildRequires:  %{php_name}-spl
24 BuildRequires:  ImageMagick-devel >= 1:6.2.4.0
25 BuildRequires:  pkgconfig
26 BuildRequires:  re2c
27 BuildRequires:  rpmbuild(macros) >= 1.650
28 %if %{with tests}
29 BuildRequires:  ImageMagick-coder-jpeg
30 BuildRequires:  ImageMagick-coder-png
31 BuildRequires:  ImageMagick-coder-tiff
32 %endif
33 %{?requires_php_extension}
34 Requires(postun):       sed >= 4.0
35 Requires:       %{php_name}-spl
36 Suggests:       ImageMagick-coder-jpeg
37 Suggests:       ImageMagick-coder-png
38 Suggests:       ImageMagick-coder-tiff
39 Provides:       php(imagick) = %{version}
40 Provides:       php(lib-imagick) = %{libversion}
41 Obsoletes:      php-pecl-imagick < 3.1.2-2
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
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
53 In PECL status of this package is: %{status}.
54
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.
62
63 To rozszerzenie ma w PECL status: %{status}.
64
65 %prep
66 %setup -qc
67 mv %{modname}-%{version}/* .
68 %patch0 -p1
69
70 xfail() {
71         local t=$1
72         test -f $t
73         cat >> $t <<-EOF
74
75         --XFAIL--
76         Skip
77         EOF
78 }
79
80 while read line; do
81         t=${line##*\[}; t=${t%\]}
82         test -z "$t" -o "${t:0:1}" = '#' && continue
83         xfail $t
84 done << 'EOF'
85
86 # skip failing tests
87 Test Imagick, annotateImage [tests/034_Imagick_annotateImage_basic.phpt]
88 Test Imagick, setRegistry and getRegistry [tests/150_Imagick_setregistry.phpt]
89 Test ImagickDraw, composite [tests/177_ImagickDraw_composite_basic.phpt]
90 Test ImagickDraw, setFontSize [tests/206_ImagickDraw_setFontSize_basic.phpt]
91 Test ImagickDraw, setFontFamily [tests/207_ImagickDraw_setFontFamily_basic.phpt]
92 Test ImagickDraw, setFontStretch [tests/208_ImagickDraw_setFontStretch_basic.phpt]
93 Test ImagickDraw, setFontWeight [tests/209_ImagickDraw_setFontWeight_basic.phpt]
94 Test ImagickDraw, setFontStyle [tests/210_ImagickDraw_setFontStyle_basic.phpt]
95 Test ImagickDraw, setGravity [tests/212_ImagickDraw_setGravity_basic.phpt]
96 Test ImagickDraw, setTextAlignment [tests/222_ImagickDraw_setTextAlignment_basic.phpt]
97 Test ImagickDraw, setTextAntialias [tests/223_ImagickDraw_setTextAntialias_basic.phpt]
98 Test ImagickDraw, setTextUnderColor [tests/224_ImagickDraw_setTextUnderColor_basic.phpt]
99 Test ImagickDraw, setTextDecoration [tests/225_ImagickDraw_setTextDecoration_basic.phpt]
100 Test Tutorial, psychedelicFont [tests/241_Tutorial_psychedelicFont_basic.phpt]
101 Test Tutorial, svgExample [tests/243_Tutorial_svgExample_basic.phpt]
102 Test Tutorial, psychedelicFontGif [tests/244_Tutorial_psychedelicFontGif_basic.phpt]
103 Test Imagick, Imagick::exportImagePixels [tests/256_Imagick_exportImagePixels_basic.phpt]
104 Test ImagickDraw, getTextDirection [tests/264_ImagickDraw_getTextDirection_basic.phpt]
105 Test ImagickDraw, getFontResolution [tests/266_ImagickDraw_getFontResolution_basic.phpt]
106 %ifarch x32
107 # Fail on 7.0
108 Test Imagick, quantizeImage [tests/101_Imagick_quantizeImage_basic.phpt]
109 Test Imagick, uniqueImageColors [tests/163_Imagick_uniqueImageColors_basic.phpt]
110 Test Tutorial, deconstructGif [tests/237_Tutorial_deconstructGif_basic.phpt]
111 Test ImagickPixelIterator, setIteratorRow [tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt]
112 %endif
113 # Fail on 5.3, 5.5, 5.6, 7.0, 7.1, 7.2
114 Test Tutorial, fxAnalyzeImage [tests/229_Tutorial_fxAnalyzeImage_case1.phpt]
115
116 # 5.3, 5.5, 5.6, 7.0/x32, 7.1, 7.2, 7.3, 7.4
117 ImagickKernel::fromMatrix exceptions [tests/280_imagickkernel_exception_invalid_origin.phpt]
118 Imagick::setImageAlpha [tests/274_imagick_setImageAlpha.phpt]
119 Test ImagickDraw:: setTextInterlineSpacing [tests/279_ImagickDraw_setTextInterlineSpacing.phpt]
120 Test Imagick::optimizeimagelayers and Imagick::optimizeimagetransparency [tests/278_Imagick_optimaze_gif.phpt]
121
122 # php73/x32
123 Test PHP bug #59378 writing to php://memory is incomplete [tests/bug59378.phpt]
124
125 # php 7.4, 8.0
126 %if "%php_major_version.%php_minor_version" == "7.4"
127 Casting color and opacity to pixel [tests/003_cast_color_opacity.phpt]
128 Different types of thumbnailing [tests/002_thumbnail.phpt]
129 ImagickKernel::fromMatrix test [tests/145_imagickkernel_coverage.phpt]
130 Imagick::resizeImage prevent 0 width/height images [tests/github_174.phpt]
131 Test autoGammaImage [tests/263_autoGammaImage.phpt]
132 Test compositeImageGravity [tests/261_compositeImageGravity.phpt]
133 Test cropthumbnail [tests/006_cropthumbnail.phpt]
134 Test filling thumbnail with color [tests/007_thumbnail_fill.phpt]
135 Test for round issues [tests/064_cropThumbNailImage.phpt]
136 Test Imagick::colorDecisionListImage [tests/277_Imagick_colorDecisionListImage.phpt]
137 Test Imagick, progressMonitor [tests/127_Imagick_progressMonitor_basic.phpt]
138 Test importimagepixels [tests/010_importimagepixels.phpt]
139 Testing clone keyword [tests/004_clone.phpt]
140 Testing that cloned object does not affect the original [tests/012-clone-separation.phpt]
141 Test thumbnail bestfit [tests/005_bestfit.phpt]
142 %ifarch x32 %{ix86}
143 Test localContrastImage [tests/260_localContrastImage.phpt]
144 %endif
145 %endif
146 EOF
147
148 %build
149 phpize
150 %configure \
151         php_cv_cc_dashr=false
152
153 %{__make} \
154         CFLAGS_CLEAN="%{rpmcflags}"
155
156 %{__php} -n -q \
157         -d extension_dir=modules \
158 %if "%php_major_version.%php_minor_version" < "7.4"
159         -d extension=%{php_extensiondir}/pcre.so \
160         -d extension=%{php_extensiondir}/spl.so \
161 %endif
162         -d extension=%{modname}.so \
163         -m > modules.log
164 grep %{modname} modules.log
165
166 %if %{with tests}
167 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
168 %{__make} test \
169         PHP_EXECUTABLE=%{__php} \
170 %if "%php_major_version.%php_minor_version" < "7.4"
171         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl" \
172 %endif
173 %endif
174
175 %install
176 rm -rf $RPM_BUILD_ROOT
177 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
178 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
179 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
180 ; Enable %{modname} extension module
181 extension=%{modname}.so
182 EOF
183 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
184
185 %clean
186 rm -rf $RPM_BUILD_ROOT
187
188 %post
189 %php_webserver_restart
190
191 %postun
192 if [ "$1" = 0 ]; then
193         %php_webserver_restart
194 fi
195
196 %triggerpostun -- %{name} < 0.9.11-2.1
197 %{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*%{modname}\.so/d' %{php_sysconfdir}/php.ini
198
199 %files
200 %defattr(644,root,root,755)
201 %doc CREDITS
202 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
203 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
204 %{_examplesdir}/%{name}-%{version}
This page took 0.335759 seconds and 2 git commands to generate.