Build rpms for gcc-4.2

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

Build rpms for gcc-4.2

Postby surik » Jun 20th, '11, 18:50

Can you help me build Mageia rpms for gcc-4.2, please?

Thank!
surik
 
Posts: 2
Joined: Mar 29th, '11, 22:18

Re: Build rpms for gcc-4.2

Postby doktor5000 » Jun 20th, '11, 20:03

May i ask what exactly do you need those for?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18054
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Build rpms for gcc-4.2

Postby Akien » Jun 20th, '11, 20:12

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.
Image
Co-leader of Mageia's packaging and development team (dev).
List of packages I maintain.
User avatar
Akien
 
Posts: 171
Joined: Jun 5th, '11, 22:54
Location: Brunswick, Germany

Re: Build rpms for gcc-4.2

Postby surik » Jun 20th, '11, 20:27

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.
surik
 
Posts: 2
Joined: Mar 29th, '11, 22:18

Re: Build rpms for gcc-4.2

Postby seilebost » Jul 4th, '11, 22:10

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.
seilebost
 
Posts: 4
Joined: Jul 4th, '11, 21:46

Re: Build rpms for gcc-4.2

Postby Akien » Jul 4th, '11, 23:08

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.
Image
Co-leader of Mageia's packaging and development team (dev).
List of packages I maintain.
User avatar
Akien
 
Posts: 171
Joined: Jun 5th, '11, 22:54
Location: Brunswick, Germany

Re: Build rpms for gcc-4.2

Postby genomega » Jul 5th, '11, 16:35

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.
genomega
 
Posts: 8
Joined: Mar 30th, '11, 15:57

Re: Build rpms for gcc-4.2

Postby seilebost » Jul 6th, '11, 22:02

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 ...
seilebost
 
Posts: 4
Joined: Jul 4th, '11, 21:46

Re: Build rpms for gcc-4.2

Postby wintpe » Jul 12th, '11, 17:10

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
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest

cron