Nimbin[12]?Mirrors & Forks / jhalfs / pkgmngt/packInstall.sh.dpkg

jhalfs git · trunk

jhalfs LFS build automation (mirror)

lfs mirror bash · first commit 2005-09-11 · last commit 2024-02-13 (2 years ago) · synced 3 days ago · upstream: git.linuxfromscratch.org/jhalfs

Python 78.4% Shell 19.8% Makefile 1.8%
git clone https://git.christianimmanuel.de/mirrors-forks/jhalfs.gitwget https://git.christianimmanuel.de/mirrors-forks/jhalfs/archive/jhalfs.tar.gz
pkgmngt/packInstall.sh.dpkg 1.2 KB · 39 lines raw
# function for packing and installing a tree. We only have access
# to variables PKGDIR and PKG_DEST

packInstall() {

local PCKGVRS=$(basename $PKGDIR)
local TGTPKG=$(basename $PKG_DEST)
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3,4\}-//' |
           sed 's/^[0-9]\{2\}-//')
case $PCKGVRS in
  expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
  vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
  tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
  docbook-xml) local VERSION=4.5 ;;
  *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*-\([0-9]\)/\1/' |
                   sed 's/_/./g');;
# the last sed above is because dpkg does not want a '_' in version.
esac
local ARCHIVE_NAME=$(dirname ${PKGDIR})/${PACKAGE}_${VERSION}.deb
case $(uname -m) in
  x86_64) local ARCH=amd64 ;;
  *) local ARCH=i386 ;;
esac

pushd $PKG_DEST
rm -fv ./usr/share/info/dir
mkdir DEBIAN
cat > DEBIAN/control <<EOF
Package: $PACKAGE
Version: $VERSION
Maintainer: Pierre Labastie <lnimbus@club-internet.fr>
Description: $PACKAGE
Architecture: $ARCH
EOF
dpkg-deb -z9 -b . $ARCHIVE_NAME
dpkg -i $ARCHIVE_NAME
mv -v $ARCHIVE_NAME /var/lib/packages
popd
}