I was working on project in which we were having Airflow python code packaged as part of RPMs. By default rpmbuild process compiles the python files which Airflow server does not likes when it seem them. Airflow likes to compile themselves. So rpm job was to ship files which raw.

Here is complete run sheet to make rpm files using Sbt native packager and disable java jar recompress and python compilation.

Edit to file project > plugins.sbt and add the plugin

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.1")

Disable Java jar repackaging and Python compilation

Add the following file src/main/rpm/pre

The rpm pre scriplet is executed just before rpm is installed. Read more about rpm scripts at this link.