rpm-spec

can an RPM spec file “include” other files?

你离开我真会死。 提交于 2020-01-02 01:30:30
问题 Is there a kind of "include" directive in RPM spec? I couldn't find an answer by googling. Motivation : I have a RPM spec template which the build process modifies with the version, revision and other build-specific data. This is done by sed currently. I think it would be cleaner if the spec would #include a build-specific definitions file, which would be generated by the build process, so I don't need to search and replace in the spec. If there is no include , is there an idiomatic way to do

RPM: loading bash script in %pre scriptlet

旧时模样 提交于 2020-01-01 18:09:04
问题 I've put some common utility scripts into common.sh , which I want to use in my RPM specfile during %pre . common.sh is located in the root of the RPM package. What I was planning to do is simply call something like source common.sh , but how can I access common.sh from the RPM during %pre ? 回答1: I was able to solve this using RPM macros, the following way: Before doing rpmbuild I have put common.spec into the SPECS folder. common.spec %define mymacro() (echo -n "My arg is %1 " ; sleep %1 ;

Can some specific autodetected dependency be ignored upon rpmbuild

一世执手 提交于 2019-12-30 09:41:06
问题 rpmbuild can autodetect dependencies by looking up shared libraries required by binaries included in the package and, while this is a good think almost every time, there are time when it is undesirable but only for some specific libraries. I am referring to the case where some binary file requires libraries that are not provided to the system via its rpm package management but installed directly by third party installers. Now, the question is: is there a way to keep the autodetect feature

How to run and interact with a script from within an RPM?

﹥>﹥吖頭↗ 提交于 2019-12-25 11:53:18
问题 I'm building an RPM which needs to run a bash script as root. The %install stanza of the spec file is: %install cp %{SOURCE1} %{SOURCE2} %{_tmppath}/%{name}-%{version}-%{release} cd %{_tmppath}/%{name}-%{version}-%{release} chmod u+x %{installscript} sudo ./%{installscript} Where %{installscript} is the script that runs as root with sudo. rpmbuild executes %{installscript} and creates the RPM (without problems). However, when I install the RPM: $ sudo rpm -Uvh $rpmpath Preparing... ##########

Is there a way to log activities done by a rpm?

不羁岁月 提交于 2019-12-23 02:31:31
问题 I am trying to log the activities done by my rpm, but unable to find a way to do it. I am looking for some way to do it through the spec file itself. If there are 5 steps my rpm performs, I need a way to log these steps and their results to a log. I found this after a brief google search - http://www.rpm.org/wiki/RpmLog . It seems like this work is still underway(?). I was able to create a directory to save the logs following this, but how do I actually write something to a log file in this

RPM spec to require specific RHEL release

心已入冬 提交于 2019-12-23 01:42:10
问题 In an RPM spec file, what is a good way of requiring a minimum RHEL distribuition? I tried to make RHEL 6.3 a prerequisite using: Requires: redhat-release-server-6Server >= 6.3 This blocks the install on 6.2 and 6.3 with: error: Failed dependencies: redhat-release-server-6Server >= 6.3 is needed by my.package-1.2.0-0.x86_64 I also tried: Requires: redhat-release >= 6.3 which did not fail the dependecy check on either 6.2 or 6.3. 回答1: The redhat-release-server-6Server-6.3.0.3.el6.x86_64 (on my

Conditionally include file in an RPM

守給你的承諾、 提交于 2019-12-22 09:41:02
问题 How can I conditionally include a file in an .rpm based on a define _foobar being set or not? The define _foobar would contain the absolute path inside the build root. The file is there. According to the documentation, I expected the following to work (note: there are more files in this %files section, but this is the gist): %files %if %{_foobar} %{_foobar} %endif which, however, gives me the error: error: parse error in expression error: /path/to/specfile:LINENO: parseExpressionBoolean

How to create RPM subpackages using the same paths for different envs?

a 夏天 提交于 2019-12-22 09:39:11
问题 I would like to use a rpm to build subpackages for different environments (live,testing,developer) but for the same files, so having a package called name-config-live, one called name-config-testing and one called name-config-developer and in them to have the same paths but each with the configs corresponding to the environment it's named after. as an example let's say on all environments I have a file called /etc/name.conf and on testing I want it to contain "1", on development "2" and on

File listed twice in rpm spec file

跟風遠走 提交于 2019-12-22 06:01:14
问题 The files section of my spec-file looks like this: %files %{prefix}/htdocs/ %config %{prefix}/htdocs/share/settings/config.inc.php Now, since the config file is already included in the %{prefix}/htdocs/ line I get the warning 'File listed twice'. One way around would be, to list every single file within %{prefix}/htdocs/ , except the config file. But my question is: Is there a better way around this issue, than listing all files? 回答1: Unfortunately not. RPM is quite oldschool software, but

File listed twice in rpm spec file

拥有回忆 提交于 2019-12-22 06:01:06
问题 The files section of my spec-file looks like this: %files %{prefix}/htdocs/ %config %{prefix}/htdocs/share/settings/config.inc.php Now, since the config file is already included in the %{prefix}/htdocs/ line I get the warning 'File listed twice'. One way around would be, to list every single file within %{prefix}/htdocs/ , except the config file. But my question is: Is there a better way around this issue, than listing all files? 回答1: Unfortunately not. RPM is quite oldschool software, but