Blob Blame History Raw
%{!?php_inidir:  %global php_inidir  %{_sysconfdir}/php.d}
%{!?__php:       %global __php       %{_bindir}/php}
%{!?_pkgdocdir:  %global _pkgdocdir  %{_docdir}/%{name}-%{version}}

%global  req_libvirt_version 1.2.13
%global  extname             libvirt-php
%if "%{php_version}" < "5.6"
%global ini_name             %{extname}.ini
%else
%global ini_name             40-%{extname}.ini
%endif

Name:		php-libvirt
Version:	0.5.3
Release:	3%{?dist}
Summary:	PHP language bindings for Libvirt

Group:		Development/Libraries
# libvirt-php is under the same terms as libvirt
License:	LGPLv2+
URL:		http://libvirt.org/php
Source0:	http://libvirt.org/sources/php/libvirt-php-%{version}.tar.gz

BuildRequires:	php-devel
BuildRequires:	libvirt-devel >= %{req_libvirt_version}
BuildRequires:	libxml2-devel
BuildRequires:	libxslt
BuildRequires:	php-pecl-imagick
BuildRequires:	xhtml1-dtds

Requires:	libvirt >= %{req_libvirt_version}
Requires:	php(zend-abi) = %{php_zend_api}
Requires:	php(api) = %{php_core_api}

# For some reason, libvirt doesn't exist in RHEL 7 aarch64, but does on CentOS 7
%if 0%{?rhel} == 7 && 0%{?centos} == 0
ExcludeArch:    aarch64
%endif

# Filter shared private - always as libvirt-php.so is a private extension
%global __provides_exclude_from ^%{_libdir}/.*\\.so$


%description
PHP language bindings for Libvirt API. 
For more details see: http://www.libvirt.org/php/


%package doc
Summary:	Documentation for %{name}
Group:		Development/Libraries
BuildArch:	noarch
Requires:	%{name} = %{version}-%{release}

%description doc
PHP language bindings for Libvirt API. 
For more details see: http://www.libvirt.org/php/ http://www.php.net/

This package contains the documentation for php-libvirt.


%prep
%setup -q -n %{extname}-%{version}


%build
%configure \
  --with-html-dir=%{_docdir} \
  --with-html-subdir=$(echo %{_pkgdocdir} | sed -e 's|^%{_docdir}/||')/html \
  --libdir=%{php_extdir}
%make_build


%install
%make_install
chmod +x %{buildroot}%{php_extdir}/%{extname}.so

if [ -f %{buildroot}%{php_inidir}/%{extname}.ini ]; then
  if [ "%{extname}.ini" != "%{ini_name}" ]; then
    mv %{buildroot}%{php_inidir}/%{extname}.ini \
       %{buildroot}%{php_inidir}/%{ini_name}
  fi
else
  install -Dpm 644 src/libvirt-php.ini %{buildroot}%{php_inidir}/%{ini_name}
fi

# Erase unnecessary libtool archive file
rm %{buildroot}%{php_extdir}/%{extname}.la


%check
: simple module load test
%{__php} --no-php-ini \
    --define extension=%{buildroot}%{php_extdir}/%{extname}.so \
    --modules | grep libvirt


%files
%license COPYING
%dir %{_pkgdocdir}
%{php_extdir}/%{extname}.so
%config(noreplace) %{php_inidir}/%{ini_name}


%files doc
%{_pkgdocdir}/html


%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu May 11 2017 Neal Gompa <ngompa13@gmail.com> - 0.5.3-2
- Fix license tag to match actual source license

* Thu May 11 2017 Neal Gompa <ngompa13@gmail.com> - 0.5.3-1
- Upgrade to 0.5.3

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Nov 14 2016 Remi Collet <remi@fedoraproject.org> - 0.5.2-3
- rebuild for https://fedoraproject.org/wiki/Changes/php71

* Mon Jun 27 2016 Remi Collet <remi@fedoraproject.org> - 0.5.2-2
- rebuild for https://fedoraproject.org/wiki/Changes/php70

* Sat Jun 11 2016 Neal Gompa <ngompa13@gmail.com> - 0.5.2-1
- Upgrade to 0.5.2

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.8-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.8-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Thu Jun 19 2014 Remi Collet <rcollet@redhat.com> - 0.4.8-3
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
- add numerical prefix to extension configuration file

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Jan  6 2014 Remi Collet <remi@fedoraproject.org> - 0.4.8-1
- update to 0.4.8
- spec cleanups

* Thu Dec 12 2013 Ville Skyttä <ville.skytta@iki.fi> - 0.4.5-6
- Install docs to %%{_pkgdocdir} where available (#994035).
- Include COPYING in main package.
- Disable parallel build.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Mar 22 2013 Remi Collet <rcollet@redhat.com> - 0.4.5-4
- rebuild for http://fedoraproject.org/wiki/Features/Php55

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jan 19 2012 Remi Collet <remi@fedoraproject.org> - 0.4.5-1
- update to 0.4.5 (upstream is libvirt-php)
- build against php 5.4.0, with patch
- add filter to fix private-shared-object-provides
- add %%check for php extension
- use macro from latest php (php_inidir, php_extdir)
- requires php ABI

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Aug 22 2011 Michal Novotny <minovotn@redhat.com> - 0.4.4
- Several bugfixes for VNC and updated SPEC file

* Thu Aug 11 2011 Michal Novotny <minovotn@redhat.com> - 0.4.3
- Rebase to 0.4.3 from master branch

* Tue Apr 19 2011 Michal Novotny <minovotn@redhat.com> - 0.4.1-5
- Minor memory leak fixes
- Several bug fixes

* Mon Apr 11 2011 Michal Novotny <minovotn@redhat.com> - 0.4.1-4
- Add new storagepool API functions
- Add optional xPath argument for *_get_xml_desc() functions
- Add new network API functions
- Add new API functions to add/remove disks

* Wed Mar 23 2011 Michal Novotny <minovotn@redhat.com> - 0.4.1-3
- Add connection information function
- Add coredump support
- Add snapshots support
- Improve error reporting for destructors

* Thu Mar 10 2011 Michal Novotny <minovotn@redhat.com> - 0.4.1-2
- Changes done to comply with Fedora package policy

* Tue Feb  8 2011 Michal Novotny <minovotn@redhat.com> - 0.4.1
- Initial commit (from github)