Richard W.M. Jones
2012-Jan-22 15:59 UTC
[Libguestfs] Packaging GObject for Fedora (was: [rjones@fedoraproject.org: [libguestfs] New upstream version 1.15.19.])
These are the changes I made to the spec file related to gobject bindings and gobject introspection. TBH I wasn't sure how to properly package this. Rich. diff --git a/libguestfs.spec b/libguestfs.spec index 095a848..1b6e43d 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -29,7 +29,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 -Version: 1.15.18 +Version: 1.15.19 Release: 1%{?dist} License: LGPLv2+ Group: Development/Libraries @@ -202,6 +208,9 @@ BuildRequires: java-devel BuildRequires: php-devel BuildRequires: erlang-erts BuildRequires: erlang-erl_interface +BuildRequires: glib2-devel +BuildRequires: gobject-introspection-devel +BuildRequires: gjs # For libguestfs-tools: BuildRequires: perl-Sys-Virt @@ -272,6 +281,9 @@ To mount guest filesystems on the host using FUSE, install For Erlang bindings, install 'erlang-libguestfs'. +For GObject bindings and GObject Introspection, install +'libguestfs-gobject-devel'. + For Java bindings, install 'libguestfs-java-devel'. For OCaml bindings, install 'ocaml-libguestfs-devel'. @@ -578,6 +590,30 @@ Requires: erlang-erts erlang-%{name} contains Erlang bindings for %{name}. +%package gobject +Summary: GObject bindings for %{name} +Group: Development/Libraries +Requires: %{name} = %{epoch}:%{version}-%{release} + +%description gobject +%{name}-gobject contains GObject bindings for %{name}. + +To develop software against these bindings, you need to install +%{name}-gobject-devel. + + +%package gobject-devel +Summary: GObject bindings for %{name} +Group: Development/Libraries +Requires: %{name}-gobject = %{epoch}:%{version}-%{release} + +%description gobject-devel +%{name}-gobject contains GObject bindings for %{name}. + +This package is needed if you want to write software using the +GObject bindings. It also contains GObject Introspection information. + + %package man-pages-uk Summary: Ukrainian (uk) man pages for %{name} Group: Development/Libraries @@ -740,6 +779,8 @@ make DESTDIR=$RPM_BUILD_ROOT install # Delete static libraries, libtool files. rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la +rm $RPM_BUILD_ROOT%{_libdir}/libguestfs-gobject-1.0.a +rm $RPM_BUILD_ROOT%{_libdir}/libguestfs-gobject-1.0.la find $RPM_BUILD_ROOT -name perllocal.pod -delete find $RPM_BUILD_ROOT -name .packlist -delete @@ -961,6 +1002,19 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man3/guestfs-erlang.3* +%files gobject +%defattr(-,root,root,-) +%{_libdir}/libguestfs-gobject-1.0.so.0* + + +%files gobject-devel +%defattr(-,root,root,-) +%{_libdir}/libguestfs-gobject-1.0.so +%{_includedir}/guestfs-gobject.h +%{_libdir}/girepository-1.0/Guestfs-1.0.typelib +%{_datadir}/gir-1.0/Guestfs-1.0.gir + + %files man-pages-uk %defattr(-,root,root,-) %lang(uk) %{_mandir}/uk/man1/*.1* -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Daniel P. Berrange
2012-Jan-23 10:57 UTC
[Libguestfs] Packaging GObject for Fedora (was: [rjones@fedoraproject.org: [libguestfs] New upstream version 1.15.19.])
On Sun, Jan 22, 2012 at 03:59:28PM +0000, Richard W.M. Jones wrote:> These are the changes I made to the spec file related to gobject > bindings and gobject introspection. TBH I wasn't sure how to properly > package this. > @@ -961,6 +1002,19 @@ rm -rf $RPM_BUILD_ROOT > %{_mandir}/man3/guestfs-erlang.3* > > > +%files gobject > +%defattr(-,root,root,-) > +%{_libdir}/libguestfs-gobject-1.0.so.0* > + > + > +%files gobject-devel > +%defattr(-,root,root,-) > +%{_libdir}/libguestfs-gobject-1.0.so > +%{_includedir}/guestfs-gobject.h > +%{_libdir}/girepository-1.0/Guestfs-1.0.typelib > +%{_datadir}/gir-1.0/Guestfs-1.0.girYou just want to move the 'typelib' file to the main gobject package - this is a runtime file. ".typelib" is to ".so.0.N" files, as ".gir" is to ".h" files. Incidentally, if you're going to put version numbers in the gobject binary and typelib files, then you'd normally expect to also put the header file in a correspondingly versioned directory. ie I'd expect %{_includedir}/guestfs-gobject-1.0/guetsfs-gobject.h The pkg-config file would also be named guestfs-gobject-1.0.pc, and set -I/usr/include/guestfs-gobject-1.0 -lguest-gobject-1.0 The idea being that this is 100% parallel installable with -2.0 or -3.0 versions, should an ABI change be needed Oh we're missing a pkg-config file for this... 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 :|