packaging: only apply rule if file exists