Also, you shouldn't be writing your own packaging scripts: leave those to distribution packagers. There are thousands of people who work on packaging these things, and the user of the distribution is much safer if they don't touch software distributed by random people.
This stuff is completely stable, just don't break the assumptions of the system without knowing what you're doing.