]> git.pld-linux.org Git - packages/php-pecl-imagick.git/blame - php-pecl-imagick.spec
Rel 4
[packages/php-pecl-imagick.git] / php-pecl-imagick.spec
CommitLineData
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
90d6d7a5 8%define libversion %(pkg-config --modversion MagickCore 2>/dev/null || echo ERROR)
c3cb436b
ER
9Summary: %{modname} - PHP wrapper to the Image Magick Library
10Summary(pl.UTF-8): %{modname} - PHP-owy wrapper do biblioteki Image Magick
77bd0b10 11Name: %{php_name}-pecl-%{modname}
6b38fc7d 12Version: 3.7.0
11a59729 13Release: 4
80c4878b 14License: PHP 3.01
7ef11872 15Group: Development/Languages/PHP
4f00096b 16Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
6b38fc7d 17# Source0-md5: 0687774a6126467d4e5ede02171e981d
4baa9e02 18Patch0: skip_version_check.patch
4f00096b 19URL: https://pecl.php.net/package/imagick
76282008 20BuildRequires: %{php_name}-cli
4c078d1b 21BuildRequires: %{php_name}-devel >= 4:5.3
76282008
ER
22BuildRequires: %{php_name}-pcre
23BuildRequires: %{php_name}-spl
30d818b5 24BuildRequires: ImageMagick-devel >= 1:6.2.4.0
58592d83
ER
25BuildRequires: pkgconfig
26BuildRequires: re2c
696a2b4e 27BuildRequires: rpmbuild(macros) >= 1.650
a70f8547 28%if %{with tests}
4dc1d668
ER
29BuildRequires: ImageMagick-coder-jpeg
30BuildRequires: ImageMagick-coder-png
31BuildRequires: ImageMagick-coder-tiff
a70f8547 32%endif
dbfce4b3 33%{?requires_php_extension}
671f1772 34Requires(postun): sed >= 4.0
b65e8485 35Requires: %{php_name}-spl
6e32b6ae
ER
36Suggests: ImageMagick-coder-jpeg
37Suggests: ImageMagick-coder-png
38Suggests: ImageMagick-coder-tiff
ee3b6a5c 39Provides: php(imagick) = %{version}
4f00096b 40Provides: php(lib-imagick) = %{libversion}
c056a9a3 41Obsoletes: php-pecl-imagick < 3.1.2-2
7ef11872 42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
7ef11872 44%description
45ImageMagick is a robust collection of tools and libraries to read,
46write, and manipulate an image in many image formats (over 68 major
47formats) including popular formats like TIFF, JPEG, PNG, PDF, PhotoCD,
48and GIF. With ImageMagick you can create images dynamically, making it
49suitable for Web applications. You can also resize, rotate, sharpen,
50color reduce, or add special effects to an image and save your
51completed work in the same or differing image format.
52
c3cb436b 53In PECL status of this package is: %{status}.
3fd56945 54
98a194af
JR
55%description -l pl.UTF-8
56ImageMagick to duży zestaw narzędzi i bibliotek do odczytu, zapisu i
57modyfikowania obrazków w wielu formatach (ponad 68 głównych), w tym
58popularnych, takich jak TIFF, JPEG, PNG, PDF, PhotoCD i GIF. Za pomocą
59ImageMagick można dynamicznie tworzyć obrazki, co jest przydatne w
60aplikacjach WWW. Można je także przeskalowywać, obracać, wyostrzać,
61zmniejszać ilość kolorów - w tym samym lub innym formacie.
7ef11872 62
c3cb436b 63To rozszerzenie ma w PECL status: %{status}.
3fd56945 64
7ef11872 65%prep
4baa9e02 66%setup -qc
2f0fc694 67mv %{modname}-%{version}/* .
4baa9e02 68%patch0 -p1
7ef11872 69
b49484d9 70xfail() {
96575c7e
ER
71 local t=$1
72 test -f $t
b49484d9
ER
73 cat >> $t <<-EOF
74
75 --XFAIL--
76 Skip
77 EOF
78}
96575c7e
ER
79
80while read line; do
81 t=${line##*\[}; t=${t%\]}
1385708a
JB
82 test -z "$t" && continue
83 case "$t" in
84 '#'*) continue;;
85 esac
b49484d9 86 xfail $t
96575c7e
ER
87done << 'EOF'
88
b49484d9 89# skip failing tests
f5c1a0f1 90Test Imagick, annotateImage [tests/034_Imagick_annotateImage_basic.phpt]
5f8da6bd 91Test Imagick, setRegistry and getRegistry [tests/150_Imagick_setregistry.phpt]
f5c1a0f1
ER
92Test ImagickDraw, composite [tests/177_ImagickDraw_composite_basic.phpt]
93Test ImagickDraw, setFontSize [tests/206_ImagickDraw_setFontSize_basic.phpt]
94Test ImagickDraw, setFontFamily [tests/207_ImagickDraw_setFontFamily_basic.phpt]
95Test ImagickDraw, setFontStretch [tests/208_ImagickDraw_setFontStretch_basic.phpt]
96Test ImagickDraw, setFontWeight [tests/209_ImagickDraw_setFontWeight_basic.phpt]
97Test ImagickDraw, setFontStyle [tests/210_ImagickDraw_setFontStyle_basic.phpt]
98Test ImagickDraw, setGravity [tests/212_ImagickDraw_setGravity_basic.phpt]
99Test ImagickDraw, setTextAlignment [tests/222_ImagickDraw_setTextAlignment_basic.phpt]
100Test ImagickDraw, setTextAntialias [tests/223_ImagickDraw_setTextAntialias_basic.phpt]
101Test ImagickDraw, setTextUnderColor [tests/224_ImagickDraw_setTextUnderColor_basic.phpt]
102Test ImagickDraw, setTextDecoration [tests/225_ImagickDraw_setTextDecoration_basic.phpt]
103Test Tutorial, psychedelicFont [tests/241_Tutorial_psychedelicFont_basic.phpt]
104Test Tutorial, svgExample [tests/243_Tutorial_svgExample_basic.phpt]
105Test Tutorial, psychedelicFontGif [tests/244_Tutorial_psychedelicFontGif_basic.phpt]
59b48731
JR
106Test Imagick, Imagick::exportImagePixels [tests/256_Imagick_exportImagePixels_basic.phpt]
107Test ImagickDraw, getTextDirection [tests/264_ImagickDraw_getTextDirection_basic.phpt]
108Test ImagickDraw, getFontResolution [tests/266_ImagickDraw_getFontResolution_basic.phpt]
b49484d9
ER
109%ifarch x32
110# Fail on 7.0
111Test Imagick, quantizeImage [tests/101_Imagick_quantizeImage_basic.phpt]
112Test Imagick, uniqueImageColors [tests/163_Imagick_uniqueImageColors_basic.phpt]
113Test Tutorial, deconstructGif [tests/237_Tutorial_deconstructGif_basic.phpt]
114Test ImagickPixelIterator, setIteratorRow [tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt]
115%endif
fa75259d
ER
116# Fail on 5.3, 5.5, 5.6, 7.0, 7.1, 7.2
117Test Tutorial, fxAnalyzeImage [tests/229_Tutorial_fxAnalyzeImage_case1.phpt]
f5c1a0f1 118
96575c7e
ER
119# 5.3, 5.5, 5.6, 7.0/x32, 7.1, 7.2, 7.3, 7.4
120ImagickKernel::fromMatrix exceptions [tests/280_imagickkernel_exception_invalid_origin.phpt]
121Imagick::setImageAlpha [tests/274_imagick_setImageAlpha.phpt]
122Test ImagickDraw:: setTextInterlineSpacing [tests/279_ImagickDraw_setTextInterlineSpacing.phpt]
123Test Imagick::optimizeimagelayers and Imagick::optimizeimagetransparency [tests/278_Imagick_optimaze_gif.phpt]
fec66c9d
ER
124
125# php73/x32
126Test PHP bug #59378 writing to php://memory is incomplete [tests/bug59378.phpt]
127
128# php 7.4, 8.0
129%if "%php_major_version.%php_minor_version" == "7.4"
130Casting color and opacity to pixel [tests/003_cast_color_opacity.phpt]
131Different types of thumbnailing [tests/002_thumbnail.phpt]
132ImagickKernel::fromMatrix test [tests/145_imagickkernel_coverage.phpt]
133Imagick::resizeImage prevent 0 width/height images [tests/github_174.phpt]
134Test autoGammaImage [tests/263_autoGammaImage.phpt]
135Test compositeImageGravity [tests/261_compositeImageGravity.phpt]
136Test cropthumbnail [tests/006_cropthumbnail.phpt]
137Test filling thumbnail with color [tests/007_thumbnail_fill.phpt]
138Test for round issues [tests/064_cropThumbNailImage.phpt]
139Test Imagick::colorDecisionListImage [tests/277_Imagick_colorDecisionListImage.phpt]
140Test Imagick, progressMonitor [tests/127_Imagick_progressMonitor_basic.phpt]
141Test importimagepixels [tests/010_importimagepixels.phpt]
142Testing clone keyword [tests/004_clone.phpt]
143Testing that cloned object does not affect the original [tests/012-clone-separation.phpt]
144Test thumbnail bestfit [tests/005_bestfit.phpt]
5ee919f7
ER
145%ifarch x32 %{ix86}
146Test localContrastImage [tests/260_localContrastImage.phpt]
147%endif
fec66c9d 148%endif
96575c7e
ER
149EOF
150
7ef11872 151%build
7ef11872 152phpize
4f203515
JR
153%configure \
154 php_cv_cc_dashr=false
7ef11872 155
bc18093b 156%{__make} \
bc18093b 157 CFLAGS_CLEAN="%{rpmcflags}"
7ef11872 158
a70f8547
ER
159%{__php} -n -q \
160 -d extension_dir=modules \
e8211def 161%if "%php_major_version.%php_minor_version" < "7.4"
501a42f6 162 -d extension=%{php_extensiondir}/pcre.so \
a70f8547 163 -d extension=%{php_extensiondir}/spl.so \
e8211def 164%endif
a70f8547
ER
165 -d extension=%{modname}.so \
166 -m > modules.log
167grep %{modname} modules.log
168
76282008 169%if %{with tests}
a70f8547
ER
170export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
171%{__make} test \
172 PHP_EXECUTABLE=%{__php} \
e8211def 173%if "%php_major_version.%php_minor_version" < "7.4"
501a42f6 174 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl" \
a70f8547 175%endif
e8211def 176%endif
a70f8547 177
7ef11872 178%install
179rm -rf $RPM_BUILD_ROOT
be7cd71f 180install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
c3cb436b
ER
181install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
182cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
183; Enable %{modname} extension module
184extension=%{modname}.so
dbfce4b3 185EOF
be7cd71f 186cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
7ef11872 187
188%clean
189rm -rf $RPM_BUILD_ROOT
190
191%post
f7ead91e 192%php_webserver_restart
7ef11872 193
dbfce4b3
ER
194%postun
195if [ "$1" = 0 ]; then
f7ead91e 196 %php_webserver_restart
7ef11872 197fi
198
dbfce4b3 199%triggerpostun -- %{name} < 0.9.11-2.1
c3cb436b 200%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*%{modname}\.so/d' %{php_sysconfdir}/php.ini
dbfce4b3 201
7ef11872 202%files
203%defattr(644,root,root,755)
1fe13cac 204%doc CREDITS
c3cb436b
ER
205%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
206%attr(755,root,root) %{php_extensiondir}/%{modname}.so
be7cd71f 207%{_examplesdir}/%{name}-%{version}
This page took 0.165665 seconds and 4 git commands to generate.