Rather than creating a separate rule for each package, we can just create a generic one and reuse it. Also switch to keyword arguments in the resulting macros, as it's easier to read.