Fix dirname invocation so it works on 12.04 too

Signed-off-by: Jani Monoses <jani@ubuntu.com>