Need help writing RPM .spec file

I'm new to this. This installer just installs PHP code so NOTHING needs to be built (do I still need to use the build and buildroot directories?). I would just like to create an installer (spec) that:
1) unpacks a tarball
2) moves the unpacked files to the installation target
3) runs a script after installing that will modify a prior existing configuration file to work with the above

Also when I see things like %setup -q I'm wondering what is done exactly? Where can I look up info on what %setup or the -q option does for instance? Also when I see stuff like %{!?version:%define unset_version yes%{nil}} where can I read about what this syntax means? Does it have a name? Is a .spec essentially a special type of shell script? Thanks

Have a look at the Packager Documentation documentation at rpm.org.

Yeah RPM's are always fun, remember to create and uninstall function too :stuck_out_tongue: