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

Unable to correctly name binary #649

Closed
heartsucker opened this issue Aug 11, 2015 · 2 comments
Closed

Unable to correctly name binary #649

heartsucker opened this issue Aug 11, 2015 · 2 comments
Labels

Comments

@heartsucker
Copy link

I have a project that looks like so as part of a larger build.

val `my-project` = (project in file("some/dir/my-project")
  .enablePlugins(LinuxPlugin, DebianPlugin, JavaServerAppPackaging)
  .settings(
    name := "my-project",
    organization := "foo.bar",
    version := "1.2.3",
    name in Linux := s"somecompany-${normalizedName.value}",
    packager.Keys.packageName := (name in Linux).value,
    packager.Keys.packageDescription in Linux := "stuff",
    packager.Keys.packageSummary in Linux := "stuff",
    maintainer in Linux := "foo@bar.com",
    mainClass in Compile := Some("some.Class"),
    debianPackageDependencies += "java8-jdk",
    daemonUser in Linux := (name in Linux).value,
    daemonGroup in Linux := (daemonUser in Linux).value,
    bashScriptExtraDefines ++= Seq("stuff", "more", "lol"),
    serverLoading in Linux := Upstart
  )

This builds the deb package with .deb being named correctly according to the above parameters. The meta data is correct so that if I do an apt-get install somecompany-my-project, the correct package is installed on my server. However, the binary is still named my-project.

How can I override the name of my binary?

And as a note, whatever I'm doing right now breaks on apt-get install.

start: Unknown job: somecompany-my-project
somecompany-my-project could not be registered or started

I have also tried removing the LinuxPlugin and having everything be key in Debian, but that fixes nothing.

SBT v0.13.8
Packager 1.0.0

@muuki88 muuki88 added the debian label Aug 11, 2015
@muuki88
Copy link
Contributor

muuki88 commented Aug 11, 2015

What you are looking for is the executableScriptName. There is small CheatSheet in the docs which lists these things that are commonly customized.

The LinuxPlugin, DebianPlugin is acutally redundant. JavaServerAppPackaging enables this by default. The packager.Keys can be removed as well.

start: Unknown job: somecompany-my-project
somecompany-my-project could not be registered or started

For upstart there should be a /etc/init/somecompany-my-project.conf. All under DEBIAN/* should contain the correct upstart script conf name somecompany-my-project. You can check this by looking into the builded deb package. If not, this is a bug.

@heartsucker
Copy link
Author

The above fixes the naming for the binary, but through renaming the keys like above, I was able to generate a script that couldn't be run. apt-get install somecompany-my-project and service somecompany-my-project start would cause the above error. This is probably a separate ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants