[libvirt] [libvirt-php 0/2] Updated building system

Fixed the install location of libvirt-php.ini; Added an spec file for openSuSE Build Service. Lyre (2): Fixed the php configuration file Added libvirt-php.obs.spec Makefile.am | 2 + aclocal.m4 | 4 +- libvirt-php.obs.spec | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 7 ++-- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 libvirt-php.obs.spec

Install the libvirt-php.ini to a appropriate location. * src/Makefile.am: Set $PHPCDIR to the php configuration file directory, and replace $sysconfdir/php.d with $PHPCDIR. Added suffix ".so" in libvirt-php.ini. --- src/Makefile.am | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 206fa68..059de2c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,7 @@ RM=rm ECHO=echo PHPINC=`php-config --includes` PHPEDIR=`php-config --extension-dir` +PHPCDIR=`php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p'` XMLCFLAGS=`pkg-config libxml-2.0 --cflags` XMLLIBS=`pkg-config libxml-2.0 --libs` @@ -20,11 +21,11 @@ build: install-exec-local: mkdir -p $(DESTDIR)$(PHPEDIR) $(CP) $(NAME).so $(DESTDIR)$(PHPEDIR) - mkdir -p $(DESTDIR)$(sysconfdir)/php.d - $(ECHO) "extension=$(NAME)" > $(DESTDIR)$(sysconfdir)/php.d/libvirt-php.ini + mkdir -p $(DESTDIR)$(PHPCDIR) + $(ECHO) "extension=$(NAME).so" > $(DESTDIR)$(PHPCDIR)/libvirt-php.ini uninstall-local: - $(RM) -f $(sysconfdir)/php.d/$(NAME).ini + $(RM) -f $(DESTDIR)$(PHPCDIR)/$(NAME).ini $(RM) -f $(DESTDIR)$(PHPEDIR)/$(NAME).so clean-temp: -- 1.7.1

