source: pkgmngt/packInstall.sh.dpkg@ 8fb1daa

ablfs-more legacy trunk
Last change on this file since 8fb1daa was bd00951, checked in by Pierre Labastie <pierre@…>, 10 years ago

Add pacman as package manager.

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