Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
0 answers
25 views
Is the are a single site-packages directory for multiple versions of python3 in rpm-based distros?
I am working on creating deb/rpm packages for [a little project of mine][1]. [1]: https://github.com/eantoranz/rebase-- I have already created the packages for a few rpm-based and deb-based distros. In deb distros one python file is being setup in `/usr/lib/python3/dist-packages/`. In rpm-based dist...
I am working on creating deb/rpm packages for a little project of mine . I have already created the packages for a few rpm-based and deb-based distros. In deb distros one python file is being setup in /usr/lib/python3/dist-packages/. In rpm-based distros, I have to first detect the version of python being used when building and then I can set it up at the right directory. So, for rockylinux 9, I use /usr/lib64/python3.9/site-packages, for fedora 42 I use /usr/lib64/python3.13/site-packages. It works! However, I just realized that because on rpm distros the file is located in a python-version-dependent directory established when I am packaging it, if on the box it will run python is updated to a newer version from the one I used by default on that distro during packaging-time, it will break. Is there a more python-minor-version independent directory that could be used in rpm-based distros? I don't want to add the file in multiple places just so that it is available in all the python versions that could be installed from distro packages.
eftshift0 (707 rep)
Jun 22, 2025, 10:14 PM
0 votes
0 answers
70 views
How to build a RPM with circular dependencies?
I am trying to build `mesa-7.6-0.1.fc11.src` from source. ``` $ yumdownloader --source mesa $ cd rpmbuild/SPECS $ rpmbuild -ba mesa.spec error: Failed build dependencies: freeglut-devel is needed by mesa-7.6-0.1.fc11.src ``` No problem. I will download this dependency from source and build that firs...
I am trying to build mesa-7.6-0.1.fc11.src from source.
$ yumdownloader --source mesa
$ cd rpmbuild/SPECS
$ rpmbuild -ba mesa.spec
error: Failed build dependencies:
        freeglut-devel is needed by mesa-7.6-0.1.fc11.src
No problem. I will download this dependency from source and build that first.
$ yumdownloader --source freeglut-devel
$ rpm -ivh freeglut-2.4.0-16.fc11.src.rpm
$ cd rpmbuild/SPECS
$ rpmbuild -ba freeglut.spec
error: Failed build dependencies:
    libGLU-devel is needed by freeglut-2.4.0-16.fc11.src
It looks like I need another package. Let's see which source RPM is needed to build it.
$ yumdownloader --source mesa-libGLU-devel
Loaded plugins: refresh-packagekit
mesa-7.6-0.1.fc11.src.rpm                       | 7.1 MB     00:00
Alright... so mesa needs freeglut-devel which needs libGLU-devel which is built by mesa. This is a circular dependency. When considering only building from source and not installing a prebuilt package, how can this circular build dependency be resolved? libGLU-devel is only one of several RPMs that is built by mesa. Is it possible to build only that one RPM instead of all of them to see if this avoids the dependency on freeglut? Even if I try to download the freeglut-devel package, it ends up resolving dependencies for the same package I am trying to build.
Dependencies Resolved

======================================================================================================================================
 Package                               Arch                     Version                             Repository                   Size
======================================================================================================================================
Installing:
 freeglut-devel                        i586                     2.4.0-16.fc11                       fedora                      111 k
Installing for dependencies:
 freeglut                              i586                     2.4.0-16.fc11                       fedora                      148 k
 mesa-dri-drivers                      i586                     7.6-0.1.fc11                        updates                     2.2 M
 mesa-libGL                            i586                     7.6-0.1.fc11                        updates                     174 k
 mesa-libGL-devel                      i586                     7.6-0.1.fc11                        updates                     485 k
 mesa-libGLU                           i586                     7.6-0.1.fc11                        updates                     204 k
 mesa-libGLU-devel                     i586                     7.6-0.1.fc11                        updates                     108 k

Transaction Summary
======================================================================================================================================
Install       7 Package(s)
Upgrade       0 Package(s)
What is the correct way to resolve this circular build dependency? For context, I am building packages from Fedora 11 from source for testing DRI drivers that only exist for very old kernels.
Zhro (2831 rep)
Sep 24, 2024, 04:27 AM • Last activity: Mar 27, 2025, 09:47 AM
0 votes
1 answers
52 views
Strange "Directory not empty" for `rm -rf ...`command for %clean in rpmbuild of SLES15
After upgrading from SLES12 SP5 to SLES15 SP6 I noticed that the %clean phase of some RPM spec files fail for some strange reason when using `rpmbuild -ba`. The RPMs (SRPM, RPMs) are written correctly, but when cleaning up I see errors like this: ~~~lang-text Executing(%clean): /bin/sh -e /var/tmp/r...
After upgrading from SLES12 SP5 to SLES15 SP6 I noticed that the %clean phase of some RPM spec files fail for some strange reason when using rpmbuild -ba. The RPMs (SRPM, RPMs) are written correctly, but when cleaning up I see errors like this: ~~~lang-text Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.IXMkuS + umask 022 + cd /home/windl/rpmbuild/BUILD + cd iredir-0.5.1n + for d in "/home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64" + '[' -n /home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64 -a /home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64 '!=' / ']' + ls -l /home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64 total 12 drwxr-xr-x 6 windl dvmed 4096 Mar 10 10:40 etc drwxr-xr-x 6 windl dvmed 4096 Mar 10 10:40 usr drwxr-xr-x 5 windl dvmed 4096 Mar 10 10:40 var + rm -rf /home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64 rm: cannot remove '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64/usr/lib/ocf/resource.d/xola': Directory not empty rm: cannot remove '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64/usr/lib/iredir': Directory not empty rm: cannot remove '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64/etc/ocf/xola/isredir': Directory not empty rm: cannot remove '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64/etc/ocf/xola/idredir': Directory not empty rm: cannot remove '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.1n-0.0.x86_64/etc/init.d': Directory not empty error: Bad exit status from /var/tmp/rpm-tmp.IXMkuS (%clean) ~~~ This is very strange as rm -rf is supposed to remove non-empty directories. I added the ls command after having experienced the issue: ~~~lang-rpm %clean # called for %install for d in "%{buildroot}" do [ -n "$d" -a "$d" != / ] && ls -l "$d" && rm -rf "$d" done ~~~ What might cause this? It seems like some asynchronous effect tto me. ~ is on NFS (also hosted by SLES15 (but SP5) (nfs-kernel-server-2.1.1-150500.22.3.1.x86_64, kernel 5.14.21-150500.55.83-default)). /usr/bin/rm is from coreutils-8.32-150400.9.6.1.x86_64. More Details ------------ I changed the RPM spec file to recursively list the whole directory, also adding -v to the rm command. When I see is that a directory contains four (normal) files that are deleted just before rm complains the directory isn't empty. More tests ---------- The effect is strange: When I created a test script that creates a directory, adds four files, and then removed that directory, it always works, while the rpmbuild -ba always fails for the same directory. Well, the total length of the paths for the rpmbuild is somewhat longer, but still smaller than say 120 characters. So I ran the whole thing under strace -f -s64with these results: ~~~lang-strace 1079 newfstatat(7, "xola", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0 1079 openat(7, "xola", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_DIRECTORY) = 3 1079 fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 1079 fcntl(3, F_GETFL) = 0x38800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW|O_DIRECTORY) 1079 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 1079 getdents64(3, 0x55d729e27910 /* 6 entries */, 1048576) = 176 1079 close(3) = 0 1079 openat(7, "xola", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 3 1079 fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 1079 fcntl(3, F_GETFL) = 0x38800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW|O_DIRECTORY) 1079 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 1079 fcntl(3, F_DUPFD_CLOEXEC, 3) = 8 1079 getdents64(3, 0x55d729e27910 /* 6 entries */, 1048576) = 176 1079 getdents64(3, 0x55d729e27910 /* 0 entries */, 1048576) = 0 1079 close(3) = 0 1079 unlinkat(8, "isredir", 0) = 0 1079 write(1, "removed '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.3n-0.0.x86_64"..., 102) = 102 1079 unlinkat(8, "idredir.xml", 0) = 0 1079 write(1, "removed '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.3n-0.0.x86_64"..., 106) = 106 1079 unlinkat(8, "isredir.xml", 0) = 0 1079 write(1, "removed '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.3n-0.0.x86_64"..., 106) = 106 1079 unlinkat(8, "idredir", 0) = 0 1079 write(1, "removed '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.3n-0.0.x86_64"..., 102) = 102 1079 close(8) = 0 1079 unlinkat(7, "xola", AT_REMOVEDIR) = -1 ENOTEMPTY (Directory not empty) 1079 write(2, "rm: ", 4) = 4 1079 write(2, "cannot remove '/home/windl/rpmbuild/BUILDROOT/iredir-0.5.3n-0.0."..., 99) = 99 1079 write(2, ": Directory not empty", 21) = 21 1079 write(2, "\n", 1) = 1 1079 close(7) = 0 1079 close(6) = 0 ~~~ So in my interpretation the xolasubdirectory has four files (with . and .. that are six directory entries). Before ls -lR showed ~~~lang-text /home/windl/rpmbuild/BUILDROOT/iredir-0.5.3n-0.0.x86_64/usr/lib/ocf/resource.d/xola: total 56 drwxr-xr-x 2 windl dvmed 4096 Mar 12 08:03 . drwxr-xr-x 3 windl dvmed 4096 Mar 12 08:03 .. -r-xr-xr-x 1 windl dvmed 13228 Oct 21 2019 idredir -r--r--r-- 1 windl dvmed 5543 Oct 10 2019 idredir.xml -r-xr-xr-x 1 windl dvmed 13507 Oct 21 2019 isredir -r--r--r-- 1 windl dvmed 5774 Oct 10 2019 isredir.xml ~~~ The four files were deleted successfully (rm -vrf being used), but then the directory could not be deleted. Somewhow I suspect the NFS attribute cache on either the client or on the server to cause this.
U. Windl (1715 rep)
Mar 10, 2025, 10:00 AM • Last activity: Mar 12, 2025, 07:19 AM
0 votes
1 answers
42 views
Building a custom Linux kernel causes VMware Tools to stop working
I am compiling kernels for CentOS 6.10 in VMware Workstation. For some reason when I compile and boot a new kernel, VMware Tools stops working, or at least the shared folders feature does, which is the feature I am using to copy files between the VM and host machine. CentOS is updated to the most re...
I am compiling kernels for CentOS 6.10 in VMware Workstation. For some reason when I compile and boot a new kernel, VMware Tools stops working, or at least the shared folders feature does, which is the feature I am using to copy files between the VM and host machine. CentOS is updated to the most recent updated kernel, which I am also compiling with rpmbuild as stock with no modifications other than defining buildid in kernel.spec to differentiate it. I am installing the kernel RPM as well as the kernel-firmware RPM. The kernel boots perfectly fine and everything appears to work other than VMware Tools. Does anyone know why VMware Tools stops working when building a custom (unmodified) stock kernel? I have tried reinstalling VMware Tools. This makes no difference unless I am on some version of a stock kernel.
Zhro (2831 rep)
Oct 6, 2024, 02:26 PM • Last activity: Oct 7, 2024, 12:56 PM
0 votes
1 answers
606 views
help understanding spec file "provides" syntax
I am fairly new to rpm building and i have been trying to understand the syntax of "Provides" inside a spec file without success. I have the following spec file snippet for building clamav rpm: Summary: End-user tools for the Clam Antivirus scanner Name: clamav Version: 0.103.12 Release: 1%{?dist} %...
I am fairly new to rpm building and i have been trying to understand the syntax of "Provides" inside a spec file without success. I have the following spec file snippet for building clamav rpm: Summary: End-user tools for the Clam Antivirus scanner Name: clamav Version: 0.103.12 Release: 1%{?dist} %package data Summary: Virus signature data for the Clam Antivirus scanner Requires: ns-clamav-filesystem = %{version}-%{release} Provides: data(clamav) = full Provides: clamav-db = %{version}-%{release} Obsoletes: clamav-db ` # rpm -q --requires RPMS/x86_64/ns-clamd-0.103.12-1.el8.x86_64.rpm /bin/sh /bin/sh /bin/sh /bin/sh coreutils data(clamav) # rpm -q RPMS/noarch/ns-clamav-data-0.103.12-1.el8.noarch.rpm --provides clamav-db = 0.103.12-1.el8 config(ns-clamav-data) = 0.103.12-1.el8 data(clamav) = full ns-clamav-data = 0.103.12-1.el8
giomanda (155 rep)
Oct 2, 2024, 05:35 AM • Last activity: Oct 2, 2024, 01:56 PM
0 votes
0 answers
73 views
How to build CentOS kernel RPM with the kernel-firmware package?
I am trying to build a custom kernel RPM for CentOS 6.10. Normally I can build a kernel with `rpmbuild -ba file.spec`, which does produce the kernel in this case, but it builds with a missing dependency for `kernel-firmware` that I think it supposed to also be build by this SPEC file. There is a bui...
I am trying to build a custom kernel RPM for CentOS 6.10. Normally I can build a kernel with rpmbuild -ba file.spec, which does produce the kernel in this case, but it builds with a missing dependency for kernel-firmware that I think it supposed to also be build by this SPEC file. There is a build option in the SPEC file --with firmware, but this does not produce the necessary RPM dependency. rpmbuild -ba --with firmare kernel.spec How do I build this RPM dependency? Here is the exact error message when I try to build:
rpm -ivh kernel-2.6.32-754.35.1.el6.local.i686.rpm
error: Failed dependencies:
        kernel-firmware >= 2.6.32-754.35.1.el6.local is needed by kernel-2.6.32-754.35.1.el6.local.i686
Zhro (2831 rep)
Sep 27, 2024, 02:37 AM
1 votes
1 answers
249 views
how to code spec file to install a file on system only if a file is missing
I am new to rpm building and for the past week I am trying to code a spec file to install a file on the system only if a specific files is missing. Here is a snippet %global homedir %{_var}/lib/test Source10: main.db Source11: back.db %files data %defattr(-,%{updateuser},%{updateuser},-) %config(nor...
I am new to rpm building and for the past week I am trying to code a spec file to install a file on the system only if a specific files is missing. Here is a snippet %global homedir %{_var}/lib/test Source10: main.db Source11: back.db %files data %defattr(-,%{updateuser},%{updateuser},-) %config(noreplace) %verify(not size md5 mtime) %{homedir}/*.db I would like to add a condition where, If file /var/lib/test/file1.txt is missing, install /var/lib/test/back.db I am aware I need to use the %files macro but so far I am not able to figure out how to write the if condition
giomanda (155 rep)
Aug 23, 2024, 06:49 AM • Last activity: Aug 23, 2024, 09:49 AM
1 votes
1 answers
79 views
Kernel image (vmlinuz...) on /boot has always the same date/time across different compilations. Where is it specified?
On a Fedora System, I'm often recompiling the kernel in order to add the necessary T2 patches for the kernel to benefit from the full capabilities of my MacBook Pro (and also so that the keyboard works with the apple-bce drivers). It happens though that, when I recreate the kernel package RPMs using...
On a Fedora System, I'm often recompiling the kernel in order to add the necessary T2 patches for the kernel to benefit from the full capabilities of my MacBook Pro (and also so that the keyboard works with the apple-bce drivers). It happens though that, when I recreate the kernel package RPMs using the original SRPM from the Fedora repository, no matter when I compile the kernel, the installed vmlinuz file that goes into /boot has always the same date/time for each release (independent of the compilation date/time). This happens even for my custom kernel (in which I just stuff the patches inside linux-kernel-test.patch before compiling). The problem with this is that I endup having multiple vmlinuz... images on /boot with the exact same date/time, which confuses refind (the boot loader I use) on what image to load. Of course I workaround this by running touch after installing the custom Kernel rpms, but I'd like to know where is this date/time configured. I could not determine this by doing a quick visual inspection of the .spec file and of the the source code, and I'd really appreciate if a good soul could indicate me the spot and file. Note: I understand the date is artificially set so that the generated kernels have uniform properties for the same version and patch level, which is good for testing purposes, but this is not clear for me if this artificial date/time is a distribution independent kernel attribute or a Fedora package attribute.
Marcelo (3941 rep)
Aug 14, 2024, 10:26 PM • Last activity: Aug 15, 2024, 07:22 PM
3 votes
2 answers
547 views
giving variables a default value in a spec file
I have a spec (myspecfile.spec) file that looks similar to Name: package-%{myname} Version: %{myversion} Release: %{myrelease} License: gpl2 Summary: this is my package BuildArch: noarch %description Some description of the package %files %changelog I run `rpmbuild` like: rpmbuild -bb new.spec --def...
I have a spec (myspecfile.spec) file that looks similar to Name: package-%{myname} Version: %{myversion} Release: %{myrelease} License: gpl2 Summary: this is my package BuildArch: noarch %description Some description of the package %files %changelog I run rpmbuild like: rpmbuild -bb new.spec --define 'myname my_name' --define 'myversion my_version' --define 'myrelease my_release' --define 'myprovide my_provide' And /home/user/rpmbuild/RPMS/noarch/package-my_name-my_version-my_release.noarch.rpm is created. All well and good, but is there any way to give one of my variables a default value? If I omit one of them? Say, I run rpmbuild -bb myfile.spec How can I get those variables listed to contain a default value? If I do a %define myname my_name it will always contain this value no matter what I pass in via the command line.
basil (153 rep)
Jun 19, 2024, 03:14 PM • Last activity: Jun 20, 2024, 11:16 AM
1 votes
0 answers
34 views
Undefine CONFIG_BLK_CGROUP macro while building linux kernel image
I am wanted to build a custom kernel image in which macro CONFIG_BLK_CGROUP is not defined. After researching a little bit I found we can do such configurations in .config file. To be more precise I am building custom kernel image in CentOS8-Stream and the only documentation available is at https://...
I am wanted to build a custom kernel image in which macro CONFIG_BLK_CGROUP is not defined. After researching a little bit I found we can do such configurations in .config file. To be more precise I am building custom kernel image in CentOS8-Stream and the only documentation available is at https://wiki.centos.org/HowTos(2f)Custom_Kernel.html Following the documentation as mentioned in above link I started building custom kernel kernel-4.18.0-448.el8.src.rpm. In step 2 configuring the kernel I copied the config to root kernel source tree as:
# cp configs/kernel-4.18.0-uname -m.config .config
Then did: # make oldconfig Then edited the config and unset CONFIG_BLK_CGROUP using menuconfig: # make menuconfig CONFIG_BLK_CGROUP setting is available in menuconfig under: General setup -> Control Group support -> IO controller as I found by searching for CONFIG_BLK_CGROUP in menuconfig UI. I changed the check box from [*] to empty [ ] and saved the changes. Then when I verified the file .config I could see line: # CONFIG_BLK_CGROUP is not set in .config file. Then followed the rest steps and issued the build as below:
# rpmbuild -bb --without debug --target=uname -m kernel.spec 2> build-err.log | tee build-out.log
Now what I notice after build is that, 1. the file include/generated/autoconf.h still has line #define CONFIG_BLK_CGROUP 1 2. Even after installing the custom kernel and re-booting into it I could see CONFIG_BLK_CGROUP=y in config file under /boot/config Then later I also tried multiple attempts to do the steps as mentioned in CentOS guide again but in a little different way like by changing all the config files under configs dir manually by updating CONFIG_BLK_CGROUP=y to # CONFIG_BLK_CGROUP is not set on step 2 after doing make menuconfig Then just followed next steps as in guide still no luck I still line #define CONFIG_BLK_CGROUP 1 in autoconf.h. Any insights on this, need a way such that my kernel compiles without defining CONFIG_BLK_CGROUP. Basically I don't want the linux kernel source code falling under #ifdef CONFIG_BLK_CGROUP to be executed.
mSatyam (111 rep)
Jun 13, 2024, 08:36 PM • Last activity: Jun 14, 2024, 02:30 PM
0 votes
1 answers
161 views
rpmbuild - how to force /usr prefix in install phase?
I have a very small app that I intend to package in deb and rpm files. The project is here: https://github.com/eantoranz/gitmod I have moved forward locally from what I have in the repo but it's not that different. When running `make` (on my local version) I get a single binary at the root of the pr...
I have a very small app that I intend to package in deb and rpm files. The project is here: https://github.com/eantoranz/gitmod I have moved forward locally from what I have in the repo but it's not that different. When running make (on my local version) I get a single binary at the root of the project: gitmod. I have been able to package it in deb files:
$ dpkg -c packages/files/gitmod-0.10/debian-bookworm/gitmod_0.10-1_amd64.deb 
drwxr-xr-x root/root         0 2024-06-03 20:56 ./
drwxr-xr-x root/root         0 2024-06-03 20:56 ./usr/
drwxr-xr-x root/root         0 2024-06-03 20:56 ./usr/bin/
-rwxr-xr-x root/root     31408 2024-06-03 20:56 ./usr/bin/gitmod
drwxr-xr-x root/root         0 2024-06-03 20:56 ./usr/share/
drwxr-xr-x root/root         0 2024-06-03 20:56 ./usr/share/doc/
drwxr-xr-x root/root         0 2024-06-03 20:56 ./usr/share/doc/gitmod/
-rw-r--r-- root/root       149 2024-06-03 20:56 ./usr/share/doc/gitmod/changelog.Debian.gz
-rw-r--r-- root/root        45 2024-06-03 20:56 ./usr/share/doc/gitmod/copyright
Notice how the binary is in /usr/bin. I think that in order for this to work, I had to use this in rules file:
override_dh_auto_install:
	$(MAKE) DESTDIR=$$(pwd)/debian/gitmod prefix=/usr install
I have this spec file:
Name:           gitmod
Version:        0.10
Release:        1%{?dist}
Summary:        fuse-based linux kernel module to display a committish from a git repo on a mount point.

License:        GPLv2
URL:            https://github.com/eantoranz/gitmod 
Source0:        https://github.com/eantoranz/gitmod 

BuildRequires:  fuse3-devel, libgit2-devel, glib2-devel
Requires:       fuse3, libgit2, glib2

%description
fuse-based linux kernel module to display a treeish from a git repo
 onto a mount point. The content displayed on the file system is read-only.

%prep
%autosetup


%build
%make_build


%install
%make_install


%files
%{_bindir}/*


%changelog
* Wed Jun 05 2024 Edmundo Carmona Antoranz
- Initial release using v0.10
When I run rpmbuild -ba the-spec-file I see that the project is built, but it fails like this, running on a fedora 41 docker container:
Reading /root/rpmbuild/BUILD/gitmod-0.10-build/SPECPARTS/rpm-debuginfo.specpart
Processing files: gitmod-0.10-1.fc41.x86_64
error: File not found: /root/rpmbuild/BUILD/gitmod-0.10-build/BUILDROOT/usr/bin/*

RPM build errors:
    File not found: /root/rpmbuild/BUILD/gitmod-0.10-build/BUILDROOT/usr/bin/*
I can see this in the rpmbuild process output:
mkdir -p /root/rpmbuild/BUILD/gitmod-0.10-build/BUILDROOT/bin
install gitmod /root/rpmbuild/BUILD/gitmod-0.10-build/BUILDROOT/bin
I checked and the file is indeed in /root/rpmbuild/BUILD/gitmod-0.10-build/BUILDROOT/bin:
# ls -l /root/rpmbuild/BUILD/gitmod-0.10-build/BUILDROOT/bin
total 36
-rwxr-xr-x 1 root root 33064 Jun  6 05:23 gitmod
What do I need to do in the spec file to do the installation in /usr/bin instead of /bin?
eftshift0 (707 rep)
Jun 6, 2024, 05:37 AM • Last activity: Jun 6, 2024, 06:03 AM
2 votes
1 answers
1327 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/libexec/platform-python -s` when the RPM is built. I have tried almost everything. I have undefine...
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/libexec/platform-python -s when the RPM is built. I have tried almost everything. I have undefined the mangling according to doc: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/packaging_and_distributing_software/advanced-topics %undefine __brp_mangle_shebangs but the shebangs gets still changed. this is the relevant parts of the specs file: %undefine __brp_mangle_shebangs Name: myapp Version: 2.0.0 Release: 1%{?dist} summary: rpm for my APP BuildArch: noarch ### Build Dependencies ### BuildRequires: python3-setuptools BuildRequires: python3-devel %?python_enable_dependency_generator %build %py3_build %install %py3_install %files .... I can include python*-rpm-macros to the specs and that would set the shebang to something like /usr/bin/python3.6 but it is too restrictive. Our code works in anything > python3.6 so if we deploy the rpm in a system with python3.8 it should work. how can I set /usr/bin/python3 or leave the shebang unchanged on the python scripts? when the rpm is packaged?
danidar (201 rep)
Nov 15, 2021, 01:20 PM • Last activity: Jan 26, 2024, 07:22 AM
2 votes
1 answers
1829 views
How to corrupt rpmdb?
Yes, You read it right i actually want to corrupt RPMDB for testing purpose. I tried Googling it but all i got was to, how to rebuild it. So at last i tried rpm --rebuilddb and killed the process in execution. Then i verified by usr/lib/rpm/rpmdb_verify /var/lib/rpm/Packages echo $? 0 I need it outp...
Yes, You read it right i actually want to corrupt RPMDB for testing purpose. I tried Googling it but all i got was to, how to rebuild it. So at last i tried rpm --rebuilddb and killed the process in execution. Then i verified by usr/lib/rpm/rpmdb_verify /var/lib/rpm/Packages echo $? 0 I need it output 1. which means that RPMDB is corrupt
user3520135 (41 rep)
May 8, 2015, 10:39 AM • Last activity: Jan 15, 2024, 05:19 PM
3 votes
3 answers
2549 views
Tell yum where a local shared library dependency is
We are installing a custom rpm which we built using `rpmbuild`. During the install it fails with a dependency on specific file, in our case specifically `libnvidia-ml.so.1`: Requires: libnvidia-ml.so.1()(64bit) This is installed at `/usr/lib64` but not through the package manager, which cannot chang...
We are installing a custom rpm which we built using rpmbuild. During the install it fails with a dependency on specific file, in our case specifically libnvidia-ml.so.1: Requires: libnvidia-ml.so.1()(64bit) This is installed at /usr/lib64 but not through the package manager, which cannot change. Is there a way to tell yum where to find this file? I found nothing obvious in the manual, and LD_LIBRARY_PATH has no effect.
kabanus (331 rep)
Oct 14, 2020, 12:43 PM • Last activity: Nov 9, 2023, 08:23 PM
2 votes
1 answers
908 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 would like to build it for python2. without changing the name: i have followed the instruction here...
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 would like to build it for python2. without changing the name: i have followed the instruction here: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_conditionalizing_the_python_2_parts and I tried this: %global srcname example # Disable python2 by default %bcond_with python2 Name: python-%{srcname} Version: 1.2.3 Release: 1%{?dist} Summary: An example python module License: MIT URL: https://pypi.python.org/pypi/%{srcname} Source0: %pypi_source BuildArch: noarch %global _description %{expand: A python module which provides a convenient example.} %description %_description %if %{with python2} %package -n python2-%{srcname} Summary: %{summary} BuildRequires: python2-devel %description -n python2-%{srcname} %_description %endif %package -n python3-%{srcname} Summary: %{summary} BuildRequires: python3-devel %description -n python3-%{srcname} %_description %prep %autosetup -n %{srcname}-%{version} %build %if %{with python2} %py2_build %endif %py3_build %install # Must do the python2 install first because the scripts in /usr/bin are # overwritten with every setup.py install, and in general we want the # python3 version to be the default. %if %{with python2} %py2_install %endif %py3_install %check %if %{with python2} %{python2} setup.py test %endif %{python3} setup.py test %if %{with python2} %files -n python2-%{srcname} %license COPYING %doc README.rst %{python2_sitelib}/%{srcname}/ %{python2_sitelib}/%{srcname}-*.egg-info/ %endif %files -n python3-%{srcname} %license COPYING %doc README.rst %{python3_sitelib}/%{srcname}/ %{python3_sitelib}/%{srcname}-*.egg-info/ %{_bindir}/sample-exec %changelog but It always tries to build both which fails furthermore i need to change the package name eg python2-%{srcname}. I need them to have the same names it is not a python module it is a standalone program.
danidar (201 rep)
Nov 30, 2021, 07:56 AM • Last activity: Nov 9, 2023, 08:03 PM
0 votes
1 answers
289 views
error: patch 2147483647 defined multiple times
Sorry for the cryptic title, but that's exactly what I get: bash-4.2# rpmbuild --rebuild dcmtk-3.6.7-3.fc39.src.rpm Installing dcmtk-3.6.7-3.fc39.src.rpm warning: user mockbuild does not exist - using root warning: group mock does not exist - using root warning: user mockbuild does not exist - using...
Sorry for the cryptic title, but that's exactly what I get: bash-4.2# rpmbuild --rebuild dcmtk-3.6.7-3.fc39.src.rpm Installing dcmtk-3.6.7-3.fc39.src.rpm warning: user mockbuild does not exist - using root warning: group mock does not exist - using root warning: user mockbuild does not exist - using root warning: group mock does not exist - using root warning: user mockbuild does not exist - using root warning: group mock does not exist - using root warning: user mockbuild does not exist - using root warning: group mock does not exist - using root error: patch 2147483647 defined multiple times What am I doing wrong with my rpmbuild command ? For reference: bash-4.2# rpmbuild --version RPM version 4.11.3 Full steps: % cat Dockerfile FROM public.ecr.aws/lambda/dotnet:7 WORKDIR /tmp RUN curl -O https://kojipkgs.fedoraproject.org//packages/dcmtk/3.6.7/3.fc39/src/dcmtk-3.6.7-3.fc39.src.rpm RUN yum -y update && yum -y install rpm-build RUN rpmbuild --rebuild dcmtk-3.6.7-3.fc39.src.rpm --- Sames goes for: % cat Dockerfile FROM public.ecr.aws/lambda/dotnet:7 WORKDIR /tmp RUN curl -O https://kojipkgs.fedoraproject.org//packages/dcmtk/3.6.7/3.fc39/src/dcmtk-3.6.7-3.fc39.src.rpm RUN yum -y update && yum -y install rpm-build cmake gcc-c++ libjpeg-devel \ libpng-devel libtiff-devel libxml2-devel openssl-devel zlib-devel doxygen \ git-core RUN rpm -i dcmtk-3.6.7-3.fc39.src.rpm WORKDIR /root/rpmbuild/SPECS/ RUN rpmbuild -ba dcmtk.spec results in: % docker build . [...] error: patch 2147483647 defined multiple times The command '/bin/sh -c rpmbuild -ba dcmtk.spec' returned a non-zero code: 1 --- Looking at the .spec file here are the patches defined: % grep Patch: dcmtk.spec Patch: 0001-Use-system-CharLS-include.patch Patch: 0002-Add-FindCharLS.patch Patch: 0003-Find-and-include-CharLS.patch Patch: 0004-Use-cmake-suggested-locations-for-CharLS.patch Patch: 0005-Correct-CharLS-API-call.patch Patch: 0006-Remove-reference-to-bundled-CharLS.patch Patch: 0007-Update-JLS_ERROR-to-jpegls_error-in-CharLS-usage.patch Patch: 0008-Correct-JpegLsReadHeader-arguments.patch Patch: 0009-Update-JlsParameters-for-new-CharLS.patch Patch: 0010-Correct-JpegLsDecode-arguments-for-CharLS-2.patch Patch: 0011-Update-ilv-for-new-CharLS.patch Patch: 0012-Correct-extra-include-for-CharLS.patch Patch: 0013-Update-errors-to-use-enum-class-in-CharLS-2.patch Patch: 0014-Define-BYTE-for-CharLS.patch Patch: 0015-Update-colorTransformation-for-CharLS-2.patch Patch: 0016-Update-JpegLsEncode-for-CharLS-2.patch Patch: 0017-Increase-sleep-for-tests.patch Patch: 0018-CVE-2022-43272-Fixed-memory-leak-in-single-process-mode.patch --- I discover that I can comment any of the two applied patch to get pass this error, eg: >! sed -e '/0017-Increase-sleep-for-tests.patch/ s/^#*/#/' -i dcmtk.spec But I am curious where does this number 2147483647 comes from ?
malat (3429 rep)
Jun 22, 2023, 06:29 AM • Last activity: Nov 3, 2023, 02:34 PM
1 votes
0 answers
71 views
How to create a rpm according a exist one?
I want to create "snapd" rpm on HUAWEI's OS(openEuler OS), but I have no experience with rpmbuild. In snapd's github repository, there are many spec file for other Linux distribution like CentOS. What should I do to install snapd successfully on openEuler? It seems a total go project, may I could fi...
I want to create "snapd" rpm on HUAWEI's OS(openEuler OS), but I have no experience with rpmbuild. In snapd's github repository, there are many spec file for other Linux distribution like CentOS. What should I do to install snapd successfully on openEuler? It seems a total go project, may I could first go run main.go to run snapd, cause source code is also in github repository, but i got this problem:
[root@myOpenEuler2303 snapd]# go run main.go
2023/08/12 14:34:46.616748 overlord.go:272: Acquiring state lock file
2023/08/12 14:34:46.618640 overlord.go:277: Acquired state lock file
2023/08/12 14:34:46.652502 daemon.go:247: started snapd/unknown (series 16; classic; devmode) openeuler/23.03 (amd64) linux/5.4.119-20.0009.21.spr.
2023/08/12 14:34:46.673454 main.go:129: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount: /tmp/syscheck-mountpoint-1047546609: mount failed: Operation not permitted.
2023/08/12 14:34:46.673504 daemon.go:340: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
2023/08/12 14:34:46.687999 backends.go:58: AppArmor status: apparmor not enabled
cannot run daemon: state startup errors: [cannot obtain snap-seccomp version information: fork/exec /usr/lib/snapd/snap-seccomp: no such file or directory]
exit status 1
cookie (11 rep)
Aug 12, 2023, 03:13 PM
2 votes
1 answers
149 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++](http://cryptopp.com). Crypto++ is named differently on different distributions, for example, on OpenSUSE, I should write ``` BuildRequires: libcryptopp-devel ``` But on Fedora, it should be ``` BuildRequires: cr...
I'm writing a RPM spec file for building my software. The software depends on [Crypto++](http://cryptopp.com) . Crypto++ is named differently on different distributions, for example, on OpenSUSE, I should write
BuildRequires: libcryptopp-devel
But on Fedora, it should be
BuildRequires: cryptopp-devel
Now, how can I unify the two in a single spec file?
Siyuan Ren (1451 rep)
Aug 5, 2023, 06:00 AM • Last activity: Aug 5, 2023, 07:18 AM
1 votes
1 answers
173 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 often and I thought of having a prepared RPM to implement this task. I'm new to the process of crea...
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 often and I thought of having a prepared RPM to implement this task. I'm new to the process of creating RPMs and I'm not sure how to do it, I started to write the file but I ran into some issues, I'd like to share with you the file, with the issues I got: 1. I'd like to get some insight and understand if there's a better way of writing the spec file. 2. Currently I'm getting errors since I need to use the pkg's "configure" before, but this requires creating a "build" directory and only run make from within that directory. Currently I solved this by make from within a directory I created within the BUILD/gdb-9.1 dir. But I'm sure there's a more idiomatic way of doing it. 3. for this process to work, I first need to install gcc-c++ and expat-devel. I what is the best way to do it, currently my option are: 1. put it as part of the rpm installation. 2. run this command prior to the rpm installation. (yet I'd like the rpm to be something that it's the only this required, but I'm not sure if it's a good idea)
%define gdb_version       9.1
%define gdb_release       1

Name: gdb
Summary: GNU Debugger
Version: %{gdb_version}
Release: %{gdb_release}
License: GPL
URL: http://www.gnu.org/software/gdb/ 
Source0: gdb-%{gdb_version}.tar.gz
BuildRequires: readline-devel, ncurses-devel

%description
GDB, the GNU Project debugger, allows you to see what is going on inside another program while it executes.

%prep
%autosetup

%build
mkdir build
cd build
../configure \
--host=x86_64-redhat-linux-gnu \
--target=x86_64-redhat-linux-gnu \
--with-auto-load-dir=$debugdir:$datadir/auto-load:/usr/share/gdb/auto-load \
--with-auto-load-safe-path=$debugdir:$datadir/auto-load:/usr/share/gdb/auto-load \
--with-expat \
--with-gdb-datadir=/usr/share/gdb \
--with-jit-reader-dir=/usr/lib64/gdb \
--without-libunwind-ia64 \
--with-python=/usr \
--without-guile \
--with-separate-debug-dir=/usr/lib/debug \
--with-system-gdbinit=/etc/gdbinit \
--without-babeltrace
make %{?_smp_mflags}

%install
cd build
make install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
danwgh (23 rep)
Jul 24, 2023, 11:50 AM • Last activity: Jul 24, 2023, 12:21 PM
3 votes
0 answers
326 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 `conf.d/example.conf`-. It is expected that the user would copy or rename the files with the end hyph...
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 conf.d/example.conf-. It is expected that the user would copy or rename the files with the end hyphen removed so the application will use it. The application uses /conf.d/*.conf as is common. All files with and without a hyphen suffix should be part of the package with permissions managed by the rpm. The original hyphen-suffixed files may or may not exist at update or remove time. Same with the non hyphen-suffixed versions. It appears that both file name versions must be added to buildroot but I'm not sure of best practice to name some as ghost. The user may also add a conf file of their own. Is it possible to enforce permissions for files in a package owned directory but not known to the package? The conf.d/*conf strategy is commonly used but I haven't found any example of handling this other than ignoring user created files and not deleting the directory on remove if any exist. Advice, references and/or examples would be appreciated.
EddieSub (31 rep)
Jun 23, 2023, 09:28 PM • Last activity: Jun 24, 2023, 11:16 AM
Showing page 1 of 20 total questions