PKG_CONFIG_PATH
environment variable. Depending on what is defined in your .pc files, update the PKG_CONFIG_PATH
environment variable for the %{_libdir}
macro (which expands to the library directory, typically /usr/lib/
or /usr/lib64/
), or for the %{_datadir}
macro (which expands to the share directory, typically /usr/share/
).
PKG_CONFIG_PATH
environment variable by adjusting the %install
section of the Software Collection spec file as follows:
%install cat >> %{buildroot}%{_scl_scripts}/enable << EOF export PKG_CONFIG_PATH=%{_libdir}/pkgconfig:\$PKG_CONFIG_PATH EOF
PKG_CONFIG_PATH
environment variable by adjusting the %install
section of the Software Collection spec file as follows:
%install cat >> %{buildroot}%{_scl_scripts}/enable << EOF export PKG_CONFIG_PATH=%{_datadir}/pkgconfig:\$PKG_CONFIG_PATH EOF
enable
scriptlet so that it ensures that the .pc files in the Software Collection are preferred over the .pc files available on the system if the Software Collection is enabled.
/usr/bin/
directory. In this case, ensure that the .pc files are visible to the system even if the Software Collection is disabled.
PKG_CONFIG_PATH
environment variable with the paths to the .pc files associated with the Software Collection. Depending on what is defined in your .pc files, update the PKG_CONFIG_PATH
environment variable for the %{_libdir}
macro (which expands to the library directory), or for the %{_datadir}
macro (which expands to the share directory).
Procedure 3.2. Updating the PKG_CONFIG_PATH environment variable for %{_libdir}
PKG_CONFIG_PATH
environment variable for the %{_libdir}
macro, create a custom script /etc/profile.d/name.sh
. The script is preloaded when a shell is started on the system.
%{?scl_prefix}pc-libdir.sh
pc-libdir.sh
short script that modifies the PKG_CONFIG_PATH
variable to refer to your .pc files:
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig:/opt/provider/software_collection/path/to/your/pc_files
SOURCE2: %{?scl_prefix}pc-libdir.sh
/etc/profile.d/
directory by adjusting the %install
section of the Software Collection package's spec file:
%install install -p -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{?scl:%_root_sysconfdir}%{!?scl:%_sysconfdir}/profile.d/
Procedure 3.3. Updating the PKG_CONFIG_PATH environment variable for %{_datadir}
PKG_CONFIG_PATH
environment variable for the %{_datadir}
macro, create a custom script /etc/profile.d/name.sh
. The script is preloaded when a shell is started on the system.
%{?scl_prefix}pc-datadir.sh
pc-datadir.sh
short script that modifies the PKG_CONFIG_PATH
variable to refer to your .pc files:
export PKG_CONFIG_PATH=%{_datadir}/pkgconfig:/opt/provider/software_collection/path/to/your/pc_files
SOURCE2: %{?scl_prefix}pc-datadir.sh
/etc/profile.d/
directory by adjusting the %install
section of the Software Collection package's spec file:
%install install -p -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{?scl:%_root_sysconfdir}%{!?scl:%_sysconfdir}/profile.d/