The main problem was the WRKDIR is not within STAGEDIR. Fix this while
moving all the directory creation steps into one. While here
set TAR to use switches as outlined in its man page.
Also, the permission setting in stagedir is not necessary, so it's simply
been removed.