Skip to content
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

CentOS Rpm Group field must be present in package: (main package) #309

Closed
gpatwa opened this issue Jul 29, 2014 · 8 comments
Closed

CentOS Rpm Group field must be present in package: (main package) #309

gpatwa opened this issue Jul 29, 2014 · 8 comments
Labels

Comments

@gpatwa
Copy link

gpatwa commented Jul 29, 2014

I am building rpm for CentOS and getting below error, does any one else encounter similar issue

[root@centos58 kafka-web-console]# activator rpm:packageBin
[info] Loading project definition from /opt/kafka-web-console/project
[info] Set current project to kafka-web-console (in build file:/opt/kafka-web-console/)
[info] Wrote /opt/kafka-web-console/target/scala-2.10/kafka-web-console_2.10-2.1.0.pom
[error] error: Group field must be present in package: (main package)
[info] Building target platforms: noarch-Gopal Patwa-Linux
[info] Building for target noarch-Gopal Patwa-Linux
java.lang.RuntimeException: Unable to run rpmbuild, check output for details.
        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:285)
        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$rpmSettings$30.apply(RpmPlugin.scala:67)
        at com.typesafe.sbt.packager.rpm.RpmPlugin$$anonfun$rpmSettings$30.apply(RpmPlugin.scala:65)
        at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
        at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)

plugins.sbt content:

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.3")

build.sbt

import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._

name := "kafka-web-console"

version := "2.1.0"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  "org.squeryl" % "squeryl_2.10" % "0.9.5-6",
  "com.twitter" % "util-zk_2.10" % "6.11.0",
  "com.twitter" % "finagle-core_2.10" % "6.15.0",
  "org.quartz-scheduler" % "quartz" % "2.2.1",
  "org.apache.kafka" % "kafka_2.10" % "0.8.1.1"
    exclude("javax.jms", "jms")
    exclude("com.sun.jdmk", "jmxtools")
    exclude("com.sun.jmx", "jmxri")
)

play.Project.playScalaSettings

packageArchetype.java_server

maintainer in Rpm := "Gopal Patwa <gpatwa@stubhub.com>"

packageSummary in Rpm := "Kafka Web Console"

packageDescription := "A web application to monitor kafka web console"

rpmGroup := None

rpmRelease := "1"

rpmVendor := "Gopal Patwa"

rpmUrl := Some("http://github.com/muuki88/sbt-native-packager")

rpmLicense := Some("Apache v2")
@kardapoltsev
Copy link
Member

From your logs:

[error] error: Group field must be present in package: (main package)

From your configs:

rpmGroup := None

Try to add rpmGroup := Some("GroupName")

@muuki88 muuki88 added the rpm label Jul 30, 2014
@muuki88
Copy link
Contributor

muuki88 commented Aug 2, 2014

rpm on group

The group tag is used to group packages together by the types of functionality they provide. The group specification looks like a path and is similar in function, in that it specifies more general groupings before more detailed ones. For example, a package containing a text editor might have the following group:

Examples are

Group: Applications/Spreadsheets
Applications/Editors
Development/Others

@muuki88 muuki88 closed this as completed Aug 2, 2014
@gpatwa
Copy link
Author

gpatwa commented Aug 3, 2014

Thank you it worked after adding "rpmGroup := Some("GroupName")"

@gpatwa
Copy link
Author

gpatwa commented Aug 3, 2014

I am new to Playframework and I have one more question for Overriding template http://www.scala-sbt.org/sbt-native-packager/GettingStartedApplications/OverridingTemplates.html

where do yo add this template "src/templates/bash-template" for palyframework app, since there is no "src" directory

I am using this play app to build to RPM
https://github.com/claudemamo/kafka-web-console

@muuki88
Copy link
Contributor

muuki88 commented Aug 3, 2014

Simply add it ;)

app
conf
src
...

@gpatwa
Copy link
Author

gpatwa commented Aug 4, 2014

Thanks, I tried that before but for some reason I thought it is not working:), which was working always to overwrite using etc-default file.

Now it works perfectly fine.

Just some comments for creating system user, I can create this user before install, but it seems for CentOS 5.8 "--system" option does not work, it need to use "-r"

OS Details:
[root@centos58 kafka-web-console]# cat /proc/version
Linux version 2.6.18-308.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)) #1 SMP Tue Feb 21 20:06:06 EST 2012

RPM Install Logs:
[root@centos58 kafka-web-console]# rpm -ivh target/rpm/RPMS/noarch/kafka-web-console-2.1.0-1.noarch.rpm
Preparing... ########################################### [100%]
Creating system group: kafka
groupadd: unrecognized option `--system'
Usage: groupadd [options] group

Options:
-f, --force force exit with success status if the specified
group already exists
-r, create system account
-g, --gid GID use GID for the new group
-h, --help display this help message and exit
-K, --key KEY=VALUE overrides /etc/login.defs defaults
-o, --non-unique allow create group with duplicate
(non-unique) GID

Creating system user: kafka
useradd: unknown group kafka
error: %pre(kafka-web-console-2.1.0-1.noarch) scriptlet failed, exit status 6
error: install: %pre scriptlet failed (2), skipping kafka-web-console-2.1.0-1

@muuki88
Copy link
Contributor

muuki88 commented Aug 5, 2014

Which version of rpm are you using. It should be at least 4.x.x. All our rpm tests run successfully on travis :/

@gpatwa
Copy link
Author

gpatwa commented Aug 5, 2014

[root@centos58 noarch]# rpm -qa | grep rpm
rpm-build-4.4.2.3-34.el5
rpm-devel-4.4.2.3-34.el5
rpm-libs-4.4.2.3-34.el5
rpm-python-4.4.2.3-34.el5
redhat-rpm-config-8.0.45-32.el5.centos
rpm-libs-4.4.2.3-34.el5
rpm-devel-4.4.2.3-34.el5
rpm-4.4.2.3-34.el5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants