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

rpm %config(noreplace) override with %config

In my rpm I have a full directory that I want to tag with %config(noreplace). There is a file in that directory that I want to replace on every install with the latest from the rpm, using the semantics from %config. Using the guide here:…
Kyle Fransham
  • 1,859
  • 1
  • 19
  • 22
2
votes
1 answer

Looking for a macro to expand a variable to the name + value

I'll use an example to show what I mean, since it's hard to explain. I have a spec file that is used for native and cross-compiling. I have many variables being passed to rpmbuild using the --define option. I'd like a macro that would be the…
Aaron D. Marasco
  • 6,506
  • 3
  • 26
  • 39
2
votes
1 answer

RPM: returning values from included RPM macro

This is a follow-up question to RPM: loading bash script in %pre scriptlet. I am trying to define some utility functions as macros, so later I can %include them when building other RPM packages too. Let's say I want to have a function testfunc()…
Daniel Szalay
  • 4,041
  • 12
  • 57
  • 103
2
votes
1 answer

RPM: loading bash script in %pre scriptlet

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…
Daniel Szalay
  • 4,041
  • 12
  • 57
  • 103
2
votes
1 answer

RPM package spec localization

I need to package proprietary program for Russian local market. To build RPM package, i used this guide: https://stackoverflow.com/a/1165200/1794089 So, i need to translate RPM package description to Russian, i.e. localize them. I'm googled that…
eraxillan
  • 1,552
  • 1
  • 19
  • 40
2
votes
0 answers

What is the RPM macro for actual install dir I could use in %post?

I was able to create a relocatable RPM. But in the %post section I need to do some other things like creating some symbolic links. The issue is that I cannot find in the RPM docs info on the actual install dir macro. E.g., %_prefix is hard-coded to…
2
votes
1 answer

How do I set optional configuration files in an RPM SPEC file?

Is there a way I can flag a configuration file as optional so when verification is invoked (rpm -v), it will ignore a missing configuration file? I have an RPM package which I include a default configuration file for my application. The…
jdknight
  • 1,801
  • 32
  • 52
2
votes
2 answers

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

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…
Ravindra Mijar
  • 1,282
  • 2
  • 9
  • 17
2
votes
2 answers

Set target directory in RPM spec file

I have a very simple tar.gz file wih Java files which I want to install using RPM package. I created this spec file: Name: test Version: 1.0 Release: 1%{?dist} Summary: test installation script Group: …
user1285928
  • 1,328
  • 29
  • 98
  • 147
2
votes
2 answers

RPM Build - Permission Denied

I have a Python-based SVN pre-commit script that generates an rpmbuild .spec file and runs rpmbuild -bb my.spec via subprocess. The current state is: 1) When doing an SVN commit (SVN over SSH) remotely the rpmbuild fails with... error: failed to…
user1801810
  • 614
  • 1
  • 11
  • 29
2
votes
2 answers

rpmbuild and signed executable files

In a project I am working on, I need to generate a signature from one of my output executable (elf) files using a private key (the signature forms one of the files in the rpm, the private key to do this never leaves the build machine). This is…
Fire Lancer
  • 29,364
  • 31
  • 116
  • 182
2
votes
2 answers

How to package node-js application into single rpm?

I'm trying to pacakge my node-js application into single rpm-package. The first thing that came to mind: add nodejs and npm as package dependencies. Requires: node npm Such rpm worked perfectly on Fedora. But on CentOS rmp installation had been…
RomanHotsiy
  • 4,978
  • 1
  • 25
  • 36
2
votes
2 answers

Preserve files/directories for rpm upgrade in .spec file(rpmbuild)

I wrote a .spec file on RHEL and I am building RPM using rpmbuild. I need ideas on how to handle the situation below. My RPM creates an empty logs directory when it installs first time within the installation folder like below …
Owais
  • 21
  • 1
  • 6
2
votes
1 answer

Can I invoke functions from an rpm.spec that were declared in dependent RPMs?

Let's say I have an rpm.spec script that builds a MyRPM.rpm package: -- rpm.spec for MyRPM.rpm %define logdir %{my_dir}/logs/%{name} Summary: bla bla bla Name: MyRPM Version: @@@version@@@ Release: @@@revision@@@ License: bla Group:…
the_marcelo_r
  • 1,847
  • 22
  • 35
2
votes
0 answers

Correct way to package a Java application into an RPM

I've created an Java application and I would like to create an installation RPM for it. The application consists of a set of jar files, a system library file, a script to launch the application, and a directory to store user configuration…
OttPrime
  • 1,878
  • 1
  • 15
  • 24