* libvirt-php.obs.spec: this file should works for Fedora 14, openSuSE 11.3, and SLES 11 SP1 on openSuSE Build Service or localhost. * Makefile.am: added EXTRA_DIST = libvirt-php.obs.spec --- Makefile.am | 2 + aclocal.m4 | 4 +- libvirt-php.obs.spec | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 libvirt-php.obs.spec diff --git a/Makefile.am b/Makefile.am index d229a00..eac6726 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,3 @@ SUBDIRS = src docs + +EXTRA_DIST = libvirt-php.obs.spec diff --git a/aclocal.m4 b/aclocal.m4 index 4bb6f78..a1fa316 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],, -[m4_warning([this file was generated for autoconf 2.66. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, +[m4_warning([this file was generated for autoconf 2.65. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) diff --git a/libvirt-php.obs.spec b/libvirt-php.obs.spec new file mode 100644 index 0000000..2e3ab59 --- /dev/null +++ b/libvirt-php.obs.spec @@ -0,0 +1,80 @@ +%define req_libvirt_version 0.6.2 +%if 0%{?suse_version} || 0%{?sles_version} +%define php_confdir %{_sysconfdir}/php5/conf.d +%define php_extdir %{_libdir}/php5/extensions +%else +%define php_confdir %{_sysconfdir}/php.d +%define php_extdir %{_libdir}/php/modules +%endif + +Name: libvirt-php +Version: 0.4 +Release: 1%{?dist}%{?extra_release} +Summary: PHP language binding for Libvirt + +%if 0%{?suse_version} || 0%{?sles_version} +Group: Development/Libraries/PHP +%else +Group: Development/Libraries +%endif +License: PHP +URL: http://libvirt.org/ +Source0: http://libvirt.org/sources/libvirt-php-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +BuildRequires: php-devel +BuildRequires: libvirt-devel >= %{req_libvirt_version} +BuildRequires: libxml2-devel +%if 0%{?suse_version} || 0%{?sles_version} +BuildRequires: xhtml-dtd +%else +BuildRequires: xhtml1-dtds +%endif +Requires: libvirt >= %{req_libvirt_version} +%if 0%{?suse_version} || 0%{?sles_version} +Requires: php5 +%else +Requires: php +%endif + +%description +PHP language bindings for Libvirt API. +For more details see: http://phplibvirt.cybersales.cz/ http://www.libvirt.org/ http://www.php.net/ + +%package -n libvirt-php-doc +Summary: Document of libvirt-php +Group: Development/Libraries/PHP +Requires: libvirt-php = %{version} + +%description -n libvirt-php-doc +PHP language bindings for Libvirt API. +For more details see: http://phplibvirt.cybersales.cz/ http://www.libvirt.org/ http://www.php.net/ + +This package contain the document for libvirt-php. + +%prep +%setup -q -n libvirt-php-%{version} + +%build +%configure +./configure --with-html-dir=%{_datadir}/doc --with-html-subdir=%{name}-%{version}/html +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{php_extdir}/libvirt-php.so +%config(noreplace) %{php_confdir}/libvirt-php.ini + +%files -n libvirt-php-doc +%defattr(-,root,root,-) +%doc +%{_datadir}/doc/%{name}-%{version}/html + +%changelog + -- 1.7.1

On Tue, Feb 15, 2011 at 03:03:52PM +0800, Lyre wrote:
* libvirt-php.obs.spec: this file should works for Fedora 14, openSuSE 11.3, and SLES 11 SP1 on openSuSE Build Service or localhost. * Makefile.am: added EXTRA_DIST = libvirt-php.obs.spec --- Makefile.am | 2 + aclocal.m4 | 4 +- libvirt-php.obs.spec | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 libvirt-php.obs.spec
Why do we need another RPM specfile ? Can't you just make your changes to the existing php-libvirt.spec ? Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Tue, Feb 15, 2011 at 6:42 PM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Tue, Feb 15, 2011 at 03:03:52PM +0800, Lyre wrote:
* libvirt-php.obs.spec: this file should works for Fedora 14, openSuSE 11.3, and SLES 11 SP1 on openSuSE Build Service or localhost. * Makefile.am: added EXTRA_DIST = libvirt-php.obs.spec --- Makefile.am | 2 + aclocal.m4 | 4 +- libvirt-php.obs.spec | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 libvirt-php.obs.spec
Why do we need another RPM specfile ? Can't you just make your changes to the existing php-libvirt.spec ?
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:|
Hi Daniel: The problem was, I'm not quite sure what to do with this spec file. Currently, It may be better to name the spec file libvirt-php.spec. This spec file contains many if...else for compatibility, some macros such as %{php_zend_api} are not acceptable in SLES. The original php-libvirt.spec may be preferred for Fedora. At last, I intend to use the openSuSE Build Service for easier deployment. It will be easier for me to maintain this file if it is rejected.

On 15/02/2011, at 10:35 PM, Lyre wrote: <snip>
The problem was, I'm not quite sure what to do with this spec file.
Currently, It may be better to name the spec file libvirt-php.spec.
This spec file contains many if...else for compatibility, some macros such as %{php_zend_api} are not acceptable in SLES. The original php-libvirt.spec may be preferred for Fedora.
At last, I intend to use the openSuSE Build Service for easier deployment. It will be easier for me to maintain this file if it is rejected.
How similar are the spec files? Lyre, you mention that one of them uses if...else statements to make it work in SLES and non-SLES. Maybe it would be possible to merge the Fedora one into that, so a single spec file works on both? If not, could they be renamed so there's minimal confusion? Something like this: libvirt-php.SUSE.spec (SLES, OpenSUSE, ?) libvirt-php.RedHat.spec (RHEL, Fedora, CentOS, ?) (they're just suggestions, up to you guys) Regards and best wishes, Justin Clift

On Tue, Feb 15, 2011 at 7:48 PM, Justin Clift <jclift@redhat.com> wrote:
The problem was, I'm not quite sure what to do with this spec file.
Currently, It may be better to name the spec file libvirt-php.spec.
This spec file contains many if...else for compatibility, some macros such as %{php_zend_api} are not acceptable in SLES. The original
On 15/02/2011, at 10:35 PM, Lyre wrote: <snip> php-libvirt.spec may be preferred for Fedora.
At last, I intend to use the openSuSE Build Service for easier
deployment. It will be easier for me to maintain this file if it is rejected.
How similar are the spec files?
Lyre, you mention that one of them uses if...else statements to make it work in SLES and non-SLES. Maybe it would be possible to merge the Fedora one into that, so a single spec file works on both?
If not, could they be renamed so there's minimal confusion? Something like this:
libvirt-php.SUSE.spec (SLES, OpenSUSE, ?) libvirt-php.RedHat.spec (RHEL, Fedora, CentOS, ?)
(they're just suggestions, up to you guys)
Regards and best wishes,
Justin Clift
In fact, the spec files are quite similar. The new spec is also suitable for Fedora. BTW, it is my first time to be involved in an opensource project. Maybe I've been accustom to that someone will make decision, not me. It seems that I should make the decsion now, and I'll try to merge them.

On 15/02/2011, at 11:42 PM, Lyre wrote: <snip>
BTW, it is my first time to be involved in an opensource project.
No worries. You're doing fine, and you'll be ok. :)
Maybe I've been accustom to that someone will make decision, not me. It seems that I should make the decsion now, and I'll try to merge them.
Yeah, that sounds like the right solution, so try it out and see if it turns out nicely. :) Regards and best wishes, Justin Clift

On 02/15/2011 01:42 PM, Lyre wrote:
On Tue, Feb 15, 2011 at 7:48 PM, Justin Clift <jclift@redhat.com <mailto:jclift@redhat.com>> wrote:
On 15/02/2011, at 10:35 PM, Lyre wrote: <snip> > The problem was, I'm not quite sure what to do with this spec file. > > Currently, It may be better to name the spec file libvirt-php.spec. > > This spec file contains many if...else for compatibility, some macros such as %{php_zend_api} are not acceptable in SLES. The original php-libvirt.spec may be preferred for Fedora. > > At last, I intend to use the openSuSE Build Service for easier deployment. It will be easier for me to maintain this file if it is rejected.
How similar are the spec files?
Lyre, you mention that one of them uses if...else statements to make it work in SLES and non-SLES. Maybe it would be possible to merge the Fedora one into that, so a single spec file works on both?
If not, could they be renamed so there's minimal confusion? Something like this:
libvirt-php.SUSE.spec (SLES, OpenSUSE, ?) libvirt-php.RedHat.spec (RHEL, Fedora, CentOS, ?)
(they're just suggestions, up to you guys)
Regards and best wishes,
Justin Clift
In fact, the spec files are quite similar. The new spec is also suitable for Fedora.
BTW, it is my first time to be involved in an opensource project. Maybe I've been accustom to that someone will make decision, not me. It seems that I should make the decsion now, and I'll try to merge them.
Well, if those files are that similar please try to merge them into the one spec file but please test it's working fine on all of the systems mentioned above first. Thanks, Michal -- Michal Novotny<minovotn@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat

On 02/15/2011 08:03 AM, Lyre wrote:
Fixed the install location of libvirt-php.ini; Added an spec file for openSuSE Build Service.
Lyre (2): Fixed the php configuration file Added libvirt-php.obs.spec
Makefile.am | 2 + aclocal.m4 | 4 +- libvirt-php.obs.spec | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 7 ++-- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 libvirt-php.obs.spec
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Thanks! ACK and pushed!
Michal -- Michal Novotny<minovotn@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat
participants (4)
-
Daniel P. Berrange
-
Justin Clift
-
Lyre
-
Michal Novotny