6. Installing 8000 RPMs
Once RPM program is installed, it is a gateway to thousands of RPM packages which can be easily installed on the system.
Prepare the rpm directories
bash# su - root bash# mkdir -p /usr/local/src/redhat/BUILD bash# mkdir -p /usr/local/src/redhat/RPMS/sparc64 bash# mkdir -p /usr/local/src/redhat/RPMS/noarch bash# mkdir -p /usr/local/src/redhat/SOURCES bash# mkdir -p /usr/local/src/redhat/SPECS bash# mkdir -p /usr/local/src/redhat/SRPMS
You may want to edit the rpmrc file. In case of solaris 8, I had to remove the -m64 option for gcc, since it was giving compile errors. To show the values, RPM will use for all of the options that may be set in rpmrc files (/usr/local/lib/rpm/rpmrc, /usr/lib/rpm/rpmrc, /etc/rpmrc, /.rpmrc ), type:
bash$ rpm --showrc | less
6.1 Bootstrap Programs - The Rocket Soars Up!!
Before building rpms you need the following basic programs:
- install program from fileutils*.tar.gz
- patch*.tar.gz
- autoconf*.tar.gz
- automake*.tar.gz
- libtool*.tar.gz
- gcc*.tar.gz
bash# mkdir $HOME/localtmp bash# cd $HOME/localtmp bash# gzip -d libtool*.tar.gz bash# tar -xvf libtool*.tar bash# ./configure --with-prefix=$HOME/localtmp bash# make; make install
You should include the temporary location of autoconf by:
bash# PATH=$HOME/localtmp/bin:$PATH bash# export PATH
6.2 Install Foundation RPMs
There are few basic rpms which must be installed before any other rpm is installed. In this section, foundation rpms are listed which are found by using:
bash# rpm -qR <packagename> bash# rpm -qR textinfo bash# rpm -qR fileutils bash# rpm -qR setup
The foundation rpms in the order of dependency are as follows:
- fileutils*.rpm
- grep*.rpm (You may have to edit grep.spec and commentout --without-included-regex)
- gawk*.rpm
- sed*.rpm
- texinfo*.rpm
- zlib*.rpm and zlib-devel
- patch*.rpm
- setup*.rpm
- filesystem*.rpm (You may not want install this if it effects /proc directory)
- textutils*.rpm
- glibc-common*.rpm
- basesystem*.rpm
- mktemp*.rpm
- bash*.rpm
- m4*.rpm (autoconf needs this)
- autoconf
- bison
- binutils >= 2.9.1.0.25
- gas, as, ld which are in binutils
- shutils - for 'id' command
Second stage foundation rpms are as follows. After installing the foundation rpms, next important rpm is gcc, the order of rpms you need is:
- glibc*.rpm
- binutils*.rpm
- kernel-headers*.rpm
- glibc-devel*.rpm
- gcc*.rpm
Third stage rpms are as follows:
- popt*.rpm
- rpm*.rpm
- perl*.rpm
- And many others....
As from previous section you should have exported temp location of autoconf, gcc and other programs by:
bash# PATH=$HOME/localtmp/bin:$PATH bash# export PATH bash# rpm -i fileutils*.src.rpm bash# rpm -i zlib*.src.rpm bash# rpm -i texinfo*.src.rpm bash# cd /usr/local/src/redhat/SPECS bash# rpm -ba fileutils.spec
After the build is successful, install it with "nodeps and excludedocs" to minimize the failures. After substantial installations of many foundation rpms you can "freshen" the rpms with rpm command.
bash# cd /usr/local/src/redhat/RPMS/sparc64 bash# rpm -i --nodeps --excludedocs fileutils*.rpm
Move on to build and install the next rpm in the list texinfo, zlib, patch,....
6.3 Troubleshoot Building Foundation RPMs
On Solaris 2.8, I encountered following problems which were fixed by correcting the spec file:
- texinfo*.rpm:
Edit the file texinfo.spec and change __spec_install_post, %build and %install sections:
%define Rpmpath /usr/local %define __spec_install_post %{Rpmpath}/lib/rpm/brp-strip \; %{Rpmpath}/lib/rpm/brp-strip-comment-note \; rm -f %build %define _mandir %{_prefix}/share/man %define _infodir %{_prefix}/share/info %configure %install #mkdir -p ${RPM_BUILD_ROOT}/{etc,sbin} .....this line is causing problems mkdir -p ${RPM_BUILD_ROOT}/etc mkdir -p ${RPM_BUILD_ROOT}/sbin
- textutils*.rpm:
Create a new unix group called 'other'. Type 'groupadd other'
and see 'man groupadd'. Second problem - edit textutils.spec file and in %files section replace
hard-coded filenames/pathnames with %{_prefix}.
%files # replace below line #/usr/bin/* # with the line given below %{_prefix}/bin/*
- patch*.rpm:
Edit patch.spec file and in %files section replace
hard-coded filenames/pathnames with %{_prefix}.
%files # replace below line #/usr/bin/* # with the line given below %{_prefix}/bin/*
- gawk*.rpm: Edit gawk.spec file and in %files section and %install section replace hard-coded filenames/pathnames like /usr/something with %{_prefix}/something.
- m4*.rpm: Edit m4.spec file and in %build section, the configure takes only --prefix and --exec-prefix. Also comment out autoconf.
Next Previous Contents