Skip to content

Commit

Permalink
sbt#1178 attempt at adding in rpm epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI authored and Ty Coghlan committed Dec 10, 2018
1 parent 596eb92 commit bcc8bed
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 3 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Change Log

## [Unreleased](https://github.com/sbt/sbt-native-packager/tree/HEAD)

[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.15...HEAD)

**Closed issues:**

- WindowsPlugin: support multiple .wxs inputs [\#1176](https://github.com/sbt/sbt-native-packager/issues/1176)

## [v1.3.15](https://github.com/sbt/sbt-native-packager/tree/v1.3.15) (2018-11-29)
[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.14...v1.3.15)

**Merged pull requests:**

- WindowsPlugin: support multiple wxs sources \(\#1176\) [\#1177](https://github.com/sbt/sbt-native-packager/pull/1177) ([nigredo-tori](https://github.com/nigredo-tori))

## [v1.3.14](https://github.com/sbt/sbt-native-packager/tree/v1.3.14) (2018-11-21)
[Full Changelog](https://github.com/sbt/sbt-native-packager/compare/v1.3.12...v1.3.14)

Expand Down
2 changes: 2 additions & 0 deletions integration-tests-ansible/test-project-play-rpm/packaging.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ rpmRelease := "1"
rpmVendor := "DemoVendor"

rpmLicense := Some("Apache-2.0")

rpmEpoch := 1
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
set -euo pipefail
IFS=$'\n\t'

ansible-playbook --private-key=.vagrant/machines/default/virtualbox/private_key --user=vagrant --connection=ssh --limit='default' --inventory-file=.vagrant/provisioners/ansible/inventory provisioning/test.yml
ansible-playbook-3 --private-key=.vagrant/machines/default/virtualbox/private_key --user=vagrant --connection=ssh --limit='default' --inventory-file=.vagrant/provisioners/ansible/inventory provisioning/test.yml
1 change: 1 addition & 0 deletions src/main/scala/com/typesafe/sbt/packager/rpm/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trait RpmKeys {
// DESCRIPTION KEYS
// TODO - Summary and license are required.
val rpmLicense = SettingKey[Option[String]]("rpm-license", "License of the code within the RPM.")
val rpmEpoch = SettingKey[Int]("rpm-epoch", "Epoch of the generated RPM.")
val rpmDistribution = SettingKey[Option[String]]("rpm-distribution")
val rpmUrl =
SettingKey[Option[String]]("rpm-url", "Url to include in the RPM.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -222,6 +223,9 @@ 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)

if (meta.epoch > 0) sb append ("Epoch: %d\n" format meta.epoch)

meta.prefix foreach { v =>
sb append ("prefix: %s\n" format v)
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -121,7 +122,8 @@ object RpmPlugin extends AutoPlugin {
(packageSummary in Rpm).value,
(packageDescription in Rpm).value,
rpmAutoprov.value,
rpmAutoreq.value
rpmAutoreq.value,
rpmEpoch.value
),
rpmDescription := RpmDescription(
rpmLicense.value,
Expand Down
3 changes: 3 additions & 0 deletions src/sbt-test/rpm/simple-rpm/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager")

rpmLicense := Some("BSD")

rpmEpoch := 1

packageArchitecture in Rpm := "x86_64"

linuxPackageMappings in Rpm := {
Expand All @@ -38,6 +40,7 @@ TaskKey[Unit]("checkSpecFile") := {
assert(spec contains "Release: 1", "Contains project release")
assert(spec contains "Summary: Test rpm package", "Contains project summary")
assert(spec contains "License: BSD", "Contains project license")
assert(spec contains "Epoch: 1", "Contains epoch of 1")
assert(spec contains "Vendor: typesafe", "Contains project vendor")
assert(spec contains "URL: http://github.com/sbt/sbt-native-packager", "Contains project url")
assert(spec contains "BuildArch: x86_64", "Contains project package architecture")
Expand Down
6 changes: 6 additions & 0 deletions src/sphinx/formats/rpm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit bcc8bed

Please sign in to comment.