Narvi Blog
Narvi Blog

Reputation: 3

sbt-native-packager, hook into the debian package lifecycle

I try to use sbt-native-packager to build deb package. I want to hook into the debian package lifecycle. I try to achieve this according to instructions on the sbt-native-packager site. In my build.sbt I added sth like:

import DebianConstants._
maintainerScripts in Debian := maintainerScriptsAppend((maintainerScripts in Debian).value)(
  Preinst -> "echo 'hello, world'",
  Postinst -> s"echo 'installed ${(packageName in Debian).value}'"
)

But I get error cannot resolve symbol DebianConstants. I use sbt 0.13.9, scala 2.11.6 and sbt-native-packager 1.0.6. I searched in packages and I can't find anything like DebianConstants. I also can't find maintainerScripts key for Debian. It seems that sbt-native-packager site is out of date. Is there a way to programmatically hook into the debian package lifecycle?

PS I know there is a way to place scripts into src/debian/DEBIAN. But I want to know if there is a way to do it in build.sbt (just for fun)

Upvotes: 0

Views: 161

Answers (1)

Onilton Maciel
Onilton Maciel

Reputation: 3699

To use this kind of code in your build.sbt, you need the 1.1.0-RC release version. Just add this to your project/plugins.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC1")

Upvotes: 1

Related Questions