build rpm without compiling the source file
<p>I am trying a sample rpm package with single file. </p>

<p>In my source folder I have python_test_rpm.tar.gz which contains only one python script file. But, the file is not a valid python script. </p>

<p>All I want to do is package this and deploy it in a specific folder. While executing the rpm build command it is showing the compilation/syntax error in the python script. How to skip this validation and make the build.</p>

<blockquote>
  <p><strong>rpmbuild command</strong>
  rpmbuild -v -bb </p>
  
  <p><strong>Spec File:</strong></p>
  
  <p>Name:           python_test_rpm</p>
  
  <p>Version:        1 </p>
  
  <p>Release:        1</p>
  
  <p>Summary:        Sample RPM for Linux Installer</p>
  
  <p>Group:                  Development/Tools </p>
  
  <p>License:        GPL</p>
  
  <p>URL:    None </p>
  
  <p>Source:         python_test_rpm.tar.gz</p>
  
  <p>BuildRoot:         /home/rpmdev/rpmbuild</p>
  
  <p>%description </p>
  
  <p>POC package for Linux RPM installer</p>
  
  <p>%prep </p>
  
  <p>%setup -n "python_test_rpm"</p>
  
  <p>%install </p>
  
  <p>rm -rf "$RPM_BUILD_ROOT" </p>
  
  <p>mkdir -p "$RPM_BUILD_ROOT/python_test_rpm" </p>
  
  <p>cp -R _mock_backport.py "$RPM_BUILD_ROOT/python_test_rpm"</p>
  
  <p>%files </p>
  
  <p>/python_test_rpm/_mock_backport.py</p>
  
  <p><strong>Error Message:</strong>
  Compiling
  /home/rpmdev/rpmbuild/BUILDROOT/python_test_rpm-1-1.x86_64/python_test_rpm/_mock_backport.py
  ... SyntaxError: unqualified exec is not allowed in function
  '_set_signature' it contains a nested function with free variables
  (_mock_backport.py, line 191)</p>
  
  <p>error: Bad exit status from /var/tmp/rpm-tmp.4gSvIa (%install)</p>
  
  <p>RPM build errors:
      Bad exit status from /var/tmp/rpm-tmp.4gSvIa (%install)</p>
</blockquote>