# $Id$ # functions for recording installation of a package and make a tarball, # or using fakeroot type commands for install, then packing and installing # the package. # We only have access to variables PKGDIR and PKG_DEST. Other variables could # be set in the environment extract_version() { local VERSION case $1 in expect*|tcl*|tk*|mozjs*|lynx*) VERSION=$(echo $1 | sed 's/^[^0-9]*//') ;; unzip*|zip*) VERSION=$(echo $1 | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;; wireless_tools*|LVM2*) VERSION=$(echo $1 | sed 's/^[^.]*\.//') ;; x264*) VERSION=$(echo $1 | sed 's/.*shot-//') ;; icu*) # No version in PCKGVRS! Use version directly from xml book. # JH_PACK_INSTALL contains the path to this script, which is in the # parent dir of the book. local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent local VERSION1=$(sed -n 's/.*icu-major[^0-9]*\([^"]*\).*/\1/p' $PACKENT) local VERSION2=$(sed -n 's/.*icu-minor[^0-9]*\([^"]*\).*/\1/p' $PACKENT) VERSION=$VERSION1.$VERSION2 ;; exiv*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*exiv2[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; flashplayer*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*flashplayer[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; pax*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*pax[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; psutils*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*psutils[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; soundtouch*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*soundtouch[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; unrar*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*unrar[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; xvid*) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/packages.ent VERSION=$(sed -n 's/.*xvid[^0-9]*\([^"]*\).*/\1/p' $PACKENT) ;; xf86-video-intel) local PACKENT=$(dirname $JH_PACK_INSTALL)/blfs-xml/x/installing/x7driver-intel.xml VERSION=$(sed -n '/