在sbt-native-packager的Debian包中更改名称

时间:2015-11-13 15:06:30

标签: scala sbt sbt-native-packager

我想将sbt-native-packager附加到项目的根聚合,但该根项目已发布了"foobar"的Maven的名称。我希望通过debian:packageBin生成的工件始终使用"foo"

我如何做到这一点?

我试过

name           in Debian := "foo"
packageName    in Debian := "foo"
normalizedName in Debian := "foo"
executableScriptName := "foo"
artifact       in Debian := (artifact in Debian).value.copy(name = "foo")

等。没有效果。我最终得到etc/foobarusr/share/foobar

修改:完成这些设置后,我越来越近了:

name                      in Debian := "foo"
normalizedName            in Debian := "foo"
packageName               in Debian := "foo"
name                      in Linux  := "foo"
normalizedName            in Linux  := "foo"
packageName               in Linux  := "foo"

现在的问题是生成的.deb文件包含每个目录两次,例如。 etc/foobar vs etc/foousr/share/foobar vs usr/share/foo。所以在某个地方必须仍然引用旧的包名...这很奇怪,因为我仔细检查linuxPackageMappings in Debian只包含正确的文件。

1 个答案:

答案 0 :(得分:2)

如编辑所示,您必须覆盖范围DebianLinux的设置。我的错误是,即使您删除target文件,.deb仍将被旧文件污染。因此,如果您更改这些内容,则必须在重新打包之前运行rm -r target。然后设置是:

executableScriptName     := "foo"
name           in Debian := "Foo"
packageName    in Debian := "foo"
name           in Linux  := "Foo"
packageName    in Linux  := "foo"
packageSummary in Debian := "Description of Foo"