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

%config for rpm #118

Open
glensc opened this issue Aug 24, 2015 · 4 comments
Open

%config for rpm #118

glensc opened this issue Aug 24, 2015 · 4 comments
Labels

Comments

@glensc
Copy link
Contributor

glensc commented Aug 24, 2015

the spec says there's config_files, useful for .deb, but not so useful for .rpm.

config_files '/etc/redis/redis.conf'

but i wonder what that statement mean? as if i build .rpm package using config_files, the files are marked as %config:

# rpm -qplc pkg/php-ClassLoader-1.2-1.noarch.rpm 
/usr/share/php/AbstractAutoload.php

meaning it's marked as %config, however, %config does have attributes, which really define it's usability, i.e default is to overwrite existing file preserve it as .rpmsave, but more useful is to preserve existing file and store new one as .rpmnew, which can be controlled as (in .spec):

%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/redis/redis.conf

so, i wonder which %config fpm-cookery (fpm?) uses, and can it be further tuned (like set those attributes per file or glob)

@beddari
Copy link
Contributor

beddari commented Aug 24, 2015

Commented in your other issue, the default is "noreplace", per https://github.com/jordansissel/fpm/blob/master/templates/rpm.erb#L241

@glensc
Copy link
Contributor Author

glensc commented Aug 24, 2015

i would prefer %config(noreplace) %verify(not md5 mtime size), should the default be changed? made configurable from recipe?

@bernd
Copy link
Owner

bernd commented Aug 30, 2015

Not sure why the spec says that about config_files. I didn't write that. 😄 To make %config configurable for RPM packages it needs to be configurable in fpm first.

I would also like to avoid having too many platform specific options in fpm-cookery. It is an abstraction over different packaging systems and there are tons of platform specific features in every one. Supporting everything under the sun would make fpm-cookery pretty bloated in my opinion and it would probably be easier to just create RPM spec files in the first place.

I agree that it would be good to make it even easier to set arbitrary fpm options to be able to access the full power of fpm. The fpm_attributes works for that but is a bit difficult to use because you have to find out how each fpm command line option translates to a config key in fpm_attributes. I guess that can only be solved by documenting them.

@bernd bernd added the feature label Sep 10, 2015
@apiemont
Copy link

was dealing with config files for rpm targets: I have marked one file as such, e.g. created the package with

$ fpm  -f -s dir -t rpm -n foo -v 1.0.0 --iteration 2 --description "A sample package" --config-files /etc/send_nsca.cfg opt/sbin/send_nsca=/sbin/send_nsca  opt/etc/send_nsca.cfg=/etc/send_nsca.cfg
$ rpm -qp --filesbypkg foo-1.0.0-1.x86_64.rpm 
foo                       /etc/send_nsca.cfg
foo                       /sbin/send_nsca

then installed the rpm via

# yum localinstall foo-1.0.0-1.x86_64.rpm
# rpm -qc foo
/etc/send_nsca.cfg

then I edited that file, (only uncommented one line), then created a new package (just bumbed revision number via the iteration option) and udated it

# yum localupdate foo-1.0.0-2.x86_64.rpm

and what I find in /etc is only the original config file (with my line commented out), but no .rpmnew one

# find  /etc -iname "*send_*"
/etc/send_nsca.cfg
# 

am I missing something? thx

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

4 participants