Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
1. I am trying to create a rpm file on RHEL 6 using rpmbuild. I receive below error while running “rpmbuild –ba testfile.spec” (FYI - I am running the above command as non-root user)
RPM build errors:
File not found: /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64/home/makerpm/rpmbuild/SOURCES/httpd-2.4.12.tar.gz
2. Before running rpmbuild I did ensure there are source files in /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64/home/makerpm/rpmbuild/SOURCES directory.
The below are contents from the spec file
%define _topdir /home/makerpm/rpmbuild
%define name httpd
%define release 2.4
%define version 2.4.12
%define buildroot %{_tmppath}/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: Create a test rpm file
Name: httpd
Version: 2.4.12
Release: 2.4
License: ATT
Vendor: ATT
Source: source1.tar.gz
Source1:source2.tar.gz
Source2:source3.tar.gz
3. I noticed that once it enters %install it removes the $RPM_BUILD_ROOT directory which is “/home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64” and then recreates it. That is the reason I am losing the source files I had moved earlier.
Please see the messages below which were generated.
Executing(%install): /bin/sh -e /var/tmp/apache/rpm-tmp.oTHV01
+ umask 022
+ cd /home/makerpm/rpmbuild/BUILD
+ '[' /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64 '!=' / ']'
+ rm -rf /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64
++ dirname /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64
+ mkdir -p /home/makerpm/rpmbuild/BUILDROOT
+ mkdir /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64
+ LANG=C
+ export LANG
+ unset DISPLAY
+ make install
Making install in srclib
I tried putting files in a different directory but it always looks for the files in $RPM_BUILD_ROOT. Is there a way we can put the files in a directory different from $RPM_BUILD_ROOT?
Error : RPM build errors:
File not found: /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64/home/makerpm/rpmbuild/SOURCES/httpd-2.4.12.tar.gz
3. After receiving the above error I tried copying the files to the /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64/home/makerpm/rpmbuild/SOURCES directory but the error persists. As mentioned earlier in my email even though I created directories in the $RPM_BUILD_ROOT once it enters %install it removes the $RPM_BUILD_ROOT directory which is /home/makerpm/rpmbuild/BUILDROOT/httpd-2.4.12-2.4.x86_64 and then recreates it. That is the reason I am losing the source files I had moved earlier.
How can we ensure the .tar.gz files are packaged in rpm?
? Why do you want the source files in the rpm package ?
Source files are for the src.rpm package .
I.e. 'rpmbuild -ba' means : Build binary and source packages http://linux.die.net/man/8/rpmbuild
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.