-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build failed on OS X #327
Comments
You maybe run in an issue with the jarRepackaging. See the docs for how to disable. If this doesn work, can you post a small |
disabling jarRepackaging did not help. import sbt._
import Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.SbtNativePackager._
object CorePackage {
import Utils._
val sysUser = "yyyy"
val sysGroup = "yyyy"
val userComment = "My service user"
val homeDir = "/opt/" + sysUser
val rootDir = homeDir + "/core/"
val pkgName = "xxx-core"
val preScript = """|getent group %2$s >/dev/null || groupadd -r %2$s
|getent passwd %1$s >/dev/null || \
|useradd -r -g %2$s -d %3$s -s /sbin/nologin \
| -c "%4$s" %1$s
|if [ $1 -eq 2 ] ; then
| # Upgrading package
| /sbin/service xxx-core stop -force >/dev/null 2>&1 || :
|fi
|exit 0
|
|""".stripMargin.format(
sysUser,
sysGroup,
homeDir,
userComment
)
val postScript = """|if [ $1 -eq 1 ] ; then
| # Initial installation
| /sbin/chkconfig xxx-core on >/dev/null 2>&1 || :
|fi
|
|""".stripMargin
val preunScript = """|if [ $1 -eq 0 ] ; then
| # Package removal
| /sbin/service xxx-core stop 15 -force >/dev/null 2>&1 || :
| /sbin/chkconfig --del xxx-core >/dev/null 2>&1 || :
|fi
|
|""".stripMargin
val postunScript = ""
def distributionSettings = linuxSettings ++ debianSettings ++ rpmSettings ++ universalSettings ++
Seq(
// Universal package
//packageBin in Universal <<= (packageBin in Universal).dependsOn(assembly),
name in Universal := pkgName + "-" + Versions.build,
mappings in Universal <+= assembly map { p => p -> "lib/xxx-core.jar" },
mappings in Universal += file("/dev/null") -> "logs/.keep",
mappings in Universal <+= baseDirectory map { d => d / "../conf/package/application.conf" -> "conf/application.conf" },
mappings in Universal <+= baseDirectory map { d => d / "../conf/package/logger.xml" -> "conf/logger.xml" },
mappings in Universal <++= baseDirectory map { d =>
listAll("*")(d / "scripts") flatMap {
script =>
script.relativeTo(d / "scripts").map(s => script -> ("bin/" + s.getPath))
} toSeq
},
// Linux package
maintainer := "Dmitry Zamaruev <[email protected]>",
packageSummary := "Xxxx core daemon",
packageDescription := "Xxxx core daemon",
packageArchitecture := "noarch",
linuxPackageMappings <+= assembly map { p =>
(packageMapping( p -> (rootDir + "lib/xxx-core.jar") )
withUser sysUser withGroup sysGroup withPerms "0644")
},
linuxPackageMappings <++= baseDirectory map { d => Seq(
packageMapping( d / "scripts/service.sh" -> (rootDir + "bin/service.sh") )
withUser sysUser withGroup sysGroup withPerms "0755",
packageMapping( d / "scripts/defaults.sh" -> (rootDir + "bin/defaults.sh") )
withUser sysUser withGroup sysGroup withPerms "0644" withConfig("noreplace"),
packageMapping( d / "../conf/package/application.conf" -> (rootDir + "conf/application.conf") )
withUser sysUser withGroup sysGroup withPerms "0644" withConfig("noreplace"),
packageMapping( d / "../conf/package/logger.xml" -> (rootDir + "conf/logger.xml") )
withUser sysUser withGroup sysGroup withPerms "0644" withConfig("noreplace"),
packageMapping( d / "scripts/init.d/xxx-core.rhel.sh" -> "/etc/init.d/xxx-core" )
withUser "root" withGroup "root" withPerms "0755",
// HACK to create dirs
packageMapping( file("/dev/null") -> ("/var/run/" + sysUser + "/.keep-xxx-core") )
withUser "root" withGroup "root" withPerms "0644",
packageMapping( file("/dev/null") -> (rootDir + "logs/.keep-xxx-core") )
withUser "root" withGroup "root" withPerms "0644",
// HACK to set dir permissions
packageMapping( d -> (rootDir + "logs") ) withUser sysUser withGroup sysGroup withPerms "0755",
packageMapping( d -> (rootDir + "conf") ) withUser sysUser withGroup sysGroup withPerms "0755",
packageMapping( d -> (rootDir + "bin") ) withUser sysUser withGroup sysGroup withPerms "0755",
packageMapping( d -> ("/var/run/" + sysUser) ) withUser sysUser withGroup sysGroup withPerms "0755"
)},
// RPM specific
name in Rpm := pkgName,
version in Rpm := Versions.build,
//packageBin in Rpm <<= (packageBin in Rpm).dependsOn(assembly),
rpmRelease := Versions.release,
rpmVendor := "My Inc.",
rpmGroup := Some("MyGroup"),
rpmBrpJavaRepackJars := false,
rpmLicense := Some("Proprietary"),
rpmRequirements += "jre >= 1.6.0",
rpmRequirements += "mongo-10gen-server >= 2.0.2",
rpmRequirements += "rabbitmq-server >= 2.8.0",
rpmPre := Some(preScript),
rpmPost := Some(postScript),
rpmPreun := Some(preunScript),
rpmPostun := Some(postunScript)
)
} |
Did you turn the repackaging on? So it looks like this rpmBrpJavaRepackJars := false, The error is a bit spurious
So, the |
I try with rpmBrpJavaRepackJars := false - same thing ( On Thu, Aug 21, 2014 at 9:53 PM, Nepomuk Seiler [email protected]
|
You have to set For debugging first take a look at the .spec file created in, AFAIK, target/rpm/RPMS . Everything is defined in there. You can change something and run the rpm build from CLI yourself. Take a look at the RpmHelper class to find the commands. |
Aliluia, [info] Executing(%install): /bin/sh -e bash executed with --rpm-requires option instead of some rpm* binary |
Aliluia,
bash executed with |
I think you have to dig for rpm on your own. These issues are all rpm related, why
|
@awasilyev did you fix this issue? i'm running into the same thing, not sure yet why lib magic is involved here but it appears to related to the fact that bash on OSX doesn't support the --rpm-requires option like it does on a RHEL variant. |
@awasilyev @nefilim Regards, |
@IrfanAnsari nope not really, i've opened an issue here: Homebrew/legacy-homebrew#35062 there's a patch in there that works apparently, i briefly tried it yesterday but for some reason homebrew didn't pick it up. i haven't looked deeper into it, i've resorted to a linux build server when i encountered this originally so just going with that for now. |
Thanks @nefilim for updating :) |
Thanks Guys, much appreciated your reply. I will try the patch at some point and will post about how it goes. Regards, |
Thank you, this page solve my problem with native packager. Here is what I did on my os x el capitan: |
latest sbt-native-packager. rpmbuild version 5.4.4
The text was updated successfully, but these errors were encountered: