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

Recommended field for debian packages #285

Closed
nabeelio opened this Issue Nov 6, 2012 · 10 comments

Comments

Projects
None yet
2 participants
@nabeelio

nabeelio commented Nov 6, 2012

Is there a way to add the 'Recommended' field to the control packages? Or, to append the control package?

@nabeelio

This comment has been minimized.

nabeelio commented Nov 6, 2012

It would be great to be able to add any arbitrary fields to the control file. Right now I'm extracting it, editing the control file, and repackaging it... really slow.

This might already exist, but I'm not seeing how to accomplish it.

@nabeelio

This comment has been minimized.

nabeelio commented Nov 6, 2012

Ok, I do it this way now:

    --description "Server Package
Recommends: ${REQ_PACKAGES}" \

Which seems to work.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Nov 6, 2012

THe best way to edit the control file is using the --edit flag. If you set EDITOR env to a script, you can automate editing of the control file before packaging.

As for adding a flag to add a Recommends line, I think that sounds reasonable.

@nabeelio

This comment has been minimized.

nabeelio commented Nov 6, 2012

The EDITOR env is an idea, but since I have several packages created, with different recommends, that makes it a bit difficult and messy, but do-able - I'd have to get the script basename, and create another "recommends" file so that script can suck the contents in and add it.

I just did an ugly hack to the deb.erb to remove the space that prefixes multi-lined descriptions.

There are other options that I add through that 'description' hack - including the "SignWith" parameter, so I guess some general way of being able to add more parameters would be good.

It would be nice to point to my own template file for the controls too, at least that way, I can tailor the deb.erb per-package

Thanks!

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Nov 6, 2012

What does SignWith do? Keep in mind fpm generates debian packages without any debian tools. Does this SignWith field do anything special? Having a hard time finding docs on it.

In general, the point of FPM is to avoid having to know internals of horrible things like 'control' files. To that end, for each thing (recommends, etc) should generally be a flag instead of requiring you to do bizarre custom template things.

Regarding EDITOR, I think you're thinking too hard about it. It's easy to do call the following script 'controlfile.sh' and use it with EDITOR, such as:

 env EDITOR='sh fixcontrolfile.sh --recommend SomePackage' fpm --edit ...

This would be invoked as:

 sh fixcontrolfile.sh --recommend SomePackage /path/to/generated/control

This lets you replace the generated control file with anything you want, even if you just do some small edits to the file itself. This lets you fully automate generating your own custom control file with existing features in fpm and this you can do already today.

@nabeelio

This comment has been minimized.

nabeelio commented Nov 6, 2012

I was trying to do that with the EDITOR script, but I have about 20 packages in the recommends, all with version numbers. I was having some trouble with the command-line, but I can play with that.

And sorry - I was confusing the SignWith from the distribution file with the control.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Nov 6, 2012

Here's an example:

# Set 'Recommends: example (> 1.0)'
% EDITOR="sed -i -e 's/License:/Recommends: example (> 1.0)\n&/'" fpm -s dir -t deb -n fizzle --edit .zshrc
Created deb package {"path":"fizzle_1.0_amd64.deb"}

# Inspect it
% dpkg-deb -f fizzle_1.0_amd64.deb Recommends                                                              
example (> 1.0)
@nabeelio

This comment has been minimized.

nabeelio commented Nov 7, 2012

Makes perfect sense, now that I see it. Thanks a ton! I didn't see any example of the EDITOR variable, I was trying to go through the source to see how the editor was launched, but didn't get much time into it, so I wasn't quite sure. Are there other env variables that are available to set?

There are several levels of dependencies, ie, Recommends and Suggestions. I guess those two flags would be needed. It's easier with puppet to tell it to install all recommended packagers, vs the "apt-get -f install" to install all the dependencies when the apt-get fails

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Nov 27, 2012

This should be done by adding a --deb-recommends and --deb-suggestions flag until someone find similar features in other package systems.

I'll work on this when I can, but I welcome patches from all :)

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 5, 2013

This is done (--deb-recommends flag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment