source: pkgmngt/packInstall.sh.dpkg@ 86debb0

ablfs-more trunk
Last change on this file since 86debb0 was fd4a798, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove $Id$ comments, they are useless with git

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[7072e1f]1# function for packing and installing a tree. We only have access
2# to variables PKGDIR and PKG_DEST
3
4packInstall() {
5
6local PCKGVRS=$(basename $PKGDIR)
7local TGTPKG=$(basename $PKG_DEST)
[89bcb1b]8local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3,4\}-//' |
[3ac3ae1]9 sed 's/^[0-9]\{2\}-//')
[7072e1f]10case $PCKGVRS in
11 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
12 vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
13 tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
14 docbook-xml) local VERSION=4.5 ;;
[b9c3497]15 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*-\([0-9]\)/\1/' |
16 sed 's/_/./g');;
17# the last sed above is because dpkg does not want a '_' in version.
[7072e1f]18esac
19local ARCHIVE_NAME=$(dirname ${PKGDIR})/${PACKAGE}_${VERSION}.deb
20case $(uname -m) in
21 x86_64) local ARCH=amd64 ;;
22 *) local ARCH=i386 ;;
23esac
24
25pushd $PKG_DEST
26rm -fv ./usr/share/info/dir
27mkdir DEBIAN
28cat > DEBIAN/control <<EOF
29Package: $PACKAGE
30Version: $VERSION
31Maintainer: Pierre Labastie <lnimbus@club-internet.fr>
32Description: $PACKAGE
33Architecture: $ARCH
34EOF
[b9c3497]35dpkg-deb -z9 -b . $ARCHIVE_NAME
[7072e1f]36dpkg -i $ARCHIVE_NAME
37mv -v $ARCHIVE_NAME /var/lib/packages
38popd
39}
Note: See TracBrowser for help on using the repository browser.