ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] Adding sub-selection to package issue


From: Mike Goins
Subject: [Ltib] Adding sub-selection to package issue
Date: Fri, 28 Oct 2011 07:55:55 -0400

I was attempting to add a sub-selection to a package to toggle the
behavior of the build/install in a package spec file but having an
issue getting the PKG variable during the spec file ops.  I used the
symlink toggle from bash as an example.  My goal is to modify the
boost installation to get a "header-only" installation.


What I have done (trimmed out the relevant sections for brevity.

Added an entry in packages.lkc:

config PKG_BOOST_HEADER_ONLY
    depends PKG_BOOST
    bool "boost header only install"
    help
       Header only option for boost install


Modified the boost spec file to check the value of that config:


%Build
if [ "$PKG_BOOST_HEADER_ONLY" = "y" ]
then
echo "Headers only, no build"
else
export PATH=$UNSPOOF_PATH
./bootstrap.sh  --prefix=$RPM_BUILD_ROOT/%{pfx}/usr
--libdir=$RPM_BUILD_ROOT/%{pfx}/usr/lib --without-icu
export PATH=$SPOOF_PATH
echo "using gcc : $GNUTARCH : $CXX  ; " > tools/build/v2/user-config.jam
./bjam -d2 -q \
--toolset=gcc \
--layout=system \
--without-python \
-sZLIB_INCLUDE=$DEV_IMAGE/usr/include \
-sZLIB_LIBPATH=$DEV_IMAGE/usr/lib \
-sBZIP2_INCLUDE=$DEV_IMAGE/usr/include \
-sBZIP2_LIBPATH=$DEV_IMAGE/usr/lib \
stage
fi

(%Install is modified similarly but fails on the above already)


I added the check for rebuild in ltib itself:
# re-build the key (lhs) if any of the dependents (rhs) in the list have changed
$config_deps = {
....
           PKG_BOOST    => [ qw/PKG_BOOST_HEADER_ONLY/ ],
....


In the debug output I see the variable is getting set:

...
PKG_BOOST_HEADER_ONLY=y
...
PKG_ETHTOOL=
SYSCFG_TMPFS=tmpfs
PKG_BOOST=y
PKG_DISTCC=
PKG_BLUEZ_UTILS=
PKG_LIBPCAP=
...


The spec file is getting parsed correctly in the debug output:

Processing: boost
===================
...
install=rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT//opt/freescale/rootfs/i386/usr/include/boost
if [ "$PKG_BOOST_HEADER_ONLY" = "y" ]
then
cp -a boost $RPM_BUILD_ROOT//opt/freescale/rootfs/i386/usr/include/
else
./bjam -d2 -q \
--toolset=gcc \
--layout=system \
--without-python \
-sZLIB_INCLUDE=$DEV_IMAGE/include \
-sBZIP2_INCLUDE=$DEV_IMAGE/include \
install
fi
...

But when processing the spec file:
...
+ umask 022
+ cd /home/mike/rpm/BUILD
+ cd boost_1_43_0
+ '[' '' = y ']'
+ export PATH=.....


The '' = y test is missing the value for the variable PKG_BOOST_HEADER_ONLY

Does this config have to be somewhere else to get it visible in the
rpm spec file processing?  Is there something else I can check/debug
out?

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]