How to create a custom component out of an existing component?

Beginning with Version 2021.6 you have to specify a version key in the manifest.json if you copy the complete component folder to the custom_components folder (see: Custom integration changes | Home Assistant Developer Docs)
Just stumbled over this issue by copying the Homematic integration to the custom_components folder. This integration has no version key in the original folder.