xref: /imagick/rpm/php-imagick.spec (revision ddcd1124)
1%global php_apiver  %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
2%global php_extdir  %(php-config --extension-dir 2>/dev/null || echo "undefined")
3%global php_version %(php-config --version 2>/dev/null || echo 0)
4
5Name:           imagick
6Version:        3.1.2
7Release:        1%{?dist}
8Summary:        Provides a wrapper to the ImageMagick library.
9
10Group:          Development/Image
11License:        PHP
12URL:            http://pecl.php.net/package/imagick
13Source0:        http://pecl.php.net/get/imagick.tgz
14Source1:		imagick.ini
15BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
16
17BuildRequires:  php-devel
18BuildRequires:	ImageMagick-devel
19Requires:       php(zend-abi) = %{php_zend_api}
20Requires:       php(api) = %{php_apiver}
21
22%description
23Imagick is a native php extension to create and modify images using the ImageMagick API.
24This extension requires ImageMagick version 6.2.4+ and PHP 5.1.3+.
25
26IMPORTANT: Version 2.x API is not compatible with earlier versions.
27
28%prep
29%setup -q -n imagick
30
31%build
32%{_bindir}/phpize
33%configure
34make %{?_smp_mflags}
35
36%install
37rm -rf $RPM_BUILD_ROOT
38make install INSTALL_ROOT=$RPM_BUILD_ROOT
39
40# install configuration
41%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/php.d
42%{__cp} %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/imagick.ini
43
44%clean
45rm -rf $RPM_BUILD_ROOT
46
47%files
48%defattr(-,root,root,-)
49%doc CREDITS
50%config(noreplace) %{_sysconfdir}/php.d/imagick.ini
51%{php_extdir}/imagick.so
52%{_prefix}/include/php/ext/imagick/
53