You are not logged in.

#1 2008-11-14 06:56:07

zodmaner
Member
Registered: 2007-07-11
Posts: 653

[PKGBUILD] bin32-lha 1.17

Hi guys.

This is my first PKGBUILD, which is mostly just a slightly edit of the original one. Still, since this my very first PKGBUILD, I would like to hear the opinions of your guys to make sure I didn't screw up something. smile

The reason for this PKGBUILD is that the lha package in x86_64 extra repository is currently not functional, because it is in fact a 32 bit binary. Since the developer does not provide source, nor binary for 64 bit, our only option to get the package working on 64 bit Arch is to either roll back to the older version, or install the necessary 32 bit library to get the current version working (which is what this PKGBUILD aim to do).

# Contributor: Smith Dhumbumroong <zodmaner@gmail.com> Based on PKGBUILD by Tom Newsom <Jeepster@gmx.co.uk>

pkgname=bin32-lha
pkgver=1.17
pkgrel=1
pkgdesc="lha is a compression and archive utility for LH-7 format archives"
arch=(x86_64)
depends=('lib32-glibc')
source=(http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/linux/lha117.tar.gz)
conflicts=('lha')
provides=('lha=1.17')
url="http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/"
md5sums=('7896188203cfaf5782d153c4dcd19f57')

build() {
  mkdir -p $startdir/pkg/opt/lib32/usr/bin
  cd $startdir/src

    # NOTE: The upstream author does not distribute the source code unless
    # registering.  The binary is available w/o registration, so just to be
    # careful, we'll check the binary against the MD5 computed at the time
    # of this PKGBUILD.
    #
    echo "**> Verifying MD5 of included binary from within PKGBUILD::build()"
    sum=`md5sum lha | awk '{ print $1 }'`
    echo "**> Expected MD5: '9096c827e93420de99035e7706c741b3'"
    echo "**> Computed MD5: '$sum'"
    if [ "$sum" = "9096c827e93420de99035e7706c741b3" ]; then
        echo "**> MD5 check passed: completing build"
      #install -D -m755 lha $startdir/pkg/usr/bin/lha
      install -D -m755 lha $startdir/pkg/opt/lib32/usr/bin/lha
    mkdir -p $startdir/pkg/usr/bin
    ln -s /opt/lib32/usr/bin/lha $startdir/pkg/usr/bin
    else
        echo "**> MD5 check failed: please submit a bug to the Arch pkg maintainer"
        return 1
    fi
}
# vim: ts=2 sw=2 et ft=sh

And that's it! Thanks for your time guys.

Offline

Board footer

Powered by FluxBB