diff --git a/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala b/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala index 43550859f..d05657ccd 100644 --- a/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala +++ b/src/main/scala/com/typesafe/sbt/packager/GenericPackageSettings.scala @@ -67,17 +67,17 @@ trait GenericPackageSettings defaultLinuxConfigLocation := "/etc", // First we look at the src/linux files - linuxPackageMappings <++= (sourceDirectory in Linux, daemonUser in Linux, daemonGroup in Linux) map { (dir, user, group) => - mapGenericMappingsToLinux(MappingsHelper contentOf dir, user, group)(identity) + linuxPackageMappings <++= (sourceDirectory in Linux) map { dir => + mapGenericMappingsToLinux(MappingsHelper contentOf dir, Users.Root, Users.Root)(identity) }, // Now we look at the src/universal files. - linuxPackageMappings <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation, daemonUser in Linux, daemonGroup in Linux) map { - (pkg, mappings, installLocation, user, group) => + linuxPackageMappings <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation) map { + (pkg, mappings, installLocation) => // TODO - More windows filters... def isWindowsFile(f: (File, String)): Boolean = f._2 endsWith ".bat" - mapGenericMappingsToLinux(mappings filterNot isWindowsFile, user, group) { name => + mapGenericMappingsToLinux(mappings filterNot isWindowsFile, Users.Root, Users.Root) { name => installLocation + "/" + pkg + "/" + name } }, @@ -92,17 +92,17 @@ trait GenericPackageSettings }, // Map configuration files linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation, defaultLinuxConfigLocation) - map { (pkg, mappings, installLocation, configLocation) => - val needsConfLink = - mappings exists { - case (file, name) => - (name startsWith "conf/") && !file.isDirectory - } - if (needsConfLink) Seq(LinuxSymlink( - link = configLocation + "/" + pkg, - destination = installLocation + "/" + pkg + "/conf")) - else Seq.empty - }) + map { (pkg, mappings, installLocation, configLocation) => + val needsConfLink = + mappings exists { + case (file, name) => + (name startsWith "conf/") && !file.isDirectory + } + if (needsConfLink) Seq(LinuxSymlink( + link = configLocation + "/" + pkg, + destination = installLocation + "/" + pkg + "/conf")) + else Seq.empty + }) def mapGenericFilesToWindows: Seq[Setting[_]] = Seq( mappings in Windows <<= mappings in Universal, diff --git a/src/sbt-test/debian/daemon-user-deb/build.sbt b/src/sbt-test/debian/daemon-user-deb/build.sbt index 09a8697dc..67811963f 100644 --- a/src/sbt-test/debian/daemon-user-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-deb/build.sbt @@ -29,7 +29,7 @@ TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) = assert(postinst contains "addgroup --system daemongroup", "postinst misses addgroup for daemongroup: " + postinst) assert(postinst contains "useradd --system --no-create-home --gid daemongroup --shell /bin/false daemonuser", "postinst misses useradd for daemonuser: " + postinst) assert(postinst contains "chown daemonuser:daemongroup /var/log/debian-test", "postinst misses chown daemonuser /var/log/debian-test: " + postinst) - assert(postinst contains "chown daemonuser:daemongroup /usr/share/debian-test/bin/debian-test", "postinst misses chown daemonuser /usr/share/debian-test/bin/debian-test: " + postinst) + assert(postinst contains "chown daemonuser:daemongroup /var/run/debian-test", "postinst misses chown daemonuser /var/run/debian-test: " + postinst) assert(!(postinst contains "addgroup --system daemonuser"), "postinst has addgroup for daemonuser: " + postinst) assert(!(postinst contains "useradd --system --no-create-home --gid daemonuser --shell /bin/false daemonuser"), "postinst has useradd for daemongroup: " + postinst) assert(postrm contains "deluser --quiet --system daemonuser > /dev/null || true", "postrm misses purging daemonuser user: " + postrm)