summaryrefslogtreecommitdiffstats
path: root/scripts/aurbuild
blob: cc91efc5960bb57ccb062b33a2109cb266d51276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

die() {
	echo $*
	exit 1
}

if [ "$1" == "" ]; then
	echo "usage: aurbuild <package_name>"
	echo
	exit 1
fi
pkgname=$1
[ -d $pkgname  ] && die "Directory '$pkgname' already exists"
[ -f $pkgname  ] && die "File '$pkgname' already exists"

echo "Downloading $pkgname.tar.gz"
wget -q http://aur.archlinux.org/packages/$pkgname/$pkgname.tar.gz || die "Failed to fetch $1.pkg.tar.gz"

tar zxf $pkgname.tar.gz || die "Extraction failed"
rm -f $pkgname.tar.gz
cd $pkgname || die "Failed to cwd"
makepkg

# vim: set ts=2 sw=2 noet: