2016-07-21 18:43:35 +02:00
|
|
|
# $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\}-//')
|
2016-08-25 12:04:30 +02:00
|
|
|
# Porg converts package names to lowercase anyway, so do the conversion
|
|
|
|
# ourselves
|
|
|
|
PACKAGE=${PACKAGE,,}
|
2016-07-21 18:43:35 +02:00
|
|
|
# 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)
|
2016-08-25 12:04:30 +02:00
|
|
|
# Porg converts package names to lowercase anyway, so do the conversion
|
|
|
|
# ourselves
|
|
|
|
PACKAGE=${PACKAGE,,}
|
2016-07-21 18:43:35 +02:00
|
|
|
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
|
|
|
|
}
|