Can someone help me with creating RPM sample i need ?

i know there are tons n tons of documentation out there to help me out to understand this.. but wen i read it, its to confusing for me.. i would really wish a kind hearted person on this forum can come out with a sample spec file for the example steps that i need for the RPM. This will make me understand how n what am i suppose to put for the first time.. (yes i am doing it first time) and later further i can do some reading wen i already understood how it works...

So getting there..

i know RPM need 5 directory which are :

  • BUILD.
  • RPMS.
  • SOURCES.
  • SPECS.
  • SRPMS

the steps i wan my RPM to do is..

----

Files that i have and its locations :

/source.tar.gz
/myappdocs/

**source.tar.gz already contain the myappdocs/ in it already

sample files in source.tar.gz

  • first.py
  • second.py
  • third.py

----

ok as from what i read online /source.tar.gz has to be in :

SOURCES/ ok thats done

so now it looks like this :

BUILD/
RPMS/
SOURCES/source.tar.gz
SPECS/myapp.spec <-- currently empty n this is where i need help
SRPMS/

---

so now what i would like to do wen i build my rpm is very simple.. jus for my understanding

1) wen the rpm is install everything in source.tar.gz is copied to a folder say /myapp/
2) all the documents has to be in unix default doc folder which i think /usr/doc/myapp/
3) verify if all the files are copied.
4) able to remove all the mentioned files when a user removes the package

---

i know it sounds silly why i just wan to copy files only take all this hassle.. understood!.. but this is just for me to understand the concept further exploring i can do myself i guess..

..

I hope someone can pls help me come out with a sample spec file based on this .. i really wish to see how it looks like plsss...

Thank you very much.