How to add files in the RPM package of an Sailfish OS project?

831 views Asked by At

I am trying to build a Sailfish OS app, and I need to use *.wav files, which are to be distributed through the *.rpm package. In my case, these files are to be put in /usr/share/[application_name]/sounds/*. How do I set up the *.pro and *.yamp files accordingly?

3

There are 3 answers

0
Ivan Bratoev On BEST ANSWER

I finally found an answer! I want to thank to the owner of that project: https://github.com/krig/metronom-sailfish From the .pro and the .yaml files of this project i found out how to deploy the files. First, we declare that constant:DEPLOYMENT_PATH = /usr/share/$${TARGET} which seems to hold the path to /usr/share/[appname]. Next, we define some kind of a variable (TODO: find a more detailed explanation of that). The definition of that first sets the path to the files, for example, data.files = data (the second data is the folder). Next, we set data.path to $${DEPLOYMENT_PATH}. We list all the files in OTHER_FILES and add the setting, in our case, data, to INSTALLS. Now, that we are finished with the .pro file, we move to the .yaml file for the .rpm and we add to the necessary line to the Files: section, in our case, - '%{_datadir}/%{name}/data', the last being the folder we need to add. TODO: to whoever is more experienced, please provide a more detailed answer.

4
Jeff Johnson On

This isn't a RPM question per se: you seem to be asking how to configure your application through *.pro and *.yamp if you deliver content in *.rpm packages.

The packaging answer is: Patch the configuration files exactly the same as if you were installing the *.wav files manually (i.e. not through *.rpm).

You will need to copy the *.wav content into the %buildroot tree that is used to stage the files to be included in the package, as well as the modified *.pro and *.yamp content. All the files to be included in the *.rpm package will need to be mentioned in the %files manifest exactly as they are to be installed (i.e. w/o the %buildroot prefix used for staging files while building).

1
isgursoy On

Did you check https://sailfishos.org/develop-packaging-apps.html carefully? May helps.