2018-05-20 07:24:31 +00:00
#
# spec file for package pkgconf
#
2023-01-30 12:44:21 +00:00
# Copyright (c) 2023 SUSE LLC
2020-08-10 05:07:59 +00:00
# Copyright (c) 2020 Neal Gompa <ngompa13@gmail.com>.
2018-05-20 07:24:31 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2019-05-01 12:42:47 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2018-05-20 07:24:31 +00:00
#
# Compatibility macros
%{!?make_build: %global make_build %{__make} %{?_smp_mflags} }
2019-05-01 12:42:47 +00:00
%{!?_rpmmacrodir: %global _rpmmacrodir %{_rpmconfigdir} /macros.d}
2018-05-20 07:24:31 +00:00
2019-07-15 00:07:11 +00:00
# pkgconf acts as pkgconfig for Tumbleweed (post SUSE Linux 15)
%if 0%{?suse_version} >= 1550
%bcond_without pkgconfig_compat
%else
2018-05-20 07:24:31 +00:00
%bcond_with pkgconfig_compat
2019-07-15 00:07:11 +00:00
%endif
2018-05-20 07:24:31 +00:00
%if %{with pkgconfig_compat}
%global pkgconfig_ver 0.29.2
# For obsoleting pkgconfig, bump the ver to a number higher than latest version
%global pkgconfig_obsver %{pkgconfig_ver} +1
%endif
2019-08-05 12:52:20 +00:00
# pkgconfig platform
%global pkgconf_target_platform %{_target_platform}%{?_gnu}
2018-05-20 07:24:31 +00:00
# Search path for pc files for pkgconf
%global pkgconf_libdirs %{_libdir} /pkgconfig:%{_datadir} /pkgconfig
%global somajor 3
%global libname lib%{name} %{somajor}
%global devname lib%{name} -devel
Name : pkgconf
2021-08-23 12:54:47 +00:00
Version : 1.8.0
2018-05-20 07:24:31 +00:00
Release : 0
Summary : Package compiler and linker metadata toolkit
License : ISC
2018-06-20 10:56:17 +00:00
Group : Development/Tools/Building
2018-05-20 07:24:31 +00:00
URL : http://pkgconf.org/
Source0 : https://distfiles.dereferenced.org/%{name} /%{name} -%{version} .tar.xz
# Simple wrapper script to offer platform versions of pkgconfig from Fedora
Source1 : platform-pkg-config.in
2023-01-30 12:44:21 +00:00
# PATCH-FIX-UPSTREAM pkgconf-CVE-2023-24056.patch bsc#1207394 CVE-2023-24056 qzhao@suse.com -- Backport commit 628b2b2baf from upstream, test for, and stop string processing, on truncation.
Patch0 : pkgconf-CVE-2023-24056.patch
2018-05-20 07:24:31 +00:00
# For regenerating autotools scripts
BuildRequires : autoconf
BuildRequires : automake
2021-04-07 17:00:12 +00:00
BuildRequires : gcc
2018-05-20 07:24:31 +00:00
BuildRequires : libtool
2021-04-07 17:00:12 +00:00
BuildRequires : make
2018-05-20 07:24:31 +00:00
# pkgconf uses libpkgconf internally
Requires : %{libname} %{?_isa} = %{version} -%{release}
# This is defined within pkgconf code as a virtual pc (just like in pkgconfig)
Provides : pkgconfig(pkgconf) = %{version}
%description
pkgconf is a program which helps to configure compiler and linker flags
for development frameworks. It is similar to pkg-config from freedesktop.org
and handles .pc files in a similar manner as pkg-config.
%package -n %{libname}
Summary : Backend library for %{name}
2018-06-20 10:56:17 +00:00
License : ISC
2018-05-20 07:24:31 +00:00
Group : System/Libraries
%description -n %{libname}
This package provides libraries for applications to use the functionality
of %{name} .
%package -n %{devname}
Summary : Development files for lib%{name}
2018-06-20 10:56:17 +00:00
License : ISC
2018-05-20 07:24:31 +00:00
Group : Development/Libraries/C and C++
2021-04-07 17:00:12 +00:00
Requires : %{libname} %{?_isa} = %{version} -%{release}
2018-08-21 12:33:10 +00:00
# Avoid dependency loop on itself by specifying the Provides directly
Provides : pkgconfig(libpkgconf) = %{version}
2018-05-20 07:24:31 +00:00
%description -n %{devname}
This package provides files necessary for developing applications
to use functionality provided by %{name} .
%if %{with pkgconfig_compat}
%package m4
Summary : m4 macros for pkgconf
2019-07-15 00:29:04 +00:00
License : GPL-2.0-or-later WITH Autoconf-exception-2.0
2018-06-20 10:56:17 +00:00
Group : Development/Libraries/Other
2018-05-20 07:24:31 +00:00
BuildArch : noarch
# Ensure that it Conflicts and Obsoletes pkgconfig since it contains content formerly from it
Conflicts : pkgconfig < %{pkgconfig_obsver}
Obsoletes : pkgconfig < %{pkgconfig_obsver}
%description m4
This package includes m4 macros used to support PKG_CHECK_MODULES
when using pkgconf with autotools.
%package pkg-config
Summary : %{name} shim to provide /usr/bin/pkg-config
# Ensure that it Conflicts with pkg-config and is considered "better"
2018-06-20 10:56:17 +00:00
License : ISC
Group : Development/Tools/Building
2018-05-20 07:24:31 +00:00
Conflicts : pkg-config < %{pkgconfig_obsver}
Obsoletes : pkg-config < %{pkgconfig_obsver}
Provides : pkg-config = %{pkgconfig_obsver}
Provides : pkg-config%{?_isa} = %{pkgconfig_obsver}
# This is in the original pkgconfig package, set to match output from pkgconf
Provides : pkgconfig(pkg-config) = %{version}
# Fedora/Mageia pkgconfig Provides for those who might use alternate package name
Provides : pkgconfig = %{pkgconfig_obsver}
Provides : pkgconfig%{?_isa} = %{pkgconfig_obsver}
Requires : %{name} %{?_isa} = %{version} -%{release}
Requires : %{name} -m4 = %{version} -%{release}
%description pkg-config
This package provides the shim links for pkgconf to be automatically
used in place of pkgconfig. This ensures that pkgconf is used as
the system provider of pkg-config.
%endif
%prep
%autosetup -p1
%build
autoreconf -fiv
%configure --disable-static \
--with-pkg-config-dir=%{pkgconf_libdirs} \
--with-system-includedir=%{_includedir} \
--with-system-libdir=%{_libdir}
2021-04-07 17:00:12 +00:00
%make_build
2018-05-20 07:24:31 +00:00
%install
%make_install
2021-04-07 17:00:12 +00:00
find %{buildroot} -type f -name " * . l a " -delete -print
2018-05-20 07:24:31 +00:00
2019-05-01 12:42:47 +00:00
mkdir -p %{buildroot} %{_sysconfdir} /pkgconfig/personality.d
mkdir -p %{buildroot} %{_datadir} /pkgconfig/personality.d
# pkgconf rpm macros
mkdir -p %{buildroot} %{_rpmmacrodir} /
cat > %{buildroot} %{_rpmmacrodir} /macros.pkgconf <<EOM
%%pkgconfig_personalitydir %{_datadir} /pkgconfig/personality.d
EOM
2018-05-20 07:24:31 +00:00
# Purge autotools-created docdir, as we'll docify with the SUSE-specific documentation paths later
rm -rf %{buildroot} %{_datadir} /doc/%{name}
%if %{with pkgconfig_compat}
2019-08-05 12:52:20 +00:00
install -pm 0755 %{SOURCE1} %{buildroot} %{_bindir} /%{pkgconf_target_platform} -pkg-config
2018-05-20 07:24:31 +00:00
2019-08-05 12:52:20 +00:00
sed -e " s | @ T A R G E T _ P L A T F O R M @ | %{pkgconf_target_platform} | " \
2020-08-10 05:07:59 +00:00
-e " s | @ P K G C O N F _ L I B D I R S _ L O C A L @ | / u s r / l o c a l / % { _ l i b } / p k g c o n f i g : / u s r / l o c a l / s h a r e / p k g c o n f i g : %{pkgconf_libdirs} | " \
-e " s | @ P K G C O N F _ S Y S L I B D I R _ L O C A L @ | / u s r / l o c a l / % { _ l i b } : %{_libdir} | " \
-e " s | @ P K G C O N F _ S Y S I N C D I R _ L O C A L @ | / u s r / l o c a l / i n c l u d e : %{_includedir} | " \
2018-05-20 07:24:31 +00:00
-e " s | @ P K G C O N F _ L I B D I R S @ | %{pkgconf_libdirs} | " \
-e " s | @ P K G C O N F _ S Y S L I B D I R @ | %{_libdir} | " \
-e " s | @ P K G C O N F _ S Y S I N C D I R @ | %{_includedir} | " \
2019-08-05 12:52:20 +00:00
-i %{buildroot} %{_bindir} /%{pkgconf_target_platform} -pkg-config
2018-05-20 07:24:31 +00:00
2020-08-10 05:07:59 +00:00
ln -sr %{buildroot} %{_bindir} /%{pkgconf_target_platform} -pkg-config %{buildroot} %{_bindir} /pkg-config
2018-05-20 07:24:31 +00:00
2019-05-01 12:42:47 +00:00
# Link pkg-config(1) to pkgconf(1)
echo " . s o m a n 1 / p k g c o n f . 1 " > %{buildroot} %{_mandir} /man1/pkg-config.1
2018-05-20 07:24:31 +00:00
mkdir -p %{buildroot} %{_libdir} /pkgconfig
mkdir -p %{buildroot} %{_datadir} /pkgconfig
%endif
# If we're not providing pkgconfig override & compat
# we should not provide the pkgconfig m4 macros
%if ! %{with pkgconfig_compat}
rm -rf %{buildroot} %{_datadir} /aclocal
rm -rf %{buildroot} %{_mandir} /man7
%endif
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%license COPYING
%doc README.md AUTHORS NEWS
%{_bindir} /%{name}
%{_mandir} /man1/%{name} .1*
%{_mandir} /man5/pc.5*
2018-08-21 12:33:10 +00:00
%{_mandir} /man5/%{name} -personality.5*
2019-05-01 12:42:47 +00:00
%{_rpmmacrodir} /macros.pkgconf
%dir %{_sysconfdir} /pkgconfig
%dir %{_sysconfdir} /pkgconfig/personality.d
%dir %{_datadir} /pkgconfig/personality.d
2018-05-20 07:24:31 +00:00
%files -n %{libname}
%license COPYING
%{_libdir} /lib%{name} *.so.%{somajor}
%{_libdir} /lib%{name} *.so.%{somajor} .*
%files -n %{devname}
%{_libdir} /lib%{name} *.so
%{_includedir} /%{name} /
%{_libdir} /pkgconfig/lib%{name} .pc
%if %{with pkgconfig_compat}
%files m4
2019-08-09 00:20:10 +00:00
%dir %{_datadir} /aclocal
2018-05-20 07:24:31 +00:00
%{_datadir} /aclocal/pkg.m4
2021-04-07 17:00:12 +00:00
%{_mandir} /man7/pkg.m4.7%{?ext_man}
2018-05-20 07:24:31 +00:00
%files pkg-config
%{_bindir} /pkg-config
2019-08-05 12:52:20 +00:00
%{_bindir} /%{pkgconf_target_platform} -pkg-config
2021-04-07 17:00:12 +00:00
%{_mandir} /man1/pkg-config.1%{?ext_man}
2018-05-20 07:24:31 +00:00
%endif
%changelog