Ich versuche, eine rpm für Centos/Fedora erstellen sbt
mit und ich habe diese hinzugefügt in project/plugins.sbt
:SBT: Aufbau Umdrehungen pro Minute mit sbt-native-Verpacker
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.1")
und in der build.sbt
Datei:
lazy val root = (project in file(".")).
enablePlugins(RpmPlugin).
settings(
scalaVersion := currentScalaVersion,
packageName in Rpm := "MyProject",
maintainer in Linux := "First Lastname <[email protected]>",
packageArchitecture in Rpm := "noarch",
packageSummary in Linux := "My custom package summary",
packageDescription := "My longer package description",
rpmRelease := "1",
rpmVendor := "typesafe",
rpmUrl := Some("http://www.somewhere.com"),
rpmLicense := Some("Apache v2"),
rpmGroup := Some("System Environment/Daemons")
)
jedoch, wenn ich von der Kommandozeile:
$> sbt rpm:package-bin
ich zurück:
[info] Building target platforms: noarch-typesafe-Linux
[info] Building for target noarch-typesafe-Linux
[info] Executing(%install): /bin/sh -e /tmp/sbt_d54063d5/rpm-tmp.giKTst
[error] + umask 022
[error] + cd /home/justdev/dev/workspace/my-project/target/rpm/BUILD
[error] + '[' /home/justdev/dev/workspace/my-project/target/rpm/buildroot '!='/']'
[error] + rm -rf /home/justdev/dev/workspace/my-project/target/rpm/buildroot
[error] ++ dirname /home/justdev/dev/workspace/my-project/target/rpm/buildroot
[error] + mkdir -p /home/justdev/dev/workspace/my-project/target/rpm
[error] + mkdir /home/justdev/dev/workspace/my-project/target/rpm/buildroot
[error] + '[' -e /home/justdev/dev/workspace/my-project/target/rpm/buildroot ']'
[error] + mv '/home/justdev/dev/workspace/my-project/target/rpm/tmp-buildroot/*' /home/justdev/dev/workspace/my-project/target/rpm/buildroot
[error] mv: cannot stat '/home/justdev/dev/workspace/my-project/target/rpm/tmp-buildroot/*': No such file or directory
[error] error: Bad exit status from /tmp/sbt_d54063d5/rpm-tmp.giKTst (%install)
[info]
[info]
[info] RPM build errors:
[error] Bad exit status from /tmp/sbt_d54063d5/rpm-tmp.giKTst (%install)
java.lang.RuntimeException: Unable to run rpmbuild, check output for details. Errorcode 1
at scala.sys.package$.error(package.scala:27)
at com.typesafe.sbt.packager.rpm.RpmHelper$$anonfun$buildPackage$1.apply(RpmHelper.scala:89)
at com.typesafe.sbt.packager.rpm.RpmHelper$$anonfun$buildPackage$1.apply(RpmHelper.scala:74)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at com.typesafe.sbt.packager.rpm.RpmHelper$.buildPackage(RpmHelper.scala:74)
at com.typesafe.sbt.packager.rpm.RpmHelper$.buildRpm(RpmHelper.scala:20)
at com.typesafe.sbt.packager.rpm.RpmPlugin$$anonfun$projectSettings$31.apply(RpmPlugin.scala:100)
at com.typesafe.sbt.packager.rpm.RpmPlugin$$anonfun$projectSettings$31.apply(RpmPlugin.scala:98)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (rpm:packageBin) Unable to run rpmbuild, check output for details. Errorcode 1
Dies ist die target/rpm/SPECS/MyProject.spec
erzeugt wird:
Name: MyProject
Version: 1
Release: 1
Summary: My custom package summary
prefix: /opt
License: Apache v2
Vendor: typesafe
URL: http://www.somewhere.com
Group: System Environment/Daemons
AutoProv: yes
AutoReq: yes
BuildRoot: /home/justdev/dev/workspace/my-project/target/rpm/buildroot
BuildArch: noarch
%description
My longer package description
%install
if [ -e "$RPM_BUILD_ROOT" ]; then
mv "/home/justdev/dev/workspace/my-project/target/rpm/tmp-buildroot"/* "$RPM_BUILD_ROOT"
else
mv "/home/justdev/dev/workspace/my-project/target/rpm/tmp-buildroot" "$RPM_BUILD_ROOT"
fi
%files
Ich bin nicht sicher, was in der Konfiguration fehlt. Irgendeine Hilfe?
UPDATE
Das ist meine neue conf:
lazy val root = (project in file(".")).
enablePlugins(JavaServerAppPackaging, RpmPlugin).
settings(
scalaVersion := currentScalaVersion,
defaultLinuxInstallLocation := "/opt",
rpmPrefix := Some("/opt"),
linuxPackageSymlinks := Seq.empty,
defaultLinuxLogsLocation := defaultLinuxInstallLocation + "/" + name,
packageName in Rpm := "myproject",
packageArchitecture in Rpm := "noarch",
rpmRelease := "1",
rpmVendor := "typesafe",
rpmUrl := Some("http://www.somewhere.com"),
rpmLicense := Some("Apache v2"),
rpmGroup := Some("System Environment/Daemons")
)
das Paket baut jetzt, aber die Drehzahl ist nicht ganz sauber aufgrund einiger dirs wie: /[email protected]/[email protected]/myproject/
Dies sind die Nachrichten, die ich sehen kann:
[info] Building target platforms: noarch-typesafe-Linux
[info] Building for target noarch-typesafe-Linux
[info] Executing(%install): /bin/sh -e /tmp/sbt_6e8b6db6/rpm-tmp.3IdsrH
[error] + umask 022
[error] + cd /home/justdev/dev/workspace/myproject/target/rpm/BUILD
[error] + '[' /home/justdev/dev/workspace/myproject/target/rpm/buildroot '!='/']'
[error] + rm -rf /home/justdev/dev/workspace/myproject/target/rpm/buildroot
[error] ++ dirname /home/justdev/dev/workspace/myproject/target/rpm/buildroot
[error] + mkdir -p /home/justdev/dev/workspace/myproject/target/rpm
[error] + mkdir /home/justdev/dev/workspace/myproject/target/rpm/buildroot
[error] + '[' -e /home/justdev/dev/workspace/myproject/target/rpm/buildroot ']'
[error] + mv /home/justdev/dev/workspace/myproject/target/rpm/tmp-buildroot/etc /home/justdev/dev/workspace/myproject/target/rpm/tmp-buildroot/opt '/home/justdev/dev/workspace/myproject/target/rpm/tmp-buildroot/[email protected]' /home/justdev/dev/workspace/myproject/target/rpm/tmp-buildroot/var /home/justdev/dev/workspace/myproject/target/rpm/buildroot
[error] + /usr/lib/rpm/check-buildroot
[error] + /usr/lib/rpm/redhat/brp-compress
[error] + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
[error] + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
[error] + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
[error] + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
[error] + /usr/lib/rpm/redhat/brp-python-hardlink
[error] + /usr/lib/rpm/redhat/brp-java-repack-jars
[info] Processing files: myproject-1.b1-1.noarch
[info] Provides: myproject = 1.b1-1 config(myproject) = 1.b1-1 osgi(ch.qos.logback.classic) = 1.1.3 osgi(ch.qos.logback.core) = 1.1.3 osgi(com.typesafe.akka.actor) = 2.4.8 osgi(com.typesafe.akka.cluster) = 2.4.8 osgi(com.typesafe.akka.cluster.tools) = 2.4.8 osgi(com.typesafe.akka.contrib) = 2.4.8 osgi(com.typesafe.akka.http.core) = 2.4.8 osgi(com.typesafe.akka.http.experimental) = 2.4.8 osgi(com.typesafe.akka.http.spray.json.experimental) = 2.4.8 osgi(com.typesafe.akka.parsing) = 2.4.8 osgi(com.typesafe.akka.persistence) = 2.4.8 osgi(com.typesafe.akka.protobuf) = 2.4.8 osgi(com.typesafe.akka.remote) = 2.4.8 osgi(com.typesafe.akka.slf4j) = 2.4.8 osgi(com.typesafe.akka.stream) = 2.4.8 osgi(com.typesafe.config) = 1.3.0 osgi(com.typesafe.sslconfig) = 0.2.1 osgi(com.typesafe.sslconfig.akka) = 0.2.1 osgi(io.spray.json) = 1.3.2 osgi(org.jboss.netty) = 3.10.6 osgi(org.reactivestreams.reactive-streams) = 1.0.0 osgi(org.scala-lang.modules.scala-java8-compat) = 0.7.0 osgi(org.scala-lang.modules.scala-parser-combinators) = 1.0.4 osgi(org.scala-lang.scala-library) = 2.11.8 osgi(org.scala-lang.scala-reflect) = 2.11.8 osgi(slf4j.api) = 1.7.16
[info] Requires(interp): /bin/sh /bin/sh /bin/sh /bin/sh
[info] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[info] Requires(pre): /bin/sh
[info] Requires(post): /bin/sh
[info] Requires(preun): /bin/sh
[info] Requires(postun): /bin/sh
[info] Requires: osgi(com.typesafe.sslconfig)
[info] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/justdev/dev/workspace/myproject/target/rpm/buildroot
[info] Wrote: /home/justdev/dev/workspace/myproject/target/rpm/RPMS/noarch/myproject-1.b1-1.noarch.rpm
[info] Executing(%clean): /bin/sh -e /tmp/sbt_6e8b6db6/rpm-tmp.o4ADv9
[error] + umask 022
[error] + cd /home/justdev/dev/workspace/myproject/target/rpm/BUILD
[error] + /usr/bin/rm -rf /home/justdev/dev/workspace/myproject/target/rpm/buildroot
[error] + exit 0
[success] Total time: 60 s, completed 09-Aug-2016 10:39:18
UPDATE 2
fand ich, dass in der /etc/init.d/my-project dort diese Zeile:
RUN_CMD="$exec >> [email protected]/[email protected]/my-project/$logfile 2>&
und es hat genau den gleichen Pfad für den logfile
wie in der leeres Verzeichnis in rpm erstellt.
Laufen Sie auf Linux? –
ja, CentOs 7 auf meinem lokalen. – Randomize
Versuchen Sie, ''/ home/joddev/dev/workspace/mein-projekt/target/rpm/tmp-buildroot /'' manuell zu erstellen und –