diff --git a/pkgconf.spec b/pkgconf.spec index aa4b661..cf08277 100644 --- a/pkgconf.spec +++ b/pkgconf.spec @@ -12,15 +12,21 @@ %global pkgconfig_evr 1:%{pkgconfig_verrel} %endif +# Search path for pc files for pkgconf +%global pkgconf_libdirs %{_libdir}/pkgconfig:%{_datadir}/pkgconfig + Name: pkgconf Version: 1.3.90 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Package compiler and linker metadata toolkit License: ISC URL: http://pkgconf.org/ Source0: https://distfiles.dereferenced.org/%{name}/%{name}-%{version}.tar.xz +# Simple wrapper script to offer platform versions of pkgconfig +Source1: platform-pkg-config.in + BuildRequires: gcc BuildRequires: make @@ -101,7 +107,7 @@ the system provider of pkg-config. %build autoreconf -fiv %configure --disable-static \ - --with-pkg-config-dir=%{_libdir}/pkgconfig:%{_datadir}/pkgconfig \ + --with-pkg-config-dir=%{pkgconf_libdirs} \ --with-system-includedir=%{_includedir} \ --with-system-libdir=%{_libdir} @@ -118,8 +124,15 @@ make check find %{buildroot} -name '*.la' -print -delete %if %{with pkgconfig_compat} +install -pm 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{_target_platform}-pkg-config + +sed -e "s|@TARGET_PLATFORM@|%{_target_platform}|" \ + -e "s|@PKGCONF_LIBDIRS@|%{pkgconf_libdirs}|" \ + -e "s|@PKGCONF_SYSLIBDIR@|%{_libdir}|" \ + -e "s|@PKGCONF_SYSINCDIR@|%{_includedir}|" \ + -i %{buildroot}%{_bindir}/%{_target_platform}-pkg-config + ln -sf pkgconf %{buildroot}%{_bindir}/pkg-config -ln -sf pkgconf %{buildroot}%{_bindir}/%{_target_platform}-pkg-config # I don't have a better way to deal with this... cp -a %{buildroot}%{_mandir}/man1/pkgconf.1 %{buildroot}%{_mandir}/man1/pkg-config.1 @@ -168,6 +181,9 @@ rm -rf %{buildroot}%{_datadir}/aclocal %endif %changelog +* Fri Jan 05 2018 Neal Gompa - 1.3.90-2 +- Add simple wrapper to support platform-specific pkg-config paths (#1513810) + * Tue Dec 19 2017 Igor Gnatenko - 1.3.90-1 - Update to 1.3.90 diff --git a/platform-pkg-config.in b/platform-pkg-config.in new file mode 100644 index 0000000..f200eb3 --- /dev/null +++ b/platform-pkg-config.in @@ -0,0 +1,12 @@ +#!/bin/bash + +# Simple wrapper to tell pkgconf to behave as a platform-specific version of pkg-config +# Platform: @TARGET_PLATFORM@ + +export PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:-@PKGCONF_LIBDIRS@}" +export PKG_CONFIG_SYSTEM_LIBRARY_PATH="${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-@PKGCONF_SYSLIBDIR@}" +export PKG_CONFIG_SYSTEM_INCLUDE_PATH="${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-@PKGCONF_SYSINCDIR@}" + +pkgconf $@ + +exit $?