You need to create the dir first:
Code:
mkdir -p $PKG/install
cat $CWD/desc > $PKG/install/desc
You should make a habit of creating dirs you are going to use. An extra line or two of code doesn't hurt.
I have another suggestion -you should probably avoid this construction:
$PRG-$VERSION
Instead use:
$PRG_$VERSION
You'll need to change this usage:
tar -xjvf $CWD/$PRG-$VERSION.tar.bz2
so that it uses something like:
tar -xjvf $CWD/$TARBALL-NAME.tar.bz2
Using the '-' as a separator between two variables is going to cause some funny problems later which are hard to spot.
If I remember correctly, installpkg and makepkg will already handle 'desc' files. This is hold-over legacy from the earliest versions.