updated on Mon Jan 16 04:00:32 UTC 2012
[aur-mirror.git] / sgfxi / PKGBUILD
blob4bb361bee881d71f25e2624260790c0ebc780818
1 ## PKGBUILD [plain_text]
2 ## Version: 1.3
3 # Contributor: Joshua Neuhard <fester4200@gmail.com>
4 pkgname="sgfxi"
5 pkgver="4.10.72"
6 pkgrel="10"
7 pkgdesc="Automatic Nvidia/Ati Driver Installer For Archlinux"
8 arch=('any')
9 url="http://sgfxi.googlecode.com"
10 license=('GPLv2 or any later version')
11 source=()
12 md5sums=()
14 ## note a few things here: we test for bad wget download, remove pkg if error
15 ## then test for EOF marker in file to ensure complete download occured, if so
16 ## install it. If no EOF file, the file download was corrupted and the installer
17 ## returns error after deleting the corrupted file.
18 build() {
19         local sgfxiName="sgfxi"
20         cd "$srcdir"
21         wget -O $sgfxiName "http://sgfxi.googlecode.com/svn/trunk/$sgfxiName"
22         # test wget return value, on error kill rm and return error
23         if [ "$?" -ne 0 ];then
24                 if [ -f "$sgfxiName" ];then
25                         echo
26                         echo "Removing $sgfxiName file because of wget error..."
27                         rm "$sgfxiName"
28                         echo "$sgfxiName PackageBuild failed due to wget error."
29                 fi
30                 return 1
31         # test for script EOF marker, if there, success
32         elif [ -n "$( grep -si '##\*\*EOF\*\*##' $sgfxiName )" ];then
33                 install -D -m 755 $sgfxiName $pkgdir/usr/bin/$sgfxiName
34                 return 0
35         # if not, failure, rm if file exists
36         else
37                 if [ -f "$sgfxiName" ];then
38                         echo
39                         echo "Removing $sgfxiName file because of data corruption error..."
40                         rm "$sgfxiName"
41                         echo "$sgfxiName PackageBuild failed due to file corruption error."
42                 fi
43                 return 1
44         fi