#1 gobject-introspection typelib rpm provides
Closed 6 years ago by yaneti. Opened 6 years ago by yaneti.
rpms/ yaneti/gobject-introspection gir-provides  into  master

@@ -9,6 +9,9 @@ 

  URL:            https://wiki.gnome.org/Projects/GObjectIntrospection

  Source0:        https://download.gnome.org/sources/gobject-introspection/1.54/%{name}-%{version}.tar.xz

  

+ Source1:        typelib.prov

+ Source2:        typelib.attr

+ 

  BuildRequires:  glib2-devel >= %{glib2_version}

  BuildRequires:  python-devel >= 2.5

  BuildRequires:  gettext
@@ -57,6 +60,8 @@ 

  

  %install

  %make_install

+ install -D -p -m 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_rpmconfigdir}/typelib.prov

+ install -D -p %{SOURCE2} $RPM_BUILD_ROOT%{_fileattrsdir}/typelib.attr

  

  # Remove lib64 rpaths

  chrpath --delete $RPM_BUILD_ROOT%{_bindir}/g-ir-compiler
@@ -77,6 +82,8 @@ 

  %{_libdir}/lib*.so.*

  %dir %{_libdir}/girepository-1.0

  %{_libdir}/girepository-1.0/*.typelib

+ %{_rpmconfigdir}/typelib.prov

+ %{_fileattrsdir}/typelib.attr

  

  %files devel

  %{_libdir}/lib*.so

file added
+2
@@ -0,0 +1,2 @@ 

+ %__typelib_provides	%{_rpmconfigdir}/typelib.prov

+ %__typelib_path	^%{_libdir}/girepository-1.0/.*\.typelib$

file added
+9
@@ -0,0 +1,9 @@ 

+ #!/bin/sh

+ OLD_IFS="$IFS"

+ ISA=`rpm -E '%_isa'`

+ while read instfile ; do

+ 	NS=`echo $instfile | sed -e 's/.*\///' -e 's/\-.*//'`

+ 	VER=`echo $instfile | sed -e 's/.*\-//' -e 's/.typelib//'`

+ 	echo "typelib($NS)$ISA = $VER"

+ done

+ IFS=$OLD_IFS

Just some food for thought, spurred in part by https://bugzilla.redhat.com/show_bug.cgi?id=1503864

rpm provides in the form of
gir-1.0(Namespace-version)%{_isa}
eg:
gir-1.0(NMGtk-1.0)(x86-64)

I think OpenSUSE was doing something like this...

Ah yes http://dominique.leuenberger.net/blog/2011/06/gobject-introspection-based-typelib-provides-and-requires/

I think if we do this we should at least try to use the same names. And the same infrastructure...does this magical prov stuff work for them too?)

It sems openSUSE went quite further by splitting the typelibs in a typelib-* subpackages, which I don't know if we should emulate
Unversioned "typelib" that does not tie it to the 1.0 gir version seems very anonymous to me. its a very specific type of typelib

1 new commit added

  • git provides: separate namespace and version
6 years ago

The other thing openSUSE does is generate requires on the typelib-* packages extracted from g-ir-inspect . It makes sense in a separate typelib package situation but would just be a massive duplication of already present shared dep information if the typelib remains in the main package

This is what the typelib-1_0-NMGtk-1_0-1.8.4-2.1.x86_64.rpm
- provides
typelib(NMGtk) = 1.0
typelib-1_0-NMGtk-1_0 = 1.8.4-2.1
typelib-1_0-NMGtk-1_0(x86-64) = 1.8.4-2.1
- requires
libnm-gtk.so.0()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
typelib(Atk) = 1.0
typelib(DBusGLib) = 1.0
typelib(GLib) = 2.0
typelib(GModule) = 2.0
typelib(GObject) = 2.0
typelib(Gdk) = 3.0
typelib(GdkPixbuf) = 2.0
typelib(Gio) = 2.0
typelib(Gtk) = 3.0
typelib(NMClient) = 1.0
typelib(NetworkManager) = 1.0
typelib(Pango) = 1.0
typelib(cairo) = 1.0
typelib(xlib) = 2.0

1 new commit added

  • Rename everything gir10 to typelib, to stay in line with SUSE
6 years ago

massaged this a bit on the branch to get to provides in the form of
typelib(NMA)(x86-64) = 1.0
typelib(NMGtk)(x86-64) = 1.0

I rethought the concept again and made a second attempt ( borrowing more from SUSE )
new PR #4 and a corresponding system redhat-rpm-config change in https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/17

Pull-Request has been closed by yaneti

6 years ago