[SOLVED] - rpmbuild error

Issues related to applications and software problems
Post Reply
User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

[SOLVED] - rpmbuild error

Post by warron.french » 2019/06/24 18:46:15

The following is my firefox.spec file for building a custom RPM for the installation of Firefox v67.0.2 into a different directory - /opt/firefox67.

Code: Select all

Name:          firefox67
Version:       67.0.2
Release:       4.0.0%{?dist}.custom1
Summary:       Custom Firefox
Group:         Applications/Internet

License:       MPL v2.0
URL:           https://ftp.mozilla.org/pub/firefox/releases/67.0.2/linux-x86_64/en-US/
Source0:       firefox67-67.0.2.tar.xz

BuildRoot: %{_tmppath}/%{name}-buildroot
ExclusiveArch: x86_64

%description
This is a custom build that uses the firefox binaries directly from Mozilla.org out of the archive (tar.bz2) of already-compiled binaries;
  however, it enables the usage of legacy SSL cipher suites and protocols.

%prep
%setup -q


%install
rm -rf "$RPM_BUILD_ROOT"
cp -R * "$RPM_BUILD_ROOT"


%files
%defattr(-,root,root,-)
/opt/firefox67



%changelog
* Thu Jun 20 2019 Warron French <warron.french@gmail.com> 4.0.0
- Initial RPM Release from lab using the shell script.
I get the following error/output during the execution of an rpmbuild -v -ba that is executed by my script; in which the intent is the ability to be able to create consistently a Custom Firefox## RPM anytime my organization requires, and so that it is easy to do quickly/

Here is the error/output:

Code: Select all

+ rpmbuild -v -ba /home/build/rpmbuild/SPECS/firefox.spec
+ sh /home/build/CFirefox/monitor_RPMbuild.sh
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.pmVRNy
+ umask 022
+ cd /home/build/rpmbuild/BUILD
+ cd /home/build/rpmbuild/BUILD
+ rm -rf firefox67-67.0.2
+ /usr/bin/tar -xf -
+ /usr/bin/xz -dc /home/build/rpmbuild/SOURCES/firefox67-67.0.2.tar.xz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd firefox67-67.0.2
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.1NH4OF
+ umask 022
+ cd /home/build/rpmbuild/BUILD
+ '[' /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64 '!=' / ']'
+ rm -rf /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64
++ dirname /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64
+ mkdir -p /home/build/rpmbuild/BUILDROOT
+ mkdir /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64
+ cd firefox67-67.0.2
+ rm -rf /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64
+ cp -R opt /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64
+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: firefox67-67.0.2-4.0.0.el7.custom1.x86_64
error: File not found: /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64/opt/firefox67


RPM build errors:
    File not found: /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64/opt/firefox67
The interesting thing is that the opt directory DOES INDEED exist under /home/build/rpmbuild/BUILD/firefox67-67.0.2.
Proof:

Code: Select all

[build@wfrench-rh7build:firefox67-67.0.2]$ ls -l /home/build/rpmbuild/BUILD/firefox67-67.0.2
total 0
drwxr-xr-x. 3 build build 23 Jun 24 18:29 opt
I don't know why this is happening. Can I get some guidance on how to root out this problem or script around it. Like I said, opt, does exist under /home/build/rpmbuild/BUILD/firefox67-67.0.2, and if I attempt a manual copy of the directory from the BUILD directory over to the /home/build/rpmbuild/BUILDROOT/firefox67-67.0.2-4.0.0.el7.custom1.x86_64/ directory it succeeds.

Thank you for any correction/help in advance,
Last edited by warron.french on 2019/06/24 19:39:12, edited 1 time in total.
Thanks,
War

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild error

Post by TrevorH » 2019/06/24 18:55:21

Code: Select all

rm -rf "$RPM_BUILD_ROOT"
cp -R * "$RPM_BUILD_ROOT"
So there you remove the directory and then copy into it. Perhaps you need to create it again after rm'ing it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: rpmbuild error

Post by warron.french » 2019/06/24 18:58:45

TrevorH wrote:
2019/06/24 18:55:21

Code: Select all

rm -rf "$RPM_BUILD_ROOT"
cp -R * "$RPM_BUILD_ROOT"
So there you remove the directory and then copy into it. Perhaps you need to create it again after rm'ing it.
Thanks TrevorH, hashing out that line and trying again got rid of that error and presented the next one, which was easy to overcome.

It usually isn't a problem for me. :cry:

I got that snippet by following UrbanPenguin's HOWTO on Youtube.com. I don't really understand why he is doing it; and it never caused me a problem before with the other RPMs I was creating.

Anyway, thanks again.
Thanks,
War

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: [SOLVED] - rpmbuild error

Post by warron.french » 2019/06/24 19:45:58

On this, I finally figured out where I went wrong.

What I did put before was:

Code: Select all

rm -rf "$RPM_BUILD_ROOT"
cp -R * "$RPM_BUILD_ROOT"
What the correct syntax was supposed to be, is|was:

Code: Select all

mkdir -p "$RPM_BUILD_ROOT"
cp -R * "$RPM_BUILD_ROOT"
Thanks,
War

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: [SOLVED] - rpmbuild error

Post by TrevorH » 2019/06/24 19:56:32

It's fine to rm the build root before you start but if you do that and then cp into it, it has to exist so you have to rm/mkdir/cp
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply