source: pkgmngt/packInstall.sh.porg@ dc315ea

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

Fixes for BLFS porg:

  • add a special case for cacerts in packInstall.sh, so that a dummy version is generated, otherwise porgball does not work as intended
  • do not quote out apostrophes in scripts, when generating configuration instructions
  • Property mode set to 100644
File size: 2.4 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 cacerts*) local VERSION=0.1 ;;
27 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
28 sed 's/_/./g');;
29# the last sed above is because some package managers do not want a '_'
30# in version.
31esac
32
33porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
34$*
35PORG_EOF
36}
37
38#----------------
39packInstall() {
40
41# With porg, we need only the package name to make the tarball
42local TGTPKG=$(basename $PKG_DEST)
43local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
44 sed 's/^[0-9]\{1\}-//')
45local PCKGVRS=$(basename $PKGDIR)
46# Porg converts package names to lowercase anyway, so do the conversion
47# ourselves
48PACKAGE=${PACKAGE,,}
49case $PCKGVRS in
50 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
51 vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
52 tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
53 docbook-xml) local VERSION=4.5 ;;
54 cacerts*) local VERSION=0.1 ;;
55 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
56 sed 's/_/./g');;
57# the last sed above is because some package managers do not want a '_'
58# in version.
59esac
60# Building the binary package
61porgball ${PACKAGE}
62# The package is in the current directory
63mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
64}
Note: See TracBrowser for help on using the repository browser.