source: pkgmngt/packInstall.sh.pacman@ 9593197

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

Remove special cases for vim and tidy in packInstall.sh.pacman

  • Property mode set to 100644
File size: 1.9 KB
Line 
1# $Id$
2# function for packing and installing a tree. We only have access
3# to variables PKGDIR and PKG_DEST
4# Other variables can be passed on the command line, or in the environment
5
6packInstall() {
7
8# A proposed implementation for versions and package names.
9local PCKGVRS=$(basename $PKGDIR)
10local TGTPKG=$(basename $PKG_DEST)
11local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
12 sed 's/^[0-9]\{1\}-//')
13# version is only accessible from PKGDIR name. Since the format of the
14# name is not normalized, several hacks are necessary...
15case $PCKGVRS in
16 expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
17 unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
18 docbook-xml) local VERSION=4.5 ;;
19 *) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
20 sed 's/_/./g');;
21# the last sed above is because some package managers do not want a '_'
22# in version.
23esac
24case $(uname -m) in
25 x86_64) local ARCH=x86_64 ;;
26 *) local ARCH=i686 ;;
27esac
28local ARCHIVE_NAME=${PACKAGE}-${VERSION}-1-${ARCH}.pkg.tar.gz
29
30pushd $PKG_DEST
31rm -fv ./usr/share/info/dir # recommended since this directory is already there
32 # on the system
33# Right now, we have the files in the current directory. They should be moved
34# to /sources/$PACKAGE/src.
35mkdir -p ../$PACKAGE/src
36mv * ../$PACKAGE/src
37
38cat > PKGBUILD <<EOF
39pkgname=( '$PACKAGE' )
40pkgver=$VERSION
41pkgrel=1
42pkgdesc=$PACKAGE
43arch=( '$ARCH' )
44
45package() {
46mv * \$pkgdir
47}
48EOF
49# Building the binary package
50makepkg --asroot -c --skipinteg
51# Installing it on LFS
52if ! pacman -U --noconfirm $ARCHIVE_NAME; then
53 pacman -U --noconfirm --force $ARCHIVE_NAME
54fi
55popd # Since the $PKG_DEST directory is destroyed
56 # immediately after the return of the function,
57 # getting back to $PKGDIR is important...
58}
Note: See TracBrowser for help on using the repository browser.