source: pkgmngt/packInstall.sh.porg@ 7bbcce3

new_features
Last change on this file since 7bbcce3 was 7bbcce3, checked in by Pierre Labastie <pierre@…>, 8 years ago

Fix "blfs_root" location in envars.conf, to match initial location
when installing BLFS tools.
Convert package names to lowercase in wrap and pack functions for porg, since
porg does that anyway

  • Property mode set to 100644
File size: 2.3 KB
Line 
1# $Id:$
2# functions for recording installation of a package and make a tarball,
3# or using fakeroot type commands for install, then packing and installing
4# the package.
5# We only have access to variables PKGDIR and PKG_DEST. Other variables could
6# be set in the environment
7
8wrapInstall() {
9# a bash command is passed as an argument (that may be a compound command).
10# It is executed by this function, after various set-ups...
11
12local PCKGVRS=$(basename $PKGDIR)
13local TGTPKG=$(basename $PKG_DEST)
14local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
15 sed 's/^[0-9]\{1\}-//')
16# Porg converts package names to lowercase anyway, so do the conversion
17# ourselves
18PACKAGE=${PACKAGE,,}
19# version is only accessible from PKGDIR name. Since the format of the
20# name is not normalized, several hacks are necessary...
21case $PCKGVRS in
22 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
23 vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
24 tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
25 docbook-xml) local VERSION=4.5 ;;
26 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
27 sed 's/_/./g');;
28# the last sed above is because some package managers do not want a '_'
29# in version.
30esac
31
32porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
33$*
34PORG_EOF
35}
36
37#----------------
38packInstall() {
39
40# With porg, we need only the package name to make the tarball
41local TGTPKG=$(basename $PKG_DEST)
42local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
43 sed 's/^[0-9]\{1\}-//')
44local PCKGVRS=$(basename $PKGDIR)
45# Porg converts package names to lowercase anyway, so do the conversion
46# ourselves
47PACKAGE=${PACKAGE,,}
48case $PCKGVRS in
49 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
50 vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
51 tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
52 docbook-xml) local VERSION=4.5 ;;
53 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
54 sed 's/_/./g');;
55# the last sed above is because some package managers do not want a '_'
56# in version.
57esac
58# Building the binary package
59porgball ${PACKAGE}
60# The package is in the current directory
61mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
62}
Note: See TracBrowser for help on using the repository browser.