Questions tagged [rpm-spec]

The rpm spec file contains the information required by RPM to build a package.

The spec file is at the heart of RPM's packaging building process. Similar in concept to a , it contains information required by RPM to build the package, as well as instructions telling RPM how to build it. The spec file also dictates exactly what files are a part of the package, and where they should be installed.

(From the max-rpm book)

This tag is closely related to and . You should research those tags to see if a similar question exists.

578 questions
5
votes
4 answers

How to a detect if a RPM is a source rpm or a binary rpm?

How to a detect if a RPM is a source rpm or a binary rpm? Obviously I do not want to rely on the file name.
sorin
  • 161,544
  • 178
  • 535
  • 806
4
votes
1 answer

what is the '0' meaning in rpm conditional macros

When reading some rpmbuild spec files, I come across some of the conditional macros which puzzle me. example1 %if 0%{?rhel} > 7 blah blah %endif # I understand the above block tries to check if the # red hat enterprise linux version is above 7,…
Xin Cheng
  • 1,432
  • 10
  • 17
4
votes
1 answer

Add SHA256 Digests to RPM Packages

I want to add the SHA256 digests for header and payload to my RPM packages. currently, it is building with sha1 digest. below is the output for rpm --checksig --verbose pkg_name.rpm Header SHA1 digest: OK MD5 digest: OK Environment -…
4
votes
1 answer

How to include pip packages in an rpm build

I want to include a Python package dependency (installed using pip3 install) in an rpm package. I cannot install using dnf because its version is out of date. rpm returns the following error if I install the dependency using pip3 install: error:…
user11046041
4
votes
2 answers

How can I force Anaconda to install my package after coreutils?

I have a customized RPM that builds a set of subpackages. Each subpackage has a %post script in the spec file that is used to copy some symlinks to another folder: %post server echo "Copying symlinks..." >> /tmp/mystuff.log pwd >>…
Justin ᚅᚔᚈᚄᚒᚔ
  • 15,081
  • 7
  • 52
  • 64
4
votes
5 answers

What does the || : in this line of bash script from an rpm spec file do?

ln -s /var/log/$SERVICE_NAME $RPM_INSTALL_PREFIX/logs || : In the rpm spec file every line ends with || : What is the significance of the || : and why is it there?
user177800
4
votes
2 answers

How overwrite optflags direct in rpm spec file?

How correct overwrite %optflags direct in spec file ? $ rpm --eval %optflags # Fedora 29 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches…
Jan
  • 41
  • 4
4
votes
2 answers

What does "%{__install}" mean in terms of rpm spec?

Maybe it's very stupid question but I can't find out the answer. I've neverr tried to write a spec file for rpm package until today. I found an example of spec and I see a lot of %{__install} thinks in the %install section. As far as I understand by…
Paul
  • 6,641
  • 8
  • 41
  • 56
4
votes
3 answers

Using rpmbuild when source tar directory doesn't correspond to name-version

I'm trying to build an rpm from source-1.4.3-linux.tgz (that is downloaded so I don't control the name) and the file untars into the directory source-1.4.3-linux. In my source.spec file, I have Name: source Version: 1.4.3 So it is probably quite…
Boyd
  • 351
  • 4
  • 14
4
votes
1 answer

Why does %autosetup perform patching BEFORE extracting sources?

I have a very straightforward arrangement -- one source tarball, one patch: Source: http://...../foo-%{version}.tar.gz Patch: my-patch-for-foo.diff ... %prep %autosetup -v -n bar-%{version} However, when I attempt to use the %autosetup in the %prep…
Mikhail T.
  • 3,043
  • 3
  • 29
  • 46
4
votes
0 answers

Packaging directory with cpack for rpm

I am trying to create a rpm package with directory with lot of files using cmake http://www.rpm.org/max-rpm/s1-rpm-inside-files-list.html To make this situation a bit easier, if the %files list contains a path to a directory, RPM will…
trax
  • 739
  • 8
  • 21
4
votes
2 answers

RPM spec %post doesn't execute in rpmbuild

Given the minimal RPM spec file, that should only execute a %post stanza: $ cat ~/RPMBUILD/SPECS/test.spec Name: None Version: 1.0 Release: 1 Summary: Bla License: …
boardrider
  • 5,882
  • 7
  • 49
  • 86
4
votes
3 answers

How to make an rpm spec that installs libraries to /usr/lib xor /usr/lib64 based on arch?

I'm working on an RPM spec for centos and it needs to install the shared libraries to /usr/lib64 if the arch is 64 bit and /usr/lib otherwise?
Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
4
votes
1 answer

add a new file in existing RPM

I am modifying gnome-shell-3.8.xx.rpm package. I have created several patches for rpm and they are working fine. Now I want to add new source file in rpm but I am not able to find how to do it? For patches I have followed below approach: Download…
user746184
  • 105
  • 1
  • 10
4
votes
1 answer

How do I write an RPM macro which expands into a set of additional macros?

I am packaging an internal product which has dependencies on dozens of second level libraries. Ideally, these libraries would be created and managed as independent packages themselves, but our legacy build system makes this difficult. Instead, we…
Jeff W
  • 414
  • 5
  • 16