RPM with ClearCase

Hello. I have a task to complete and it involves using RPM with ClearCase. I have looked through as much documentation as possible about RPM and I still have questions about it. My task is to create a .rpm using ClearCase by unzipping a 22 Mb file and placing it into a set directory structure. I don't have alot but my spec file goes through the %prep section fine. However, I have some questions:

a) i would like to test to see if the directory exists and if it doesn't, create the directory structure. I can't seem to get the right syntax of my if...else test. this is what i have so far:

if [ this equals the directory ]
then
      echo "Directory already exists!!"
else
      mkdir -p <directory>
fi 

b) once, i have the directory structure, i need to unzip the source file into that directory. will RPM allow for such a task and how should I go about it? Any help would be appreciated.

I'm not aware of ClearCase, but since you have shell script, can't you just call "unizp" with the respective parameters and then call "rpmbuild -bb" ; "rpm -Uvh" or appropriate command ?

hmm on editing the ctspec file itself it should automatically extract in clearcase.