Skip to content

Commit

Permalink
Merge pull request #547 from dwhjames/fix/rpmlintwarnings
Browse files Browse the repository at this point in the history
Fix warnings from rpm lint
  • Loading branch information
muuki88 committed Apr 6, 2015
2 parents 80ef17d + 62ef8e1 commit 9a9621e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

exec="${{chdir}}/bin/${{exec}}"
prog="${{app_name}}"
lockfile=/var/lock/subsys/$prog
lockfile="/var/lock/subsys/${{app_name}}"

RUN_CMD="$exec >> /var/log/${{app_name}}/daemon.log 2>&1 &"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ object JavaServerAppPackaging extends AutoPlugin {
}

protected def startScriptMapping(name: String, script: Option[File], loader: ServerLoader, scriptDir: String): Seq[LinuxPackageMapping] = {
val (path, permissions) = loader match {
case Upstart => ("/etc/init/" + name + ".conf", "0644")
case SystemV => ("/etc/init.d/" + name, "0755")
case Systemd => ("/usr/lib/systemd/system/" + name + ".service", "0644")
val (path, permissions, isConf) = loader match {
case Upstart => ("/etc/init/" + name + ".conf", "0644", "true")
case SystemV => ("/etc/init.d/" + name, "0755", "false")
case Systemd => ("/usr/lib/systemd/system/" + name + ".service", "0644", "true")
}
for {
s <- script.toSeq
} yield LinuxPackageMapping(Seq(s -> path), LinuxFileMetaData(Users.Root, Users.Root, permissions, "true"))
} yield LinuxPackageMapping(Seq(s -> path), LinuxFileMetaData(Users.Root, Users.Root, permissions, isConf))
}

protected def makeStartScript(template: URL, replacements: Seq[(String, String)], tmpDir: File, loader: ServerLoader): Option[File] = {
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/rpm/test-executableScriptName/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rpmLicense := Some("BSD")
TaskKey[Unit]("check-spec-file") <<= (target, streams) map { (target, out) =>
val spec = IO.read(target / "rpm" / "SPECS" / "rpm-test.spec")
assert(spec contains "%attr(0644,root,root) /usr/share/rpm-test/lib/rpm-test.rpm-test-0.1.0.jar", "Wrong installation path\n" + spec)
assert(spec contains "%config %attr(0755,root,root) /etc/init.d/rpm-test", "Wrong /etc/init.d/\n" + spec)
assert(spec contains "%attr(0755,root,root) /etc/init.d/rpm-test", "Wrong /etc/init.d/\n" + spec)
assert(spec contains "%config %attr(644,root,root) /etc/default/rpm-test", "Wrong etc default file\n" + spec)
assert(spec contains "%dir %attr(755,rpm-test,rpm-test) /var/log/rpm-test", "Wrong logging dir path\n" + spec)
assert(spec contains "%dir %attr(755,rpm-test,rpm-test) /var/run/rpm-test", "Wrong /var/run dir path\n" + spec)
Expand All @@ -43,4 +43,4 @@ TaskKey[Unit]("checkStartupScript") <<= (target, streams) map { (target, out) =>
assert(script contains "rpm-exec", "SystemV script didn't contain correct executable filename 'rpm-exec' \n" + script)
out.log.success("Successfully tested startup script start up script")
()
}
}
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/test-packageName/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TaskKey[Unit]("check-spec-file") <<= (target, streams) map { (target, out) =>
val spec = IO.read(target / "rpm" / "SPECS" / "rpm-package.spec")
out.log.success(spec)
assert(spec contains "%attr(0644,root,root) /usr/share/rpm-package/lib/rpm-test.rpm-test-0.1.0.jar", "Wrong installation path\n" + spec)
assert(spec contains "%config %attr(0755,root,root) /etc/init.d/rpm-package", "Wrong /etc/init.d path\n" + spec)
assert(spec contains "%attr(0755,root,root) /etc/init.d/rpm-package", "Wrong /etc/init.d path\n" + spec)
assert(spec contains "%config %attr(644,root,root) /etc/default/rpm-package", "Wrong /etc default file\n" + spec)
assert(spec contains "%dir %attr(755,rpm-package,rpm-package) /var/log/rpm-package", "Wrong logging dir path\n" + spec)
assert(spec contains "%dir %attr(755,rpm-package,rpm-package) /var/run/rpm-package", "Wrong /var/run dir path\n" + spec)
Expand Down

0 comments on commit 9a9621e

Please sign in to comment.