by 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.