df42c7cff7
- Add new variable WRAP_INSTALL in COnfig.in and jhalfs - Generates the install commands inside a wrapper function - Add files packInstall.sh.porg and packageManager.xml.porg - TODO: update README.PACKAGE... - TODO: make new templates in pkgmngt and document them
56 lines
2.1 KiB
Text
56 lines
2.1 KiB
Text
# $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
|
|
|
|
wrapInstall() {
|
|
# a bash command is passed as an argument (that may be a compound command).
|
|
# It is executed by this function, after various set-ups...
|
|
|
|
local PCKGVRS=$(basename $PKGDIR)
|
|
local TGTPKG=$(basename $PKG_DEST)
|
|
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
|
|
sed 's/^[0-9]\{1\}-//')
|
|
# version is only accessible from PKGDIR name. Since the format of the
|
|
# name is not normalized, several hacks are necessary...
|
|
case $PCKGVRS in
|
|
expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
|
|
vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
|
|
tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
|
|
docbook-xml) local VERSION=4.5 ;;
|
|
*) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
|
|
sed 's/_/./g');;
|
|
# the last sed above is because some package managers do not want a '_'
|
|
# in version.
|
|
esac
|
|
|
|
porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
|
|
$*
|
|
PORG_EOF
|
|
}
|
|
|
|
#----------------
|
|
packInstall() {
|
|
|
|
# With porg, we need only the package name to make the tarball
|
|
local TGTPKG=$(basename $PKG_DEST)
|
|
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
|
|
sed 's/^[0-9]\{1\}-//')
|
|
local PCKGVRS=$(basename $PKGDIR)
|
|
case $PCKGVRS in
|
|
expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
|
|
vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
|
|
tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
|
|
docbook-xml) local VERSION=4.5 ;;
|
|
*) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
|
|
sed 's/_/./g');;
|
|
# the last sed above is because some package managers do not want a '_'
|
|
# in version.
|
|
esac
|
|
# Building the binary package
|
|
porgball ${PACKAGE}
|
|
# The package is in the current directory
|
|
mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
|
|
}
|