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

Need to be able to specify what user and group the RPM installs files #75

Closed
lewisskslipstone opened this issue Nov 14, 2013 · 3 comments

Comments

@lewisskslipstone
Copy link

Need the ability to specify which user and group the files get when they are installed. Currently we hard code the file user and group to root:root in GenericPackageSettings.scala

Seq(
packageMappingWithRename((binaries ++ directories):*) withUser "root" withGroup "root" withPerms "0755",
packageMappingWithRename(compressedManPages:).gzipped withUser "root" withGroup "root" withPerms "0644",
packageMappingWithRename(configFiles:
) withConfig() withUser "root" withGroup "root" withPerms "0644",
packageMappingWithRename(remaining:
*) withUser "root" withGroup "root" withPerms "0644"
)

@jsuereth
Copy link
Member

If you need to change what the "generic" settings are doing, you can run a transformation on them, like so:

linuxPackageMappings := {
  val old = linuxPackageMappings.value
  for {
    mappings <- old
    if needsMyUser(mappings)
  } yield {
     val meta = mappings.fileData.withUser("myUser").withGroup("myGroup")
     mappings.copy(fileData = meta)
  }
}

Another thing I'd recommend here is to only add the user bit for RPMs (debians are more finicky here, and we haven't figured out the best way to do UIDs):

linuxPackageMappings in Rpm := {
  val old = linuxPackageMappings.value
  ....
}

I'm going to leave this open to provide some configuration to the "automatic" rpm settings for this kind of functoinality. Let me know if the mechanism above doesn't work for you.

@muuki88
Copy link
Contributor

muuki88 commented Feb 6, 2014

This is not the case anymore. The keys

appUser in Linux
appGroup in Linux

are used as defaults

@muuki88
Copy link
Contributor

muuki88 commented Feb 6, 2014

IMHO this ticket can be closed, as the functionality is documented in the archetypes description.

This is the default setting and the way you change it:

appUser <<= normalizedName, 
appGroup <<= appUser in Linux

normalizedName may be ambigious, use sbt.Keys.normalizedName then.

All your packages are then owned by appUser / appGroup.

@muuki88 muuki88 closed this as completed Feb 6, 2014
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