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?

- 4,001
- 19
- 31

- 235
- 2
- 13
3 Answers
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).

- 2,310
- 13
- 23
-
Actually the problem is with deploying those *.wavs as a whole, I could not find information on how to do that. Thus far I've copied the sounds folder to the root of the project, and, in the .pro file I've added "sounds/[every file one by one]" to OTHER_FILES, as in the yaml, in the Files category - '%{_datadir}/%{name}/sounds/[every file one by one]', but I am almost sure this is not correct, though I cannot find the correct way. How do I set those for deployment correctly? – Ivan Bratoev Nov 20 '14 at 16:12
-
1Here is how to add files to a *.rpm package: 1) Add a SourceN: directive (choose N appropriately) to the top of the *.spec. 2) In the %install section, you need to copy the file into the %buildroot staging area, creating any missing directories. 3) Add the *.wav file in the %files manifest, basically the path you copied into without the leading %buildroot – Jeff Johnson Nov 20 '14 at 20:07
-
the copy line should look like "cp %{SOURCEn} %{build root}/path/to/somewhere/sounds" where n == N (i.e. some number, chosen appropriately to not conflict with other Source: directives) – Jeff Johnson Nov 20 '14 at 20:11
-
Sorry, I know about *.rpm packaging, not sailfish configuration. – Jeff Johnson Nov 20 '14 at 20:14
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.

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

- 46
- 1
-
Yes, I did, lots of times. From it one would think that an .rpf file is dominant to write. Also, although the article is, as expected, well written, it could be better. At least, I read it carefully and still couldn't answer my question. – Ivan Bratoev Nov 24 '14 at 12:08