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

Using custom postinst script with JavaServerAppPackaging overrides maintainer one #576

Closed
Tolsi opened this issue May 6, 2015 · 1 comment
Labels
debian documentation Documentation should be extended or updated

Comments

@Tolsi
Copy link

Tolsi commented May 6, 2015

Here in docs written: If you use the packageArchetype.java_server there are predefined postinst and preinst files, which start/stop the application on install/remove calls. Existing maintainer scripts will be extended not overridden.

packageArchetype.java_server is deprecated, i use enablePlugins(JavaServerAppPackaging), but my src/debian/DEBIAN/postinst overrides exists maintainer postinst script.

How I can extend the maintainer postinst?

@muuki88 muuki88 added debian documentation Documentation should be extended or updated labels May 6, 2015
@muuki88
Copy link
Contributor

muuki88 commented May 19, 2015

sorry for the late reply. We are planning to align rpm/debian so both use a simple api where you can extend/override existing scripts in the same fashion. For now you have to do a bit sbt-foo.

// extending the postinst script
debianMakePostinstScript := {
  // you can actually place it anywhere
  val tmp = (target in Universal).value / "tmp" / "bin"

  // get the preexisting one or create a new
  val postinst = debianMakePostinstScript.value.getOrElse(tmp / "postinst")

  // write stuff
  IO.write(postinst, """echo "nice one!"""", append = true)
  Some(postinst)
}

I have not tested this, but should work.

@muuki88 muuki88 closed this as completed Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debian documentation Documentation should be extended or updated
Projects
None yet
Development

No branches or pull requests

2 participants