[RESOLVED] - rpmbuild Firefox from SPEC into different directory

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

[RESOLVED] - rpmbuild Firefox from SPEC into different directory

Post by warron.french » 2019/05/02 15:04:26

I need to take Firefox-52.5.1 using the SRC rpm from Red Hat and give it a new name, so that it is NOT upgradable, and place it in a different directory such as /opt.

I can do this by modifying the provided SPEC file (firefox.spec) from the src RPM- firefox-52.5.1-1.el7_4.src.rpm. Can't I?

I know that the SPEC file does not contain an Arch or even an ExclusiveArch attribute up in the preamble.
I also know that I can simply execute the rpmbuild command to have it attempt build the x86_64 RPM that I need as well, without making any changes to the SPEC to apply the Arch or ExclusiveArch into the SPEC file. Or am I incorrect?

I have already executed the rpmbuild command:

Code: Select all

rpmbuild -vv -bb rpmbuild/SPECS/firefox.spec
And run into a problem I did not quite expect.

I looked for the %{name} tag, but I could not find it in the firefox.spec file; I would like to change it to be firefox52, instead of simply firefox, that way I can identify the package uniquely.

I know I am on the correct track, but the little pieces I know and understand are not helpful in this RPM build. ;)

Sorry for all the of the requests for help,
Last edited by warron.french on 2019/06/24 20:18:56, edited 1 time in total.
Thanks,
War

User avatar
TrevorH
Forum Moderator
Posts: 26596
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild Firefox from SPEC into different directory

Post by TrevorH » 2019/05/02 15:18:11

Start by rebuilding the SRPM unmodified so that you know that whatever goes wrong is a problem with your build environment. Fix the problems until it builds then substitute your modified package after that.

It's recommended to use mock instead of rpmbuild. If you use rpmbuild then you have to install all prereqs onto your build system. If you use mock it prepares a clean chroot with only the bare minimum of things in it and builds in a clean environment. It also means that undoing it and freeing disk space is as easy as mock --scrub all. You build your SRPM with rpmbuild as normal then pass it into mock using e.g. mock --rebuild /path/to/current.src.rpm
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: rpmbuild Firefox from SPEC into different directory

Post by warron.french » 2019/05/02 19:06:02

I was incorrect about the %{name} tag, I did find it eventually. It turns out that the tag I needed to look for was %{Name} with a capital N.

I am still looking into placing the firefox into a directory like /opt/firefox52.

Does anyone know if changing %{Name} is enough or not?
Thanks,
War

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

Re: rpmbuild Firefox from SPEC into different directory

Post by warron.french » 2019/05/02 19:10:18

TrevorH wrote:
2019/05/02 15:18:11
Start by rebuilding the SRPM unmodified so that you know that whatever goes wrong is a problem with your build environment. Fix the problems until it builds then substitute your modified package after that.

It's recommended to use mock instead of rpmbuild. If you use rpmbuild then you have to install all prereqs onto your build system. If you use mock it prepares a clean chroot with only the bare minimum of things in it and builds in a clean environment. It also means that undoing it and freeing disk space is as easy as mock --scrub all. You build your SRPM with rpmbuild as normal then pass it into mock using e.g. mock --rebuild /path/to/current.src.rpm
I am running into this error:

Code: Select all

checking for the target C++ compiler... not found
DEBUG: _cxx: Trying /usr/bin/g++
ERROR: Cannot find the target C++ compiler
*** Fix above errors and then restart with\
               "make -f client.mk build"
make[2]: *** [configure] Error 1
make[2]: Leaving directory `/home/build/rpmbuild/BUILD/firefox52-52.5.1/firefox-52.5.1esr'
make[1]: *** [/home/build/rpmbuild/BUILD/firefox52-52.5.1/firefox-52.5.1esr/objdir/Makefile] Error 2
make[1]: Leaving directory `/home/build/rpmbuild/BUILD/firefox52-52.5.1/firefox-52.5.1esr'
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.csY8I6 (%build)
But I already have the package gcc installed on my machine. Do I need to look for what provides '/usr/bin/g++' ?
Thanks,
War

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

Re: rpmbuild Firefox from SPEC into different directory

Post by warron.french » 2019/05/02 20:49:02

Good news, I got past the C++ compiler not found. I just had to install the gcc-c++ package to provide the namesake binary.

So, I am moving forward a little bit.
Thanks,
War

User avatar
TrevorH
Forum Moderator
Posts: 26596
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild Firefox from SPEC into different directory

Post by TrevorH » 2019/05/03 00:58:31

This is exactly why you should use mock. It will install all BuildRequires: for you.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: rpmbuild Firefox from SPEC into different directory

Post by warron.french » 2019/05/03 12:23:33

TrevorH wrote:
2019/05/03 00:58:31
This is exactly why you should use mock. It will install all BuildRequires: for you.
Ah! OK.

Any idea on how to tell the build to place Firefox into a different directory, like /opt/firefox52?
Thanks,
War

User avatar
TrevorH
Forum Moderator
Posts: 26596
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild Firefox from SPEC into different directory

Post by TrevorH » 2019/05/03 16:14:36

That would be controlled in the spec file.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

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

Re: rpmbuild Firefox from SPEC into different directory

Post by warron.french » 2019/05/20 19:18:11

TrevorH,
do you know where I can find the build instructions for Firefox-52.y.z?
Thanks,
War

User avatar
TrevorH
Forum Moderator
Posts: 26596
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild Firefox from SPEC into different directory

Post by TrevorH » 2019/05/20 20:37:26

If it doesn't just build using mock --rebuild /path/to/firefox-52.x.y.src.rpm then no, sorry.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Software Support”