Page 1 of 1

Build rpms for gcc-4.2

PostPosted: Jun 20th, '11, 18:50
by surik
Can you help me build Mageia rpms for gcc-4.2, please?

Thank!

Re: Build rpms for gcc-4.2

PostPosted: Jun 20th, '11, 20:03
by doktor5000
May i ask what exactly do you need those for?

Re: Build rpms for gcc-4.2

PostPosted: Jun 20th, '11, 20:12
by Akien
Well, we will need more info to help you.

Do you need to build a RPM (so that gcc-4.2 can be installed on many computers), or do you need it only on your machine (in that case you should just try to compile it, without bothering with a RPM)?

If you need to compile it, there should be some info in the source of gcc-4.2 (although I have no clue how it should be compiled, I'm used to using gcc to compile stuff :p).
If you want to create a RPM, you can have a look at http://wiki.mandriva.com/en/Mandriva_RPM_HOWTO
You may also try to download an already packaged gcc-4.2 (I'm pretty sure there was gcc-4.2 in a former Mandriva) and to adapt its spec file for Mageia, I guess. I'm not a packager myself so I may be wrong.

Re: Build rpms for gcc-4.2

PostPosted: Jun 20th, '11, 20:27
by surik
One project can be built only with gcc-4.2. I will plan to build it many times on many machines with Mageia. Than I need to build gcc-4.2 rpm (to install it on many computers).

Akien, I saw this article. Yes, I'm not a packager also. I download, for practice, current spec http://svnweb.mageia.org/packages/cauldron/gcc/current/SPECS/?sortdir=down and try to build gcc-4.5.2. But I could not build it :(

PS: Sorry for my English.

Re: Build rpms for gcc-4.2

PostPosted: Jul 4th, '11, 22:10
by seilebost
Hi.

Before MAGEIA, I have used Mandriva 2010.2 and the software ISIM from Xilinx (FPGA) ran correctly. Then I have updated to MAGEIA 1. And, now, ISIM doesn't run :-(.
The problem is gcc. In fact, with MAGEIA 1, the versop, of gcc is 4.5.2. Or, it isn't correct because ISIM uses gcc4.4.3 to generate a binary to simulate.
I would package an gcc 4.4.3 for MAGEIA 1. How to do it ?
Thanks for your response.
Best regards.

Seilebost.

Re: Build rpms for gcc-4.2

PostPosted: Jul 4th, '11, 23:08
by Akien
Well, if you're unexperienced in packaging, I guess gcc is not the best fit for a first package.
I would advise you to compile gcc 4.4.3 from the source code, following this guide: http://gcc.gnu.org/install/index.html

Though it may a bit harder to compile than other stuff, because you kinda have to bootstrap it I guess. (Maybe you can compile gcc 4.4.3 using Mageia's gcc 4.5.2, I don't know much about it).

Another solution would be to ask ISIM's developers to check if their software really cannot be compiled using a recent version of gcc, or if it is an error which could be fixed.

Re: Build rpms for gcc-4.2

PostPosted: Jul 5th, '11, 16:35
by genomega
There is a mandy rpm here: http://rpm.pbone.net/index.php3/stat/4/ ... 6.rpm.html

Trying to package or compile this monster is beyond the scope of mortal men. The last time I checked the spec file was over 3,300 lines of code.

Re: Build rpms for gcc-4.2

PostPosted: Jul 6th, '11, 22:02
by seilebost
Thanks for your response.
I find a solution : by using VirtualBox and Mandriva 2010.2, ISIM runs perfectly. But this solution is not cool.
Another solution : create a 'chrooter' a complete system ...

Re: Build rpms for gcc-4.2

PostPosted: Jul 12th, '11, 17:10
by wintpe
i had to make my own vmwaretools at work from the tarball i extracted from esxi.

so this may also work for you.

lets assume you can build gcc following the build instructions from the gcc docs.

now go and look for a similar gcc version for centos or fedora or better still mandriva.

extract the spec file for it as follows

rpm --scripts -qp gcc-package.version.rpm > temp.spec

Now remove all the comment lines from it like, "postinstall scriptlet (using /bin/sh):" and replace each of them with %post %pre %postun $%preun.

look for the

%files
%defattr(-,root,root)


lines and make sure that your gcc is sitting under similar paths (you would be best installing it under something like /var/tmp/myfakerootforgcc rather than into the operating system directories, but the above should be relitive to that directory, in other words you may have a /var/tmp/myfakerootforgcc/bin and /var/tmp/myfakerootforgcc/usr and that should be

%files
/bin
/usr

you only list the top level, not the individual files.

save the spec file and then run the following

rpmbuild -bb gcc.spec --root /var/tmp/myfakerootforgcc --target x86_64

this builds a binary only rpm ie a package, unlike the srpm's that are much easier to build from.

of course if you can get an srpm version of the gcc you want then thats much simpler

ie rpmbuild --rebuild file.srpm

regards peter