Reply
Thread Tools
Feathers McGraw's Avatar
Posts: 654 | Thanked: 2,368 times | Joined on Jul 2014 @ UK
#1
Does anyone know how to package a configuration file like /usr/share/packagename/foo.conf using the .yaml file in the Sailfish IDE?

All of the examples I have found have been for projects where the spec files have been written by hand instead of using the .yaml file to generate it. I would like to continue using the .yaml file if possible (and even if it isn't possible, I'd like to understand why not).

My .pro file contains a seciton like:

Code:
OTHER_FILES += qml/foo.qml \
 config/controlfile.conf \
I think I may need to create a new foo.prf containing something like:

Code:
config.files = controlfile.conf
config.path = /usr/share/$${TARGET}

INSTALLS += config
and add:

Code:
CONFIG +=foo
to the .yaml file (or can I just add the contents of the .prf file to the .yaml file directly?)

However, I'm also confused about how the secitons under FILES in the yaml file relate to the locations of files in the build root, and the final locations of files in the RPM. Is it correct that the locations in the build root and the RPM are the same?

What I think happens is that the .pro file determines which files are treated as part of the project, the "config.files" parameter in the .prf file controls which files are copied to the build root and the "config.path" parameter determines where they are copied, and then the FILES section in the yaml file decides which files from the build root make it into the actual RPM. Is that correct?

Based on that, I need an extra line in FILES to add the config file. Can I do:
Code:
- '%{_configdir}/controlfile.conf'
or is "%{_configdir}" not automatically set by "config.path" in the .prf file?

I've tried various combinations of options and I'm getting "file not found" at the stage where I attempt to build the RPM.

Sorry it's a long post. Would appreciate any pointers you can give.
 
Reply

Tags
config, sailfish, yaml file

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:27.