]> git.pld-linux.org Git - packages/php-pecl-imagick.git/blobdiff - php-pecl-imagick.spec
i686 spl requires pcre
[packages/php-pecl-imagick.git] / php-pecl-imagick.spec
index 9d519a9b2975849ee1760cede78ef5c788afc554..f7460317e15bb86f70cbc18d030b2a6bee072181 100644 (file)
@@ -1,23 +1,40 @@
-%define                _modname        imagick
-%define                _status         stable
-Summary:       %{_modname} - PHP wrapper to the Image Magick Library
-Summary(pl.UTF-8):     %{_modname} - PHP-owy wrapper do biblioteki Image Magick
-Name:          php-pecl-%{_modname}
-Version:       2.2.2
-Release:       2
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
+%define                php_name        php%{?php_suffix}
+%define                modname         imagick
+%define                status          stable
+Summary:       %{modname} - PHP wrapper to the Image Magick Library
+Summary(pl.UTF-8):     %{modname} - PHP-owy wrapper do biblioteki Image Magick
+Name:          %{php_name}-pecl-%{modname}
+Version:       3.4.2
+Release:       3
 License:       PHP 3.01
 Group:         Development/Languages/PHP
-Source0:       http://pecl.php.net/get/%{_modname}-%{version}.tgz
-# Source0-md5: d0d4e004dc2e3244a8088d9eaef32645
+Source0:       http://pecl.php.net/get/%{modname}-%{version}.tgz
+# Source0-md5: 3f80e35c2434636cdb5df01b221b3ffa
+Patch0:                skip_version_check.patch
 URL:           http://pecl.php.net/package/imagick/
+BuildRequires: %{php_name}-devel >= 4:5.3
 BuildRequires: ImageMagick-devel >= 1:6.2.4.0
-BuildRequires: php-devel >= 3:5.1.3
-BuildRequires: rpmbuild(macros) >= 1.344
+BuildRequires: rpmbuild(macros) >= 1.650
+%if %{with tests}
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-pcre
+BuildRequires: %{php_name}-spl
+BuildRequires: ImageMagick-coder-jpeg
+BuildRequires: ImageMagick-coder-png
+BuildRequires: ImageMagick-coder-tiff
+%endif
 %{?requires_php_extension}
 Requires(triggerpostun):       sed >= 4.0
-Requires:      php-common >= 4:5.0.4
-Provides:      php(imagick)
-Obsoletes:     php-imagick
+Requires:      %{php_name}-spl
+Suggests:      ImageMagick-coder-jpeg
+Suggests:      ImageMagick-coder-png
+Suggests:      ImageMagick-coder-tiff
+Provides:      php(imagick) = %{version}
+Obsoletes:     php-pecl-imagick < 3.1.2-2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -29,7 +46,7 @@ suitable for Web applications. You can also resize, rotate, sharpen,
 color reduce, or add special effects to an image and save your
 completed work in the same or differing image format.
 
-In PECL status of this package is: %{_status}.
+In PECL status of this package is: %{status}.
 
 %description -l pl.UTF-8
 ImageMagick to duży zestaw narzędzi i bibliotek do odczytu, zapisu i
@@ -39,27 +56,65 @@ ImageMagick można dynamicznie tworzyć obrazki, co jest przydatne w
 aplikacjach WWW. Można je także przeskalowywać, obracać, wyostrzać,
 zmniejszać ilość kolorów - w tym samym lub innym formacie.
 
-To rozszerzenie ma w PECL status: %{_status}.
+To rozszerzenie ma w PECL status: %{status}.
 
 %prep
-%setup -q -c
-mv %{_modname}-%{version}/* .
+%setup -qc
+mv %{modname}-%{version}/* .
+%patch0 -p1
+
+# skip failing tests
+Test() {
+       nf=$(eval echo \$$#)
+       t=$nf; t=${t#\[}; t=${t%\]}
+       mv $t $t.skip
+}
+Test Imagick, annotateImage [tests/034_Imagick_annotateImage_basic.phpt]
+Test ImagickDraw, composite [tests/177_ImagickDraw_composite_basic.phpt]
+Test ImagickDraw, setFontSize [tests/206_ImagickDraw_setFontSize_basic.phpt]
+Test ImagickDraw, setFontFamily [tests/207_ImagickDraw_setFontFamily_basic.phpt]
+Test ImagickDraw, setFontStretch [tests/208_ImagickDraw_setFontStretch_basic.phpt]
+Test ImagickDraw, setFontWeight [tests/209_ImagickDraw_setFontWeight_basic.phpt]
+Test ImagickDraw, setFontStyle [tests/210_ImagickDraw_setFontStyle_basic.phpt]
+Test ImagickDraw, setGravity [tests/212_ImagickDraw_setGravity_basic.phpt]
+Test ImagickDraw, setTextAlignment [tests/222_ImagickDraw_setTextAlignment_basic.phpt]
+Test ImagickDraw, setTextAntialias [tests/223_ImagickDraw_setTextAntialias_basic.phpt]
+Test ImagickDraw, setTextUnderColor [tests/224_ImagickDraw_setTextUnderColor_basic.phpt]
+Test ImagickDraw, setTextDecoration [tests/225_ImagickDraw_setTextDecoration_basic.phpt]
+Test Tutorial, psychedelicFont [tests/241_Tutorial_psychedelicFont_basic.phpt]
+Test Tutorial, svgExample [tests/243_Tutorial_svgExample_basic.phpt]
+Test Tutorial, psychedelicFontGif [tests/244_Tutorial_psychedelicFontGif_basic.phpt]
 
 %build
 phpize
-%configure
+%configure \
+       php_cv_cc_dashr=false
 
 %{__make} \
        CFLAGS_CLEAN="%{rpmcflags}"
 
+%if %{with tests}
+%{__php} -n -q \
+       -d extension_dir=modules \
+       -d extension=%{php_extensiondir}/pcre.so \
+       -d extension=%{php_extensiondir}/spl.so \
+       -d extension=%{modname}.so \
+       -m > modules.log
+grep %{modname} modules.log
+
+export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+%{__make} test \
+       PHP_EXECUTABLE=%{__php} \
+       PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl" \
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
-
-install modules/%{_modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
-cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini
-; Enable %{_modname} extension module
-extension=%{_modname}.so
+install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
+; Enable %{modname} extension module
+extension=%{modname}.so
 EOF
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
@@ -75,11 +130,11 @@ if [ "$1" = 0 ]; then
 fi
 
 %triggerpostun -- %{name} < 0.9.11-2.1
-%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*%{_modname}\.so/d' %{php_sysconfdir}/php.ini
+%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*%{modname}\.so/d' %{php_sysconfdir}/php.ini
 
 %files
 %defattr(644,root,root,755)
 %doc CREDITS
-%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini
-%attr(755,root,root) %{php_extensiondir}/%{_modname}.so
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{modname}.so
 %{_examplesdir}/%{name}-%{version}
This page took 0.065349 seconds and 4 git commands to generate.