Hello,

I have a question about building RPM, I am trying to build a rpm which will source a file from home directory, and if the $env=app it should copy the app.war file over, and if the $env=track it should copy the track file over . My %install looks like below, however when I try to build, I get an error because it's trying to source file during the build. My goal is to configure it so it deploys code based on the application role. Please advise.

%install
pwd
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/tmp
mkdir -p $RPM_BUILD_ROOT/opt/tomcat/webapps
cd $RPM_BUILD_ROOT/opt/tomcat/webapps
if [ $env = app ];then
cp %{SOURCEAPP} /opt/tomcat/webapps/app.war
elif [ $env = tracking ]; then
cp %{SOURCETRACK} /opt/tomcat/webapps/track.war
fi


+ '[' = app ']'
/home/user/rpm/tmp/rpm-tmp.55777: line 29: [: =: unary operator expected
+ '[' = metrics ']'
/home/user/rpm/tmp/rpm-tmp.55777: line 31: [: =: unary operator expected
+ /usr/lib/rpm/brp-compress

Thanks,
JT