diff --git a/integration-tests-ansible/test-project-play-rpm/packaging.sbt b/integration-tests-ansible/test-project-play-rpm/packaging.sbt index 8211a4c1e..f19349907 100644 --- a/integration-tests-ansible/test-project-play-rpm/packaging.sbt +++ b/integration-tests-ansible/test-project-play-rpm/packaging.sbt @@ -28,3 +28,5 @@ rpmRelease := "1" rpmVendor := "DemoVendor" rpmLicense := Some("Apache-2.0") + +rpmEpoch := 1 diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala index 4480691f4..d0b928571 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala @@ -18,7 +18,8 @@ case class RpmMetadata(name: String, summary: String, description: String, autoprov: String, - autoreq: String) + autoreq: String, + epoch: Int) /** * The Description used to generate an RPM @@ -222,6 +223,7 @@ case class RpmSpec(meta: RpmMetadata, sb append ("Version: %s\n" format meta.version) sb append ("Release: %s\n" format meta.release) sb append ("Summary: %s\n" format meta.summary) + sb append ("Epoch: %d\n" format meta.epoch) meta.prefix foreach { v => sb append ("prefix: %s\n" format v) } diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala index 7b6ad8a2b..183eaaaea 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala @@ -69,6 +69,7 @@ object RpmPlugin extends AutoPlugin { rpmPrefix := None, rpmVendor := "", // TODO - Maybe pull in organization? rpmLicense := None, + rpmEpoch := 0, rpmDistribution := None, rpmUrl := None, rpmGroup := None, @@ -121,7 +122,8 @@ object RpmPlugin extends AutoPlugin { (packageSummary in Rpm).value, (packageDescription in Rpm).value, rpmAutoprov.value, - rpmAutoreq.value + rpmAutoreq.value, + rmpEpoch.value ), rpmDescription := RpmDescription( rpmLicense.value, diff --git a/src/sphinx/formats/rpm.rst b/src/sphinx/formats/rpm.rst index c55818974..44c55c5f1 100644 --- a/src/sphinx/formats/rpm.rst +++ b/src/sphinx/formats/rpm.rst @@ -123,6 +123,12 @@ Informational Settings ``rpmLicense`` The license associated with software in the RPM. + ``rpmEpoch`` + The epoch is the most significant number used when resolving different versions + for the same RPM. For a given package, packages with the highest epoch will be + used, and in the event of a tie it will fall back to comparing the version and + release. + Dependency Settings ~~~~~~~~~~~~~~~~~~~