source: pkgmngt/packInstall.sh.dpkg@ 2453b766

new_features
Last change on this file since 2453b766 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
RevLine 
[4c6f54f]1# $Id$
[7072e1f]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 ;;
[b9c3497]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.
[7072e1f]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
[b9c3497]36dpkg-deb -z9 -b . $ARCHIVE_NAME
[7072e1f]37dpkg -i $ARCHIVE_NAME
38mv -v $ARCHIVE_NAME /var/lib/packages
39popd
40}
Note: See TracBrowser for help on using the repository browser.