summaryrefslogtreecommitdiffstats
path: root/php-libvirt.spec
blob: bd9fbe0e22fca44d656180b6b096fa9185af621c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# remirepo spec file for php-libvirt
# With SCL stuff, from Fedora:
#
# Fedora spec file for php-libvirt
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
%global sub_prefix %{scl_prefix}
%scl_package        php-libvirt
%endif

# The change to redhat-rpm-config to force symbols to be defined breaks all PHP extensions
# c.f.: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af192613e1beec34824a94dc5f6feeeea1568
# c.f.: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/7EHQUO6JIFRE4KIQQMFVQCAQ72NLKARO/
%undefine _strict_symbol_defs_build

%{!?_pkgdocdir:  %global _pkgdocdir  %{_docdir}/%{name}-%{version}}

# from upstream 1.2.9 (but seems wrong, missing VIR_STORAGE_VOL_CREATE_REFLINK)
%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:          %{?sub_prefix}php-libvirt
Version:       0.5.5
Release:       5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary:       PHP language binding 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

Patch0:        libvirt-php8.patch

BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: libvirt-devel >= %{req_libvirt_version}
BuildRequires: libxml2-devel
BuildRequires: libxslt
# obviously NOT needed, checked by configure as used by examples :(
BuildRequires: %{?scl_prefix}php-pecl-imagick
BuildRequires: xhtml1-dtds

Requires:      %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires:      %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}

%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
%if "%{php_version}" > "7.3"
Obsoletes:      php73-libvirt <= %{version}
%endif
%if "%{php_version}" > "7.4"
Obsoletes:      php74-libvirt <= %{version}
%endif
%if "%{php_version}" > "8.0"
Obsoletes:      php80-libvirt <= %{version}
%endif
%endif

# Filter shared private - always as libvirt-php.so is a very bad name
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}


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

Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.


%package doc
Summary:       Document of php-libvirt
Group:         Development/Libraries
BuildArch:     noarch
Requires:      %{name} = %{version}-%{release}
%if "%{?scl_prefix}" != "%{?sub_prefix}"
Provides:      %{?scl_prefix}php-libvirt-doc         = %{version}-%{release}
Provides:      %{?scl_prefix}php-libvirt-doc%{?_isa} = %{version}-%{release}
%endif

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

This package contain the document for php-libvirt.


%prep
%setup -q -n libvirt-php-%{version}
%patch0 -p1 -b .php8


%build
%{?dtsenable}
%{?scl:. %{_scl_scripts}/enable}

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


%install
%{?dtsenable}
%{?scl:. %{_scl_scripts}/enable}

make install DESTDIR=%{buildroot}
install -pm 644 COPYING %{buildroot}%{_pkgdocdir}

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
%dir %{_pkgdocdir}
%{!?_licensedir:%global license %%doc}
%license %{_pkgdocdir}/COPYING
%{php_extdir}/%{extname}.so
%config(noreplace) %{php_inidir}/%{ini_name}

%files doc
%{_pkgdocdir}/html


%changelog
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 0.5.5-5
- rebuild for 8.1.0RC1

* Wed Jan 27 2021 Remi Collet <remi@remirepo.net> - 0.5.5-4
- add patch for PHP 8

* Sun Feb  9 2020 Remi Collet <remi@remirepo.net> - 0.5.5-1
- Upgrade to 0.5.5

* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 0.5.4-5
- rebuild for 7.4.0RC1

* Tue Jul 23 2019 Remi Collet <remi@remirepo.net> - 0.5.4-4
- rebuild for 7.4.0beta1

* Thu Aug 16 2018 Remi Collet <remi@remirepo.net> - 0.5.4-3
- rebuild for 7.3.0beta2 new ABI

* Tue Jul 17 2018 Remi Collet <remi@remirepo.net> - 0.5.4-2
- rebuld for 7.3.0alpha4 new ABI

* Thu Aug  3 2017 Remi Collet <remi@remirepo.net> - 0.5.4-1
- update to 0.5.4

* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 0.5.3-4
- rebuild for PHP 7.2.0beta1 new API

* Wed Jun 21 2017 Remi Collet <remi@fedoraproject.org> - 0.5.3-3
- rebuild for 7.2.0alpha2

* 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

* Thu Dec  1 2016 Remi Collet <remi@fedoraproject.org> - 0.5.2-4
- rebuild with PHP 7.1.0 GA

* Wed Sep 14 2016 Remi Collet <remi@fedoraproject.org> - 0.5.2-3
- rebuild for PHP 7.1 new API version

* Sun Sep 11 2016 Remi Collet <remi@fedoraproject.org> - 0.5.2-2
- fix F25 build (ini file installation)

* Thu Apr 21 2016 Remi Collet <remi@fedoraproject.org> - 0.5.2-1
- update to 0.5.2
- raise dependency on libvirt 1.2.9

* Fri Nov 27 2015 Remi Collet <remi@fedoraproject.org> - 0.5.1-1
- update to 0.5.1
- raise dependency on libvirt 1.2.8

* Tue Jun 23 2015 Remi Collet <rcollet@redhat.com> - 0.4.8-3
- allow build against rh-php56 (as more-php56)

* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 0.4.8-2.1
- Fedora 21 SCL mass rebuild

* Wed Apr 16 2014 Remi Collet <remi@fedoraproject.org> - 0.4.8-2
- add numerical prefix to extension configuration file

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

* Tue Jan  8 2013 Remi Collet <remi@fedoraproject.org> - 0.4.5-2
- rebuild

* Sun Nov 27 2011 Remi Collet <RPMS@FamilleCollet.com> - 0.4.5-1
- update to 0.4.5
- fix for php 5.4 (and some of compiler warnings)
  https://www.redhat.com/archives/libvir-list/2011-November/msg01476.html

* Tue Aug 23 2011 Remi Collet <RPMS@FamilleCollet.com> - 0.4.4-1
- rebuild for remi repo

* Mon Aug 22 2011 Michal Novotny <minovotn@redhat.com> - 0.4.4
- Several bugfixes and updated SPEC file and codes not to require open tags

* Sun Aug 21 2011 Remi Collet <RPMS@FamilleCollet.com> - 0.4.3-1
- rebuild for remi repo

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

* Sat Jul 16 2011 Remi Collet <RPMS@FamilleCollet.com> - 0.4.1-5
- rebuild for remi repo

* 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-1
- Initial commit (from github)