简体   繁体   English

如何在Sailfish OS项目的RPM包中添加文件?

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

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. 我正在尝试构建一个Sailfish OS应用程序,我需要使用*.wav文件,这些文件将通过*.rpm包进行分发。 In my case, these files are to be put in /usr/share/[application_name]/sounds/* . 在我的例子中,这些文件将放在/usr/share/[application_name]/sounds/* How do I set up the *.pro and *.yamp files accordingly? 如何相应地设置*.pro*.yamp文件?

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. 这不是一个RPM问题本身:如果您在* .rpm包中提供内容,您似乎在询问如何通过* .pro和* .yamp配置您的应用程序。

The packaging answer is: Patch the configuration files exactly the same as if you were installing the *.wav files manually (ie not through *.rpm). 打包答案是:修补配置文件与手动安装* .wav文件完全相同(即不通过* .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. 您需要将* .wav内容复制到%buildroot树中,该树用于暂存要包含在包中的文件,以及修改后的* .pro和* .yamp内容。 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 (ie w/o the %buildroot prefix used for staging files while building). 要包含在* .rpm包中的所有文件都需要在%files文件中完全按照要安装的方式提及(即没有构建时用于暂存文件的%buildroot前缀)。

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. 我要感谢该项目的所有者: https//github.com/krig/metronom-sailfish从该项目的.pro.yaml文件中我发现了如何部署文件。 First, we declare that constant: DEPLOYMENT_PATH = /usr/share/$${TARGET} which seems to hold the path to /usr/share/[appname] . 首先,我们声明常量: DEPLOYMENT_PATH = /usr/share/$${TARGET} ,它似乎保存了/usr/share/[appname]的路径。 Next, we define some kind of a variable ( TODO : find a more detailed explanation of that). 接下来,我们定义某种变量( TODO :找到更详细的解释)。 The definition of that first sets the path to the files, for example, data.files = data (the second data is the folder). 它的定义首先设置文件的路径,例如, data.files = data (第二个data是文件夹)。 Next, we set data.path to $${DEPLOYMENT_PATH} . 接下来,我们将data.path设置为$${DEPLOYMENT_PATH} We list all the files in OTHER_FILES and add the setting, in our case, data , to INSTALLS . 我们列出了OTHER_FILES中的所有文件,并将设置(在我们的例子中是data )添加到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. 现在,我们已完成.pro文件,我们移动到.rpm.yaml文件,我们添加到Files:部分的必要行,在我们的例子中, - '%{_datadir}/%{name}/data' ,最后一个是我们需要添加的文件夹。 TODO : to whoever is more experienced, please provide a more detailed answer. TODO :对于经验更丰富的人,请提供更详细的答案。

Did you check https://sailfishos.org/develop-packaging-apps.html carefully? 你仔细检查了https://sailfishos.org/develop-packaging-apps.html吗? May helps. 可以帮忙。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM