all: add a clever pkgname inference, used by pkg-co