Questions tagged [rpm-spec]

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

rpm-spec
Filter by
Sorted by
Tagged with
45 votes
8 answers
90k views

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 ...
jon's user avatar
  • 933
42 votes
4 answers
30k views

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's user avatar
  • 41.2k
37 votes
3 answers
37k views

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 ...
mat1010's user avatar
  • 796
31 votes
1 answer
31k views

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/...
last_shogun's user avatar
27 votes
4 answers
16k views

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 ...
mkraemerx's user avatar
  • 1,783
24 votes
2 answers
51k views

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 ...
Mariselvam's user avatar
  • 1,103
23 votes
6 answers
14k views

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 ...
user376403's user avatar
  • 1,115
21 votes
2 answers
9k views

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 ...
Ilane's user avatar
  • 494
19 votes
3 answers
14k views

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 ...
user avatar
18 votes
3 answers
17k views

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 ...
Jimmie's user avatar
  • 407
15 votes
4 answers
18k views

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's user avatar
  • 5,497
15 votes
2 answers
33k views

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 ...
st-h's user avatar
  • 2,494
13 votes
6 answers
6k views

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 ...
Chaim Geretz's user avatar
13 votes
1 answer
16k views

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

My spec files path looks like below : /opt/OV /opt/OV/NonOV /opt/OV/NonOV/ABCD /opt/OV/NonOV/ABCD/ABC /opt/OV/NonOV/ABCD/ABC/Test1 /opt/OV/NonOV/ABCD/ABC/Test1/test1.txt /opt/OV/NonOV/ABCD/ABC/Test2 ...
Prem's user avatar
  • 131
11 votes
7 answers
16k views

can an RPM spec file "include" other files?

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 ...
davka's user avatar
  • 14.2k
11 votes
2 answers
25k views

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 ...
Eran Ben-Natan's user avatar
11 votes
1 answer
3k views

Making an RPM which sets POSIX files capabilities

How does one make an RPM which sets the POSIX capabilities of a file? If I try doing rpmbuild as a non-root user then I get an error when my makefile's install hooks try to run setcap, but if I don't ...
Matthew Cline's user avatar
9 votes
1 answer
17k views

How to install rpmdev tools on ubuntu?

I am creating my first package using RPM on ubuntu machine.But I am getting so many difficulties.I tried so many commands to install rpmdevtools using "yum" but it is giving error as There are not ...
Shah Ritesh's user avatar
9 votes
3 answers
11k views

Shipping *.so and binaries while building RPM package

I have created a python application in which I would like to ship .so and some binary files in the final RPM package. After long reading I found a way to add binaries/ image and other data files in ...
sundar_ima's user avatar
  • 3,788
9 votes
1 answer
11k views

How to run a shell command in RPM spec file?

How do I run a shell command in spec file? I want to execute something similar like: uname -r | sed s/(...stuff...)/(...stuff...)
Amumu's user avatar
  • 18.3k
9 votes
3 answers
8k views

rpmbuild error: Installed (but unpackaged) file(s) found

I am building a custom rpm to install apache, among other things. When i try and build i get the above error, and then it lists /httpd-2.2.17/ and all of its subfiles. As far as i know, this is the ...
Chris's user avatar
  • 4,505
8 votes
1 answer
9k views

RPM spec missing uninstall section?

I see no uninstall section in RPM spec documentation. I do see preun and postun. Is there uninstall phase? What exactly happens during uninstall phase? Basing on %files section, a list of files is ...
Michal's user avatar
  • 2,158
8 votes
4 answers
13k views

Using Jenkins BUILD NUMBER in RPM spec file

Name: My Software Version: 1.0.5 Release: 1 Summary: This is my software Not sure if anyone has tried this before or if it is easy, but: ...
Sagar's user avatar
  • 9,484
8 votes
2 answers
29k views

RPM build No such file or directory

I want to create simple RPM file with many small files. [root@laptop rpm]# tree . ├── BUILD ├── BUILDROOT ├── RPMS ├── SOURCES │   └── some_agent-1.0.tar.gz ├── SPECS │   ├── kernel.spec │   └── ...
user1285928's user avatar
  • 1,388
8 votes
1 answer
23k views

rpm & rpmbuild - using global environment variable in the %files section

I have been struggling for a while with this one. So I wrote a .specs file for my project and everything went fine. The rpm is built, the installation is smooth... but then I got some trouble because ...
Rinita's user avatar
  • 147
8 votes
1 answer
6k views

Install entire folder and files in it, RPM spec file

I have a spec file to build an rpm package, in my %install section I have this: %install install -m 700 foo/bar/filesToCopy/. $RPM_BUILD_ROOT/ The filesToCopy folder is a tree exactly how the ...
Jimmie's user avatar
  • 407
7 votes
1 answer
2k views

Question mark and exclamation point syntax in srpm spec file

I'm trying to understand how the Postgres 9.1 rpms are built on CentOS/RHEL 6, so I'm taking a look at the spec file from the source rpms. What does the following syntax do/mean? Specifically, the ...
Banjer's user avatar
  • 8,168
7 votes
1 answer
6k views

