Created
May 9, 2014 20:57
-
-
Save jayaras/7ad6fe2331a427db589a to your computer and use it in GitHub Desktop.
rpm prefix w/ sbt
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
lazy val rpmBuildSettings = packageArchetype.java_server ++ Seq( | |
name in Rpm := rpmName, | |
name in Linux := rpmName, | |
normalizedName := rpmName, | |
version := Try(sys.env("PACKAGE_VERSION")).getOrElse("PackageNotSet"), | |
rpmRelease := Try(sys.env("PACKAGE_RELEASE")).getOrElse("0"), | |
maintainer in Linux := "Jay Aras <[email protected]>", | |
packageSummary := "XXXXXX REST service.", | |
packageDescription := packageSummary.value, | |
rpmVendor := "XXXXXX", | |
rpmBrpJavaRepackJars in Rpm := true, | |
rpmGroup := Some("XXXXX"), | |
rpmLicense := Some("Proprietary"), | |
rpmUrl := Some("https://XXXXX"), | |
daemonUser in Linux := serviceUser, | |
daemonGroup in Linux := serviceUser, | |
rpmRequirements := Seq("jdk >= 1.7.0_51","XXXX"), | |
// this overrrides most things but NOT /var/logs, /var/run or the init script | |
defaultLinuxInstallLocation := rpmRoot, | |
// set rpm prefix: meta info. | |
rpmPrefix := Some(rpmRoot), | |
// get rid of /usr/bin symlink | |
linuxPackageSymlinks := Seq.empty, | |
// get a local log directory going on | |
defaultLinuxLogsLocation := rpmRoot + "/" + rpmName + "/logs" | |
) |
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
... | |
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog | |
# smb could define some additional options in $RUN_OPTS | |
RUN_CMD="${PACKAGE_PREFIX}/${{app_name}}/bin/${{app_name}}" | |
... |
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
# | |
# Adding ${{app_name}} to autostart | |
# | |
addservice() { | |
if hash update-rc.d 2>/dev/null; then | |
echo "Adding ${{app_name}} to autostart using update-rc.d" | |
update-rc.d ${{app_name}} defaults | |
elif chkconfig 2>/dev/null; then | |
echo "Adding ${{app_name}} to autostart using chkconfig" | |
chkconfig --add ${{app_name}} | |
chkconfig ${{app_name}} on | |
else | |
echo "WARNING: Could not put ${{app_name}} in autostart" | |
fi | |
} | |
echo "PACKAGE_PREFIX=${RPM_INSTALL_PREFIX}" > /etc/sysconfig/${{app_name}} | |
addservice | |
service ${{app_name}} start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment