Fix multilib -devel installation issues

- Resolves: #718404
This commit is contained in:
Colin Walters 2012-09-27 16:17:15 -04:00
parent 050c8393ad
commit fc5f7e2caf
2 changed files with 99 additions and 7 deletions

56
codegen-in-datadir.patch Normal file
View File

@ -0,0 +1,56 @@
From 24af7308b1268f1b4a6cae74ce68ee283bcb2a62 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Thu, 27 Sep 2012 20:11:27 -0400
Subject: [PATCH] codegen: Install Python files in $(datadir)/glib-2.0, rather
than $(libdir)
These files are actually architecture-indepdendent; using $(libdir)
for them means that /usr/bin/gdbus-codegen varies between
architectures, which is problematic for (mis)uses of multilib.
See https://bugzilla.redhat.com/show_bug.cgi?id=718404
https://bugzilla.gnome.org/show_bug.cgi?id=685012
---
gio/gdbus-2.0/codegen/Makefile.am | 4 ++--
gio/gdbus-2.0/codegen/gdbus-codegen.in | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gio/gdbus-2.0/codegen/Makefile.am b/gio/gdbus-2.0/codegen/Makefile.am
index 39349ce..5111487 100644
--- a/gio/gdbus-2.0/codegen/Makefile.am
+++ b/gio/gdbus-2.0/codegen/Makefile.am
@@ -5,7 +5,7 @@ bin_SCRIPTS =
CLEANFILES =
EXTRA_DIST =
-codegendir = $(libdir)/gdbus-2.0/codegen
+codegendir = $(datadir)/glib-2.0/codegen
codegen_PYTHON = \
__init__.py \
codegen.py \
@@ -24,7 +24,7 @@ CLEANFILES += gdbus-codegen
EXTRA_DIST += gdbus-codegen.in
gdbus-codegen: gdbus-codegen.in Makefile $(codegen_PYTHON)
- $(AM_V_GEN) sed -e 's,@libdir\@,$(libdir),' -e 's,@PYTHON\@,$(PYTHON),' $< > $@.tmp && mv $@.tmp $@
+ $(AM_V_GEN) sed -e 's,@datadir\@,$(datadir),' -e 's,@PYTHON\@,$(PYTHON),' $< > $@.tmp && mv $@.tmp $@
@chmod a+x $@
clean-local:
diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
index 217c755..253d151 100644
--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
@@ -33,7 +33,7 @@ elif os.name == 'nt':
# Makes gdbus-codegen 'relocatable' at runtime on Windows.
path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gdbus-2.0')
else:
- path = os.path.join('@libdir@', 'gdbus-2.0')
+ path = os.path.join('@datadir@', 'glib-2.0')
sys.path.insert(0, os.path.abspath(path))
from codegen import codegen_main
--
1.7.11.4

View File

@ -1,13 +1,15 @@
Summary: A library of handy utility functions
Name: glib2
Version: 2.34.0
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
#VCS: git:git://git.gnome.org/glib
Source: http://download.gnome.org/sources/glib/2.34/glib-%{version}.tar.xz
Patch0: codegen-in-datadir.patch
BuildRequires: pkgconfig
BuildRequires: gamin-devel
BuildRequires: gettext
@ -45,10 +47,23 @@ Obsoletes: glib2-static < 2.32.1-2
%description devel
The glib2-devel package includes the header files for the GLib library.
%package doc
Summary: A library of handy utility functions
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
The glib2-doc package includes documentation for the GLib library.
%prep
%setup -q -n glib-%{version}
%patch0 -p1
%build
# Rerun autotools for the above patch
rm -f configure
# Support builds of both git snapshots and tarballs packed with autogoo
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
%configure $CONFIGFLAGS \
@ -59,13 +74,27 @@ The glib2-devel package includes the header files for the GLib library.
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Use -p to preserve timestamps on .py files to ensure
# they're not recompiled with different timestamps
# to help multilib: https://bugzilla.redhat.com/show_bug.cgi?id=718404
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p -c"
# Also since this is a generated .py file, set it to a known timestamp,
# otherwise it will vary by build time, and thus break multilib -devel
# installs.
touch -r gio/gdbus-2.0/codegen/config.py.in $RPM_BUILD_ROOT/%{_datadir}/glib-2.0/codegen/config.py
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/*.so
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gio/modules/*.{a,la}
rm -f $RPM_BUILD_ROOT%{_datadir}/glib-2.0/gdb/*.{pyc,pyo}
rm -f $RPM_BUILD_ROOT%{_libdir}/gdbus-codegen/*.{pyc,pyo}
rm -f $RPM_BUILD_ROOT%{_datadir}/glib-2.0/codegen/*.{pyc,pyo}
# Multilib fixes for systemtap tapsets; see
# https://bugzilla.redhat.com/718404
for f in $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/*.stp; do
(dn=$(dirname ${f}); bn=$(basename ${f});
mv ${f} ${dn}/%{__isa_bits}-${bn})
done
mv $RPM_BUILD_ROOT%{_bindir}/gio-querymodules $RPM_BUILD_ROOT%{_bindir}/gio-querymodules-%{__isa_bits}
@ -124,8 +153,6 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%{_datadir}/glib-2.0/gettext
%{_datadir}/glib-2.0/schemas/gschema.dtd
%{_datadir}/bash-completion/completions/gresource
# %{_datadir}/glib-2.0/gdb/*.pyo
# %{_datadir}/glib-2.0/gdb/*.pyc
%{_bindir}/glib-genmarshal
%{_bindir}/glib-gettextize
%{_bindir}/glib-mkenums
@ -134,9 +161,8 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%{_bindir}/gdbus-codegen
%{_bindir}/glib-compile-resources
%{_bindir}/gresource
%{_libdir}/gdbus-2.0/codegen
%{_datadir}/glib-2.0/codegen
%attr (0755, root, root) %{_bindir}/gtester-report
%doc %{_datadir}/gtk-doc/html/*
%doc %{_mandir}/man1/glib-genmarshal.1.gz
%doc %{_mandir}/man1/glib-gettextize.1.gz
%doc %{_mandir}/man1/glib-mkenums.1.gz
@ -150,7 +176,17 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%{_datadir}/gdb/auto-load%{_libdir}/libgobject-2.0.so.*-gdb.py*
%{_datadir}/systemtap/tapset/*.stp
%files doc
%doc %{_datadir}/gtk-doc/html/*
%changelog
* Thu Sep 27 2012 Colin Walters <walters@verbum.org> - 2.34.0-2
- Use install -p to preserve timestamps on .py files
- Rename systemtap tapsets with architecture-specific prefix
- Pull upstream patch to avoid conflict on /usr/bin/gdbus-codegen
- Split gtk-doc off into -doc package to avoid multilib conflicts
- Resolves: #718404
* Mon Sep 24 2012 Kalev Lember <kalevlember@gmail.com> - 2.34.0-1
- Update to 2.34.0