Rompatcher is a python library for "patching" ROMs. It allows you to write (in a config file you can share) exactly what changes you want to make to a ROM. When you run the file, the changes are executed. The output is a usable ROM.
Simple.
sudo pip install rompatcher