title: rpm & rpmbuild - using global environment variable in the %files section
body: <p>I have been struggling for a while with this one.
  So I wrote a .specs file for my project and everything went fine. The rpm is built, the installation is smooth... but then I got some trouble because now, I have to use a custom global environment variable to set the install path. </p>
  
  <p>This would give a %files section as such : </p>
  
  <pre><code>%files
  %defattr(-,root,root)
  $INSTALLPATH/Crystal/bin/Crystal.jar
  </code></pre>
  
  <p>Where Crystal is my project name, and INSTALLPATH is defined within env thanks to the export commandline. Then, when running 
      buildrpm -ba Crystal.specs
  I have the following error: </p>
  
  <pre><code>error: File must begin with "/" : $INSTALLPATH/Crystal/bin/Crystal.jar
  </code></pre>
  
  <p>I have tried to define a macro inside the .rpmmacros file as such : 
      %_installpath $INSTALLPATH</p>
  
  <p>And in my specs file, when i do
      echo %{_installpath}
  I get the value I set in the .rpmmacros. But if I use it in %files:</p>
  
  <pre><code>%files
  %defattr(-,root,root)
  %{_installpath}/Crystal/bin/Crystal.jar
  </code></pre>
  
  <p>I get the same error again! </p>
  
  <pre><code>error: File must begin with "/" : $INSTALLPATH/Crystal/bin/Crystal.jar
  </code></pre>
  
  <p>I also tried defining a variable with the specs file and I have the same sad result. It looks like as long as my variable/macro is referencing to $INSTALL, then %files won't accept it. But I have to use this env variable!</p>
  
  <p>So that's all I could think about. Anyone got a clue? Any help would be greatly appreciated.</p>
  
  <p>Thanks a lot in advance!</p>