use the stuff borrowed from debian

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>