simplify pkgname default

rather than having a rather ugly if and an unhandy case new variable, we can simplify this by making the default $name, in the parameter list.
Merge pull request #77 from igalic/patch-1

simplify pkgname default