source: pkgmngt/packInstall.sh.porg@ df42c7c

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

Porg style package management:

  • 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
  • Property mode set to 100644
File size: 2.1 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# version is only accessible from PKGDIR name. Since the format of the
17# name is not normalized, several hacks are necessary...
18case $PCKGVRS in
19 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
20 vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
21 tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
22 docbook-xml) local VERSION=4.5 ;;
23 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
24 sed 's/_/./g');;
25# the last sed above is because some package managers do not want a '_'
26# in version.
27esac
28
29porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
30$*
31PORG_EOF
32}
33
34#----------------
35packInstall() {
36
37# With porg, we need only the package name to make the tarball
38local TGTPKG=$(basename $PKG_DEST)
39local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
40 sed 's/^[0-9]\{1\}-//')
41local PCKGVRS=$(basename $PKGDIR)
42case $PCKGVRS in
43 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
44 vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
45 tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
46 docbook-xml) local VERSION=4.5 ;;
47 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
48 sed 's/_/./g');;
49# the last sed above is because some package managers do not want a '_'
50# in version.
51esac
52# Building the binary package
53porgball ${PACKAGE}
54# The package is in the current directory
55mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
56}
Note: See TracBrowser for help on using the repository browser.