From ac4bf07a6503a65c11209ee137287c316a5e95fc Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 14 Oct 2020 22:35:57 -0400 Subject: [PATCH] Make /usr/bin/pkg-config multilib safe --- pkg-config.in | 7 +++++++ pkgconf.spec | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 pkg-config.in diff --git a/pkg-config.in b/pkg-config.in new file mode 100644 index 0000000..a5cf821 --- /dev/null +++ b/pkg-config.in @@ -0,0 +1,7 @@ +#!/bin/sh + +# Multilib safe wrapper for pkg-config to call correct platform-specific version of pkg-config + +HOST_PLATFORM=$(rpm --eval "%{_host}") + +exec "@PKGCONF_BINDIR@/${HOST_PLATFORM}-pkg-config" "$@" diff --git a/pkgconf.spec b/pkgconf.spec index 5ce3e02..1d30b1b 100644 --- a/pkgconf.spec +++ b/pkgconf.spec @@ -17,7 +17,7 @@ Name: pkgconf Version: 1.7.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Package compiler and linker metadata toolkit License: ISC @@ -25,8 +25,9 @@ URL: http://pkgconf.org/ # Mirror at https://releases.pagure.org/pkgconf/pkgconf/ Source0: https://distfiles.dereferenced.org/%{name}/%{name}-%{version}.tar.xz -# Simple wrapper script to offer platform versions of pkgconfig +# Simple wrapper scripts to offer platform versions of pkgconfig Source1: platform-pkg-config.in +Source2: pkg-config.in BuildRequires: gcc BuildRequires: make @@ -146,7 +147,10 @@ sed -e "s|@TARGET_PLATFORM@|%{_target_platform}|" \ -e "s|@PKGCONF_SYSINCDIR@|%{_includedir}|" \ -i %{buildroot}%{_bindir}/%{_target_platform}-pkg-config -ln -sr %{buildroot}%{_bindir}/%{_target_platform}-pkg-config %{buildroot}%{_bindir}/pkg-config +install -pm 0755 %{SOURCE2} %{buildroot}%{_bindir}/pkg-config + +sed -e "s|@PKGCONF_BINDIR@|%{_bindir}|" \ + -i %{buildroot}%{_bindir}/pkg-config # Link pkg-config(1) to pkgconf(1) echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/pkg-config.1 @@ -198,6 +202,9 @@ rm -rf %{buildroot}%{_datadir}/aclocal %endif %changelog +* Thu Oct 15 2020 Neal Gompa - 1.7.3-3 +- Make /usr/bin/pkg-config multilib safe + * Mon Aug 10 2020 Neal Gompa - 1.7.3-2 - Add /usr/local paths to pkg-config(1) search path for non RPM builds