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
45
votes
7 answers

extract the spec file from rpm package

Is there any way to extract the spec file from rpm package ( I have only RPM file ) not by rpm --scripts -qp my-great-app-1.1.2.rpm ( this syntax not get the spec file only the scripts from the rpm)
jon
  • 903
  • 5
  • 14
  • 21
40
votes
4 answers

How do I get rpmbuild to download all of the sources for a particular .spec?

I am adding some sources to an existing rpm .spec file by URL and don't have them downloaded yet. Is there a way to get rpmbuild to download the sources rather than doing it manually?
joeforker
  • 40,459
  • 37
  • 151
  • 246
36
votes
3 answers

How to pass user defined parameters to rpmbuild to fill variables

is it possible to pass parameters to rpmbuild to fill user defined variables that are called inside the spec file? Example: The user defined variable %{foobar} which is called in the .spec file (but empty) should be filled with the variable which…
mat1010
  • 756
  • 1
  • 9
  • 17
31
votes
1 answer

RPM spec file - Is it possible to dynamically populate a spec file variable

I have a spec file. I need to %define a spec variable that gets its value from a one line file on the system. For example %define path `cat /home/user/path_file` and in path_file is one line /var/www/html/hosts This partially works. I say that…
last_shogun
  • 337
  • 1
  • 4
  • 8
27
votes
4 answers

rpmbuild change compression format

I try to pack some map files for our geoserver in an internal rpm package. For the build part, this is just to copy the files. I think this works as expected. But it takes terribly long to pack those 20GB of images. I've read that rpm internally…
mkraemerx
  • 1,713
  • 2
  • 17
  • 21
24
votes
2 answers

What does %defattr mean in RPM spec files?

While creating RPMs, the RPM spec files have a directive %defattr . I know that it defines the default attributes for the files that are installed by that RPM. If I write the %defattr as below, what does it mean? %defattr(-testuser, testuser)
Mariselvam
  • 1,093
  • 2
  • 15
  • 28
22
votes
6 answers

Can I use rpm to expand the macros in a specfile?

The concrete example being I have lots of specfiles with Source0: or other Source lines containing macros. How can I have these macros expanded without actually starting a build on the specfile or writing my own parser?
user376403
  • 1,085
  • 2
  • 9
  • 18
20
votes
2 answers

Python RPM I built won't install

Because I have to install multiple versions of Python on multiple Oracle Linux servers which are built via a kickstart process, I wanted to build a python rpm for our yum repository. I was able to build Python manually using 'make altinstall' which…
Ilane
  • 484
  • 7
  • 18
19
votes
3 answers

How do you make _topdir relative to the location of the .spec file when building an RPM?

I have a .spec file that relies on a variable called _topdir. Right now when you checkout the SRPM source from git, you have to go and change where _topdir is pointing to to get the rpmbuild to function correctly. # We need the following line so…
user177800
18
votes
3 answers

Define Version with script in RPM spec file

I have an RPM Spec file, building on rhel7 with rpmbuild, where I would like to define the Version with a script. I read here http://www.techrepublic.com/article/rpmproc-spec-file/ , That I can do this: %define version 1.2 Version: %{version} And…
Jimmie
  • 397
  • 2
  • 5
  • 20
15
votes
4 answers

Packaging symlinks via rpmbuild?

Is it possible to make rpmbuild to preserve symlinks on packaging? The current behavior is to create copies of files, which I would like to avoid.
SyBer
  • 5,407
  • 13
  • 55
  • 64
15
votes
2 answers

Build RPM to just install files

I need to build a RPM, with the sole purpose of installing a few fonts. I have read several tutorials about that, however everyone seems to suggests something different and I haven't been able to find something like a very basic setup to do that. Is…
st-h
  • 2,444
  • 6
  • 37
  • 60
13
votes
6 answers

Is there any syntax or trick to be able to create a multiline rpm spec file macro

Background. $ rpmbuild --version RPM version 4.3.3 I am working on a spec file that needs to process a list of files in multiple scriptlets. DRY (don't repeat youself) has me defining the list once as a macro which is expanded into the various…
Chaim Geretz
  • 826
  • 5
  • 23
13
votes
1 answer

Exclude or delete directory path from %files in rpm.spec file

My spec files path looks like below :…
Prem
  • 131
  • 1
  • 1
  • 4
11
votes
2 answers

How to set owner for directory in the %files?

If I have this line in the %files: %attr(0555, myuser, myuser) /opt/myapp/lib/my.jar Then my.jar will have myuser as owner, but directory /opt/myapp/lib will be owner by root. I don't want to write %attr(0555, myuser, myuser) /opt/myapp/lib/ as I…
Eran Ben-Natan
  • 2,515
  • 2
  • 16
  • 19
1
2 3
38 39