You are not logged in.
I just started to use Arch, and coming from Ubuntu/Debian, it was a bit of a shock, but Arch does grow on you. One of it's strengths is the AUR. When I first found out about it, I was all like, "HOLY $#!% ITS MACPORTS FOR LINUX." Turns out is isn't quite as easy to use, but it works. Walking into Arch, the only languages I was comfortable writing code in were C/Objective-C. Tonight I learned a little bash and wrote this wrapper around makepkg. Tell me what you think. The only thing missing that I can think of is dependency resolving, but I didn't want to put in the work for that just yet.
#! /bin/bash
ROOT=`pwd`
BUILDDIR=pkgbuild
NAME=$2
PREFIX=`expr ${NAME:0:2}`
URL=http://aur.archlinux.org/packages/$PREFIX/$NAME/$NAME.tar.gz
echo Package URL is $URL
setup() {
mkdir -p $BUILDDIR/$NAME
cd $BUILDDIR
}
download() {
curl $URL | gunzip | tar -x
cd $NAME
}
build() {
makepkg -s 1>/dev/null
}
install() {
makepkg -si 1>/dev/null
}
clean() {
cd $ROOT/$BUILDDIR
rm -rf $NAME
}
allclean() {
cd $ROOT
rm -rf $BUILDDIR
}
case $1 in
install)
setup
download
install
;;
build)
setup
download
build
;;
clean)
clean
;;
allclean)
allclean
;;
*)
echo "Usage:"
echo $0 "{install|build|clean|allclean} <package>"
;;
esac
Here is the command syntax:
Usage:
./archpkg {install|build|clean|allclean} <package>
Last edited by Relish (2012-01-16 05:31:33)
Offline
Here are the command synaptics:
I think you mean 'command syntax' :-)
You can try to get the BUILDDIR from makepkg.conf.
Last edited by karol (2012-01-16 05:23:18)
Offline
Relish wrote:Here are the command synaptics:
I think you mean 'command syntax' :-)
You can try to get the BUILDDIR from makepkg.conf.
Yes
I can't seem to find that entry in makepkg.conf.
Offline
[karol@black ~]$ grep ^BUILDDIR /etc/makepkg.conf
BUILDDIR=/home/karol/test/makepkg
It may be commented out, as
#BUILDDIR=/tmp/makepkg
is the default.
Last edited by karol (2012-01-16 05:35:17)
Offline
Ah. Why didn't I think of that. I might add the option to select that as the build dir as soon as I decipher some more bash tutorials.
Offline
If you'd llike to see similar scripts (in various languages), as examples/guidance/whatever, check out the AUR Helpers page in the wiki.
Offline