This repository has been archived by the owner on Jul 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
#11 First work done #12
Open
muuki88
wants to merge
2
commits into
kryptt:master
Choose a base branch
from
muuki88:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.12.2 | ||
sbt.version=0.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
resolvers += Classpaths.typesafeResolver | ||
|
||
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0") | ||
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ package object natpackplugin { | |
import String.format | ||
import sbt._ | ||
|
||
private[natpackplugin] def postInstContent(name: String, userName: String, groupName: String) = format( | ||
"""#!/bin/sh | ||
private[natpackplugin] def postInstContent(nameAndVersion: String, normalizedName: String, userName: String, groupName: String) = format( | ||
"""#!/bin/sh | ||
# postinst script for %1$s | ||
# | ||
# see: dh_installdeb(1) | ||
|
@@ -45,23 +45,25 @@ set -e | |
case "$1" in | ||
configure) | ||
|
||
if ! getent group | grep -q "%3$s"; then | ||
addgroup "%3$s" | ||
if ! getent group | grep -q "%4$s"; then | ||
addgroup "%4$s" | ||
fi | ||
|
||
if ! id "%2$s" > /dev/null 2>&1 ; then | ||
adduser --system --home "/var/lib/%1$s" --no-create-home \ | ||
--ingroup "%3$s" --disabled-password --shell /bin/bash \ | ||
"%2$s" | ||
if ! id "%3$s" > /dev/null 2>&1 ; then | ||
adduser --system --disabled-login --shell /bin/false --no-create-home \ | ||
--ingroup "%4$s" --disabled-password "%3$s" | ||
fi | ||
|
||
mkdir -p "/var/log/%1$s" | ||
mkdir -p "/var/log/%2$s" | ||
|
||
# Create symlink with normalized name | ||
ln -s "/usr/share/%1$s" "/usr/share/%2$s" | ||
|
||
# directories needed for jenkins | ||
# we don't do -R because it can take a long time on big installation | ||
chown "%2$s:%3$s" "/var/lib/%1$s" "/var/log/%1$s" | ||
chown "%3$s:%4$s" "/usr/share/%1$s" "/var/log/%2$s" | ||
# we don't do "chmod 750" so that the user can choose the pemission for g and o on their own | ||
chmod u+rwx "/var/lib/%1$s" "/var/log/%1$s" | ||
chmod u+rwx "/usr/share/%1$s" "/var/log/%2$s" | ||
;; | ||
|
||
abort-upgrade|abort-remove|abort-deconfigure) | ||
|
@@ -76,24 +78,24 @@ esac | |
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
if [ -x "/etc/init.d/%1$s" ]; then | ||
update-rc.d "%1$s" defaults >/dev/null | ||
invoke-rc.d "%1$s" start || exit $? | ||
if [ -x "/etc/init.d/%2$s" ]; then | ||
update-rc.d "%2$s" defaults >/dev/null | ||
invoke-rc.d "%2$s" start || exit $? | ||
fi | ||
|
||
exit 0 | ||
""", name, userName, groupName) | ||
""", nameAndVersion, normalizedName, userName, groupName) | ||
|
||
private[natpackplugin] def postRmContent(name: String, userName: String) = format( | ||
"""#!/bin/sh | ||
private[natpackplugin] def postRmContent(nameAndVersion: String, normalizedName: String, userName: String) = format( | ||
"""#!/bin/sh | ||
|
||
set -e | ||
|
||
case "$1" in | ||
purge) | ||
userdel "%2$s" || true | ||
rm -rf "/var/lib/%1$s" "/var/log/%1$s" \ | ||
"/var/run/%1$s" | ||
userdel "%3$s" || true | ||
rm -rf "/usr/share/%1$s" "/usr/share/%2$s" "/var/log/%2$s" \ | ||
"/var/run/%2$s" | ||
;; | ||
|
||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) | ||
|
@@ -106,31 +108,24 @@ case "$1" in | |
esac | ||
|
||
if [ "$1" = "purge" ] ; then | ||
update-rc.d "%1$s" remove >/dev/null | ||
update-rc.d "%2$s" remove >/dev/null | ||
fi | ||
|
||
exit 0 | ||
""", name, userName) | ||
""", nameAndVersion, normalizedName, userName) | ||
|
||
// Script to run before removing the package. (stops the service) | ||
private[natpackplugin] def preRmContent(initName: String) = format( | ||
"""#!/bin/sh | ||
"""#!/bin/sh | ||
set -e | ||
if [ -x "/etc/init.d/%1$s" ]; then | ||
invoke-rc.d "%1$s" stop || exit $? | ||
fi | ||
""", initName) | ||
|
||
//local Play start file | ||
private[natpackplugin] def startFileContent(config: String) = format( | ||
"""#!/usr/bin/env sh | ||
|
||
exec java $* -cp "`dirname $0`/lib/*" %s play.core.server.NettyServer `dirname $0` $@ | ||
""", if (config.isEmpty()) "" else "-Dconfig.file=`dirname $0`/application.conf") | ||
|
||
// /etc/init.d init script | ||
private[natpackplugin] def initFilecontent(id: String, desc: String, user: String) = format( | ||
"""#!/bin/bash | ||
"""#!/bin/bash | ||
# "/etc/init.d/%1$s" | ||
# debian-compatible %1$s startup script. | ||
# Original version by: Amelia A Lewis <[email protected]> | ||
|
@@ -236,7 +231,7 @@ do_start() | |
|
||
# --user in daemon doesn't prepare environment variables like HOME, USER, LOGNAME or USERNAME, | ||
# so we let su do so for us now | ||
$SU -l $USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- /var/lib/%1$s/start $PLAY_ARGS" || return 2 | ||
$SU -l $USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- /usr/bin/%1$s $PLAY_ARGS" || return 2 | ||
} | ||
|
||
|
||
|
@@ -379,7 +374,7 @@ exit 0 | |
private[natpackplugin] def chmod(file: File, perms: String): Unit = | ||
Process(Seq("chmod", perms, file.getAbsolutePath)).! match { | ||
case 0 ⇒ () | ||
case n ⇒ sys.error("Error running chmod %s %s" format(perms, file)) | ||
case n ⇒ sys.error("Error running chmod %s %s" format (perms, file)) | ||
} | ||
|
||
private[natpackplugin] def debFile(name: String, content: => String)(dir: File) = { | ||
|
@@ -398,4 +393,7 @@ exit 0 | |
private[natpackplugin] def debFile3[T, U, V](name: String, content: (T, U, V) => String)(dir: File, t: T, u: U, v: V) = | ||
debFile(name, content(t, u, v))(dir) | ||
|
||
private[natpackplugin] def debFile4[T, U, V, W](name: String, content: (T, U, V, W) => String)(dir: File, t: T, u: U, v: V, w: W) = | ||
debFile(name, content(t, u, v, w))(dir) | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably doesn't do what you would expec.
Do
fullname in Debian
as well as use the same for name and version.