symlink in particular directory using rpm spec

rpm created using spec file will create directory "directory1" and all files in /var/lib/directory1. For another use case i want to create another directory in "/var/lib" which should be a symlink to ...
Kevin Parker's user avatar
  • 1,390
7 votes
3 answers
8k views

Can some specific autodetected dependency be ignored upon rpmbuild

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 ...
a1an's user avatar
  • 3,576
7 votes
4 answers
12k views

CentOS 5.5 - symbolic link creation into RPM spec file

I need to create the following symbolic links into RPM file /bin/ln -sf libcrypto.so.0.9.8e /lib/libcrypto.so.0.9.8 /bin/ln -sf libssl.so.0.9.8e /lib/libssl.so.0.9.8 In my RPM spec file: %files %...
Dima's user avatar
  • 1,281
7 votes
2 answers
7k views

RPM conditional Requires in spec file possible

As the subject reads, I wonder whether it is possible in the RPM spec file to make required packages dependent on a condition? For instance check in a shell statement if on the install target e.g. ...
user3520053's user avatar
6 votes
2 answers
9k views

Create an RPM that can also manipulate files and add users

I'm trying to create an RPM in Fedora 15 that will install my software, but in order for my software to work correctly once installed, I also need to edit other (configuration) files on the system, ...
flash's user avatar
  • 63
6 votes
1 answer
15k views

Set permissions after RPM install

I use this spec file to use RPM files Name: pack-agent Version: 1.0 Release: 1%{?dist} Summary: Linux Agent installation script Group: Utilities License: ...
user1285928's user avatar
  • 1,388
6 votes
1 answer
2k views

rpm subpackages %install section

Is it possible to have a separate %install section for a subpackage in a spec file? For example, files can be specified for the main package as %files and for the subpackage like this: %files ...
user12066's user avatar
  • 613
6 votes
1 answer
9k views

What needs to go in the %files section of an RPM

I have a tar.gz that I am wanting to create a RPM out of and am currently working on the spec file. I couldn't seem to understand what the rule for including files in the %files section of the .spec ...
alh's user avatar
  • 2,579
6 votes
1 answer
5k views

Can the Source0 in a RPM Spec be a git repo?

I want to build a rpm of my project automated. So when I push a new tag to my git repo, it should build a rpm from this tag revision. My problem is, how can I prep the sources and specify it in the ...
Thilo Cestonaro's user avatar
6 votes
1 answer
8k views

How to package a .tar.gz file into rpm package

I worked on Redhat Linux, I have a tar.gz file. I want to package this tar.gz file to a rpm package file. In the rpm package phase, I just want to extract the tar.gz file and package all of the ...
FlurryWInd's user avatar
5 votes
2 answers
7k views

RPM Build Spec file i want to check rpm is being install or update

i want to check the rpm i have created is install or update by user(client) like rpm -ivh abc.rpm or rpm -Uvh abc.rpm is their any %command in spec file to get info regarding this command. my ...
meet patel's user avatar
5 votes
1 answer
6k views

build rpm without compiling the source file

I am trying a sample rpm package with single file. In my source folder I have python_test_rpm.tar.gz which contains only one python script file. But, the file is not a valid python script. All I ...
baskar's user avatar
  • 53
5 votes
2 answers
5k views

during upgrade, how does rpm know which files to delete?

I am new to packaging. This website states that the steps during an upgrade are: Hence, the order of operations during an upgrade is: Run the %pre section of the RPM being installed. Install the ...
Mike's user avatar
  • 981
5 votes
1 answer
1k views

RPMbuild with executable files

I am trying to build a RPM (rpmbuild -bb spec file). When installing rpm some of executable tcl files are corrupted and all files having same size.
Sharavanakumaar Murugesan's user avatar
5 votes
4 answers
3k views

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's user avatar
  • 166k
5 votes
1 answer
4k views

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, ...
Mikhail T.'s user avatar
  • 3,284
5 votes
2 answers
6k views

How to exit rpm install in case of an error

I am looking for a way to exit rpm install if some condition is false. I have added a small script in the %pre section that exits install if my condition fails. The problem I am facing is I see that ...
Fanatic23's user avatar
  • 3,418
5 votes
1 answer
4k views

File listed twice in rpm spec file

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}/...
JochenJung's user avatar
  • 7,203
5 votes
1 answer
3k views

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 ...
yash khatri's user avatar
5 votes
0 answers
1k views

rpm-maven-plugin and OS X

I'm trying to set up a maven project on OSX and use the rpm-maven-plugin to build it as an RPM package. However, even the simplest configuration of the plugin seems to fail. The error I get is Bad ...
NilsH's user avatar
  • 13.8k
5 votes
1 answer
1k views

How to detect upgrade when an RPM that obsoletes another RPM is being installed

RPM scriptlets are passed in $1 ( the number of packages of this name which will be left on the system when the action completes ) so they can determine whether a package upgrade or removal is ...
Dan R's user avatar
  • 198
4 votes
5 answers
963 views

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?
user avatar
4 votes
2 answers
3k views

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 ...
Paul's user avatar
  • 6,519

1
2 3 4 5
12