It is not so straight forward, yes. I only did debian packages so far and there is a utility called "dh_make" that helps a bit creating the skeleton for debian-files. For RPM, there should be similar tools.