-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce RPM / packageBin / artifactPath setting. (#1299)
* Introduce RPM / packageBin / artifactPath setting. Closes #1287 * Fix setting cannot depend on a task. * Proper fix. * Now without breaking mima. * Add a little bit of documentation. And a sbt-test. * Fix test Co-authored-by: Nepomuk Seiler <[email protected]>
- Loading branch information
Showing
6 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
enablePlugins(JavaServerAppPackaging, SystemVPlugin) | ||
|
||
name := "rpm-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <[email protected]>" | ||
|
||
packageSummary := "Test rpm package" | ||
|
||
packageName in Linux := "rpm-package" | ||
|
||
artifactPath in (Rpm, packageBin) := target.value / s"${(packageName in Rpm).value}-${(version in Rpm).value}.rpm" | ||
|
||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
rpmRelease := "1" | ||
|
||
rpmVendor := "typesafe" | ||
|
||
rpmUrl := Some("http://github.com/sbt/sbt-native-packager") | ||
|
||
rpmLicense := Some("BSD") | ||
|
||
TaskKey[Unit]("checkSpecFile") := { | ||
val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-package.spec") | ||
streams.value.log.success(spec) | ||
assert( | ||
spec contains "%attr(0644,root,root) /usr/share/rpm-package/lib/rpm-test.rpm-test-0.1.0.jar", | ||
"Wrong installation path\n" + spec | ||
) | ||
assert(spec contains "%attr(0755,root,root) /etc/init.d/rpm-package", "Wrong /etc/init.d path\n" + spec) | ||
assert(spec contains "%config %attr(644,root,root) /etc/default/rpm-package", "Wrong /etc default file\n" + spec) | ||
assert( | ||
spec contains "%dir %attr(755,rpm-package,rpm-package) /var/log/rpm-package", | ||
"Wrong logging dir path\n" + spec | ||
) | ||
assert( | ||
spec contains "%dir %attr(755,rpm-package,rpm-package) /var/run/rpm-package", | ||
"Wrong /var/run dir path\n" + spec | ||
) | ||
streams.value.log.success("Successfully tested rpm-package file") | ||
() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Run the debian packaging. | ||
> rpm:packageBin | ||
$ exists target/rpm-package-0.1.0.rpm | ||
$ exists target/rpm/RPMS/noarch/rpm-package-0.1.0-1.noarch.rpm | ||
$ exists target/rpm/SPECS/rpm-package.spec | ||
|
||
# Check files for defaults | ||
> checkSpecFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters