-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from kardapoltsev/wip/jdeb-script-replacements
FIX #405: Script replacements doesn't work with jdeb packaging
- Loading branch information
Showing
4 changed files
with
79 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
enablePlugins(JavaServerAppPackaging, JDebPackaging) | ||
|
||
name := "debian-test" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Josh Suereth <[email protected]>" | ||
|
||
packageSummary := "Test debian package" | ||
|
||
packageDescription := """A fun package description of our software, | ||
with multiple lines.""" | ||
|
||
debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") | ||
|
||
debianPackageRecommends in Debian += "git" | ||
|
||
TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) => | ||
val header = "#!/bin/sh" | ||
val extracted = target / "extracted" | ||
println(extracted.getAbsolutePath) | ||
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! | ||
val preinst = extracted / "DEBIAN/preinst" | ||
val postinst = extracted / "DEBIAN/postinst" | ||
val prerm = extracted / "DEBIAN/prerm" | ||
val postrm = extracted / "DEBIAN/postrm" | ||
Seq(preinst, postinst, prerm, postrm) foreach { script => | ||
val content = IO.read(script) | ||
assert(content.startsWith(header), "script doesn't start with #!/bin/sh header:\n" + script) | ||
assert(header.r.findAllIn(content).length == 1, "script contains more than one header line:\n" + script) | ||
} | ||
out.log.success("Successfully tested systemV control files") | ||
() | ||
} |
1 change: 1 addition & 0 deletions
1
src/sbt-test/debian/jdeb-script-replacements/project/plugins.sbt
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,5 @@ | ||
# Run the debian packaging. | ||
$ mkdir src/resources/empty | ||
> debian:package-bin | ||
$ exists target/debian-test_0.1.0_all.deb | ||
> check-control-files |