Hi stef, contragulations on writing your first (?) PKGBUILD. There are a few points that need clearing up before your PKGBUILD can be released for use.
2) You can see I have some questions/doubts re. line 26/27 (original PKGBUILD has 26, I changed it to 27, out of habit I guess. I don't think it's an important point though as I guess one should clean up the various dirs left after installing an AUR package, in any event, though. Comments?)
You should almost never use `make clean`. It is up to `makepkg` and the user to ensure the build directory is fresh. Also `|| return 1` is not required. Do not use `configure --foo="<anything including pkgdir>"`. It will not do what you expect it to. `./configure` is a script which dictates various aspects of the suite after compilation. Options such as --prefix or --<foo>dir set values which become compiled into the program. Imagine that $pkgdir is `/home/user/blah/pkg`. Setting --prefix=$pkgdir will mean that instead of /{etc,usr,var}/ the program will have /home/user/blah/pkg/{etc,usr,var}/. So when installed using pacman, the package is going to put a bunch of files at /home/user/blah/pkg/, right? That's why you're getting errors involving your home dir. Since the program is going to eventually be installed with pacman to `/` then you need to treat the build as if you're installing it to `/` up until the point that you run make install. This way, all the compiled-in values won't involve /home/blah/. I'm probably really crap at explaining this, but it was worth a shot. I can only suggest you read makefiles and learn what each recipe generally does and what variables it draws on. -- Four word witty remark