Questions tagged [rpm-spec]

This tag is for RPM spec files, the source file for building RPM packages using rpmbuild.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

RPM SPEC: Restart external service only if config file was changed after package update

I have a RPM package which add config to /etc/rsyslog.d/. I don't want to restart rsyslog's service after each update because apparently rsyslog can't do graceful restart. So, I would like to restart ...
shtoltz's user avatar
2 votes
1 answer
88 views

rpmbuild: handle naming differences of packages in different distributions

I'm writing a RPM spec file for building my software. The software depends on Crypto++. Crypto++ is named differently on different distributions, for example, on OpenSUSE, I should write BuildRequires:...
Siyuan Ren's user avatar
  • 1,352
1 vote
1 answer
76 views

Spec file for rpmbuild to build gdb9 on ec2

I'm using aws's ec2 instance and I need to install a newer version of GDB (I can't use yum install since there is no newer version available for amazon RHEL). My workflow requires to do this process ...
danwgh's user avatar
  • 23
3 votes
0 answers
198 views

Options for managing user created files in rpm spec file

How is best to handle files in an rpm spec file that may or may not exist with these specifics: Part of the files delivered are example files under a /conf.d/ directory. The files are installed as ...
EddieSub's user avatar
0 votes
1 answer
138 views

Transition %cmake* (*.spec file) to cmake3?

I'd would like to transition an existing *.spec file from the fedora style %cmake* commands to the alternate %cmake3 based one (eg. Amazon Linux 2). What should I replace an existing %cmake_build with ...
malat's user avatar
  • 2,940
1 vote
1 answer
86 views

Could not execute mockbuild: Could not download sources

When writing a .spec file for Fedora, I ran into a problem. I can't seem to be able to do fedpkg mockbuild at all. No matter what source I use, HTTPS or local, I keep running into this error: Failed ...
Ignis Incendio's user avatar
0 votes
1 answer
179 views

How to use an alternate toolset in rpmbuild

I am trying to compile & package the latest version of Zeek (5.0.7) for rhel 7 servers. I get an error saying the "cxx17" is required. Searching the web, I found that it is contained ...
Garnet's user avatar
  • 398
2 votes
1 answer
172 views

Correct way to modify config files in an upstream RPM?

What's the right way to create an RPM that modifies the %config(noreplace) files installed by another RPM? Specific instance of the general question: We want to modify the repository definitions ...
David M's user avatar
  • 123
0 votes
1 answer
184 views

Which UID/GID is free for new package

After reading https://unix.stackexchange.com/a/222376/246754 How rpm ensure that no uid/gid clash with each other ? What I am looking is similar to https://github.com/NixOS/nixpkgs/blob/...
Et7f3XIV's user avatar
  • 103
0 votes
0 answers
212 views

useradd --create-home not adding a home directory Rocky Linux 8 but does in CentOS 7

I have an RPM that runs a scriptlet to add a user and create a home directory. I have used this before on CentOS 7, but now need this RPM to run it on Rocky Linux 8 so I've rebuilt the RPM (it's ...
Dave's user avatar
  • 103
0 votes
1 answer
295 views

SLES15 SP4 | Installation of a rpm package fails when %post scriplet fails with "/usr/lib/1sb/install _initd: No such file or directory"

I have a .spec file to install a rpm. I have the following snippet in post install (%post scriplet) %post -n %{package_name} # Enable the service at boot time %if %{?suse_version:1}0 /usr/lib/lsb/...
Abhishek Dasgupta's user avatar
0 votes
1 answer
346 views

On rpmbuild how to start without deleting the build content?

I'm making a rpm .spec for kernel. If an error happen I have to correct and recompile the kernel (1 hour!) Fast question: I want to start the build without rm -fr BUILDDIR How to do? Thanks
elbarna's user avatar
  • 12.6k
0 votes
0 answers
141 views

Conditional package dependencies

I am creating an RPM package for Red Hat Enterprise Linux. My software requires the 'redhat-lsb' package when running on RHEL 7 and 8, but does not require it on RHEL 9. Furthermore, the package isn't ...
Andrew Vickers's user avatar
0 votes
0 answers
48 views

I know RPMs can have build dependencies, but can they also have testing dependencies?

At work we are developing a number of different software tools in different repositories, which get packaged as RPM files. Our suite of test data for unit and integration testing has now grown to the ...
swestrup's user avatar
  • 101
0 votes
1 answer
3k views

How do you put conditionals in an RPM spec file for %install and %file macros?

I only want files copied into an RPM spec file under a certain condition like: %install if [ %{test}=="true" ]; then cp %{topdirectory}/file1.txt $RPM_BUILD_ROOT/home/user1 fi %files ...
user1068636's user avatar
0 votes
1 answer
835 views

Why can't I see print statements in my RPM spec file?

In my RPM spec file I have the following lines: %pre echo "This is a test" When I run the "rpmbuild" on my spec file, it builds everything correctly, but I never see the ...
user1068636's user avatar
0 votes
1 answer
161 views

Why does yum install stall when performing an RPM install from my spec file?

I normally start with a Minimal Centos 7 and run rpm -i postgres10-libs-10.15-1PGDG.rhel7.x86_64.rpm And this works perfectly. However, I am now writing an RPM spec file and trying to get it to do ...
user1068636's user avatar
2 votes
1 answer
549 views

How do you modify the RPM spec file to require perl libraries on centos 7?

I normally start with a Minimal Centos 7 and run yum install perl-libs.x86_64 This works perfectly. I am now trying to create an RPM spec file that uses the "Requires" clause to package ...
user1068636's user avatar
0 votes
2 answers
645 views

How do I modify the rpm spec file to require java-1.8.0-openjdk on centos 7?

I normally start with a Minimal Centos 7 and run yum install java-1.8.0-openjdk in order to install a Java Runtime Environment. This works perfectly as I am able to execute JAR files. I am now ...
user1068636's user avatar
1 vote
1 answer
10k views

yum: install local RPMs and all local dependencies

I have my locally generated rpm packages (the main package and its dependencies) located in my home directory. The spec file defined dependencies. I'd like to install it with a single yum or dnf ...
Mark's user avatar
  • 1,793
2 votes
2 answers
5k views

rpm: define my own variable in spec file

Is there a way to declare my own variable inside of a spec file and refer to it as %{my_var} ?
Mark's user avatar
  • 1,793
0 votes
1 answer
2k views

automatically activate service after RPM was installed

OS - Red Hat Enterprise Linux 8 I've created a .spec file to build and package my application. My rpm also includes my_app.service file for systemd to start it. However, by default one has to enable ...
Mark's user avatar
  • 1,793
1 vote
1 answer
329 views

Modifying compiler options when building RPMS that use cmake

I'm building a package on Rocky 8 that works fine on Fedora 35. When I tried to compile it on Rocky 8 using rpmbuild -ba, I got the error: relocation xxxxx can not be used when making a shared object; ...
Eric Sokolowsky's user avatar
1 vote
1 answer
2k views

rpmbuild fails | Missing dependencies (However missing dependencies are installed)

I'm attempting to build RPM's & Repo's for various agent's we use at my company. This particular package has a private library and I'm unable to figure out what the problem is. The package seems ...
Mose's user avatar
  • 123
1 vote
2 answers
400 views

RPM macro and quotes

I would like to include a file in a package with a directory which is dependendat on the system. I define the directory with %define completions_dir "%( pkg-config --variable=completionsdir bash-...
Matteo's user avatar
  • 9,796
3 votes
1 answer
2k views

If I do not care about debug support in red hat packages, what are the drawbacks of turning build-id support off in the specs file?

As a follow up on this question, what if I am not interested in having these debug features - how do I simply prevent these build-id files (debug info packages?) from being installed ? Ultimately I do ...
Veverke's user avatar
  • 358
2 votes
2 answers
2k views

Make OS-dependent Requires section in an RPM spec file

Situation I have an RPM that uses semanage (SELinux policy management tool) and restorecon (SELinux context configuration tool) in the post-installation and pre-uninstallation stages. Unfortunately, ...
Edward's user avatar
  • 2,464
2 votes
1 answer
676 views

build rpm for python2 if python3 is not installed

I want to package a python application which can run on both python2 and python3 for we have still old systems running python2. the default should be python3 but in case of python3 is not installed. I ...
danidar's user avatar
  • 101
2 votes
1 answer
751 views

shebang changed to /usr/libexec/platform-python when building python rpm packages

I am trying to build a RPM from a python application on RHEL8.2 machine. the shebang on the scripts are set correctly to #!/usr/bin/python3 however for some reason the shebang gets changed to #!/usr/...
danidar's user avatar
  • 101
0 votes
1 answer
690 views

Linux RPMBUILD SPEC, how to Install to custom location /usr/local/file1 not always /usr dirctory

I'm having problem for RPM to be installed to /usr/local/file1, it always installs to /usr/local/file1/usr. I even used ./configure --prefix /usr/local/file1 and it still installed to /usr/local/...
Jack's user avatar
  • 1
2 votes
1 answer
3k views

How do you set an environment variable for the current session in an rpm?

I am producing an rpm for Sia in ClearOS7 (based on Centos7) and have hit a brick wall. I am trying to set SIA_DATA_DIR=/var/lib/siad-data for the session where I am installing the rpm. It is needed ...
Nick Howitt's user avatar
0 votes
1 answer
476 views

how to run a script in postun section in spec file

I have a spec file with some content. There is also a script: %postun if [ '$1' == 0 ]; then do some things fi I want that a script in %postun section has been executed after package removed. ...
apogoreliy's user avatar
0 votes
1 answer
1k views

Restart service after RPM transaction

I have an RPM package which updates a config file and so entails a restart of that service (rsyslog). My supported platforms include a pre-systemd version (centos6) and systemd versions (centos7+). My ...
Madden's user avatar
  • 345
0 votes
1 answer
574 views

Same RPM for multiples CentOS major versions

I've created a little bash script and build it into a RPM package. This little bash script works very well on CentOS 5, CentOS 6 and CentOS 7 (and probably on CentOS 8, not checked) My question is: Do ...
locobastos's user avatar
1 vote
1 answer
1k views

Fedora 33 RPM package provides its own libraries won't install says "nothing provides"

This should be watching ice melt simple, but it is not. I'm on Fedora 33 and creating an RPM for the Diamond text editor. I've got the Debian stuff all done and works great. Diamond uses the ...
user3450148's user avatar
2 votes
1 answer
1k views

Build RPM subpackages without a base package

According to a RPM documentation/guide (http://ftp.rpm.org/max-rpm/ch-rpm-subpack.html) one can use subpackages to build multiple RPM packages with a single SPEC file. In the mentioned link the ...
swaechter's user avatar
  • 123
0 votes
2 answers
1k views

Is it possible to determine which build flags were used on a pre-built RPM package?

I have been using the Quagga dynamic routing daemon on a CentOS 6 VM. I'd like to use a feature that is only accessible if the RPM was built with the --multipath=X flag. The RPM I'm using was already ...
dutsnekcirf's user avatar
0 votes
1 answer
138 views

How do I get around a transaction check error in an RPM that needs to overwrite a configuration file?

I'm packing something and the upstream provider clobbers a configuration file. Transaction check error: file /etc/acme-engine/acme-engine-fpm.conf from install of acme-1-74.1.el7.noarch conflicts ...
Evan Carroll's user avatar
  • 30.4k
2 votes
1 answer
2k views

%dir doesn't seem to work in spec file

It's my understanding of %dir that if I have %files %dir /foo/bar That I now do not have to list each file individually of /foo/bar. However when I build my RPM in OBS I'm getting, error: Installed (...
Evan Carroll's user avatar
  • 30.4k
1 vote
1 answer
3k views

How can I reliably modify build configs and add compiler flags in C/C++ RPM files?

I need to change the build configuration of a large number of rpm files for testing purposes. I'm only speaking of C/C++ code here. I'm not necessarily looking to do automation, but I could use a hand ...
the_endian's user avatar
0 votes
1 answer
1k views

How are Sources mapped to commands in a RPM specfile? [closed]

In an RPM specfile, sometimes I will see: Source0: /some/path/or/url/file.tar.xz Source1: /another/path/or/url/file2.tar.gz Source2: /some/path/library.so Source4: /other/path/icon.ico ... Sometimes ...
the_endian's user avatar
1 vote
1 answer
1k views

How does pkg-config work in RPM specfiles?

In some RPM specfiles, I see lines like: BuildRequires: pkgconfig(ice) BuildRequires: pkgconfig(libnotify) BuildRequires: pkgconfig(libssl) ... I am not very familiar with pkgconfig but I understand ...
the_endian's user avatar
0 votes
1 answer
193 views

How to compile from source and repackage into binaries for distribution?

currently I have compiled and installed the GDAL3.0.4 library from source which also require me to compile and install Proj6.0.0. That is working fine. So my next part is, i need to package the ...
machy's user avatar
  • 1
2 votes
2 answers
2k views

What are some effective ways to build & run an SRPM without installing it?

I am on Fedora 31 and I do software development. I need to work with code in many source RPM packages for relatively short periods of time. For this reason, I'd like to simply build the package, but ...
the_endian's user avatar
0 votes
1 answer
231 views

Is there a way to bump the non-right most part of the version in RPM?

With rpmdev-bumpspec I can do -r, --rightmost bump trailing .<DIGIT> component if found, append .1 if not; no-op if -s is specified -s STRING, --string=STRING bump trailing ....
Evan Carroll's user avatar
  • 30.4k
0 votes
1 answer
344 views

Is there a way to specify a dependency where anyone of a group can satisfy the demand?

Let's say I'm packaging an RPM which requires one of the following, Foo Bar Baz Does RPM support the functionality to put that into a spec file?
Evan Carroll's user avatar
  • 30.4k
1 vote
1 answer
861 views

RPM Spec file %setup macro when you don't know the root name?

How do I use the %setup macro if I don't know the root name of the archive. For example, in my case I have archive.tar.gz that extracts to myproject-<githsha>/ Each time I run that I may get a ...
Evan Carroll's user avatar
  • 30.4k
0 votes
1 answer
1k views

cron job setup using rpm is not working

I've below cron file SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin LOG_DIR=/var/log/myapp-services-cron MYAPP_SERVICES_DIR=/opt/myorg/apps/myapp-services * * ...
Rajkumar Natarajan's user avatar
1 vote
2 answers
128 views

Rpmlint "use-tmp-in-%postun" error

rpmlint output: E: use-tmp-in-%postun Spec file: %postun rm -r /var/aci /tmp/aci_tmp 2> /dev/null Also, I cant remove package How I can remove directory in /tmp after or before uninstalling ...
PHPoenX's user avatar
  • 406
1 vote
1 answer
491 views

Empty directories are left over after uninstallation of package on higher version of RPM on LINUX

RPM version 4.8.0: [root@sdl34815 x8664]# rpm -ivh tmfi1700-17.00.00.00.rpm Preparing... ########################################### [100%] 1:tmfi1700 ###############################...
Manoj's user avatar
  • 26