Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support RPM 'Prefix'. #242

Merged
merged 3 commits into from
Jun 6, 2014
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -11,6 +11,7 @@ trait RpmKeys {
val rpmVendor = SettingKey[String]("rpm-vendor", "Name of the vendor for this RPM.")
val rpmOs = SettingKey[String]("rpm-os", "Name of the os for this RPM.")
val rpmRelease = SettingKey[String]("rpm-release", "Special release number for this rpm (vs. the software).")
val rpmPrefix = SettingKey[Option[String]]("rpm-prefix", "File system prefix for relocatable package.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't there need to be a default value for this in the acrchetypes as well?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? Prefix: is not a required field what would you think it would be?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the prefix option. What's its purpose?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayaras is right. By default this should be None as this field is optional and only for special use cases.

val rpmMetadata = SettingKey[RpmMetadata]("rpm-metadata", "Metadata associated with the generated RPM.")

// DESCRIPTION KEYS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ case class RpmMetadata(
name: String,
version: String,
release: String,
prefix: Option[String] = None,
arch: String,
vendor: String,
os: String,
Expand Down Expand Up @@ -168,6 +169,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)
meta.prefix foreach { v => sb append ("prefix: %s\n" format v) }

desc.license foreach { v => sb append ("License: %s\n" format v) }
desc.distribution foreach { v => sb append ("Distribution: %s\n" format v) }
Expand Down
3 changes: 2 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 @@ -17,6 +17,7 @@ trait RpmPlugin extends Plugin with LinuxPlugin {
def rpmSettings: Seq[Setting[_]] = Seq(
rpmOs := "Linux", // TODO - default to something else?
rpmRelease := "0",
rpmPrefix := None,
rpmVendor := "", // TODO - Maybe pull in organization?
rpmLicense := None,
rpmDistribution := None,
Expand Down Expand Up @@ -46,7 +47,7 @@ trait RpmPlugin extends Plugin with LinuxPlugin {
) ++ inConfig(Rpm)(Seq(
packageArchitecture := "noarch",
rpmMetadata <<=
(name, version, rpmRelease, packageArchitecture, rpmVendor, rpmOs, packageSummary, packageDescription, rpmAutoprov, rpmAutoreq) apply (RpmMetadata.apply),
(name, version, rpmRelease, rpmPrefix, packageArchitecture, rpmVendor, rpmOs, packageSummary, packageDescription, rpmAutoprov, rpmAutoreq) apply RpmMetadata,
rpmDescription <<=
(rpmLicense, rpmDistribution, rpmUrl, rpmGroup, rpmPackager, rpmIcon) apply RpmDescription,
rpmDependencies <<=
Expand Down