To install RPM program you need gcc and BerkeleyDB. First you should decide the version of Redhat Linux which you want to use. The versions of Redhat Linux are 7.1 (latest), 6.2, 5.x (old versions).
To build rpm package you need atleast BerkeleyDB and gcc compiler. It is very important that you MUST select proper versions of gcc, BerkeleyDB and RPM source based on whether you want to represent Redhat 7.1, Redhat 6.2 or 5.x. If you happen to have a Redhat Linux box then do -
bash$ rpm -qa | grep -i gcc bash$ rpm -qi gcc-2.96-81 bash$ rpm -qa | grep -i db3 bash$ rpm -qi db3-3.1.17-7 bash$ rpm -qa | grep -i rpm bash$ rpm -qi rpm-4.0.2-8
WARNING: If you do not use proper version numbers of gcc, db3 and rpm combinations then RPM program may not compile or work properly..
For example - to target Redhat Linux 7.1 on Solaris, you should use gcc version 2.96, Sleepycat Berkeley DB version 3.1.17 and RPM source version 4.0.2. Any other combination of versions WILL NOT work.
You can see the list of files and programs needed to build rpm. Login on linux box and:
bash$ rpm -qR rpm-4.0.2-8 gawk fileutils textutils mktemp popt glibc >= 2.1.92 db1 = 1.85 /bin/sh /bin/sh /sbin/ldconfig ld-linux.so.2 libbz2.so.1 libc.so.6 libdb-3.1.so libdb.so.2 libpopt.so.0 librpm.so.0 librpmbuild.so.0 librpmio.so.0 libz.so.1 /bin/sh libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.2) libdb.so.2(GLIBC_2.0) rpmlib(CompressedFileNames) <= 3.0.4-1 bash$ To see to which package gawk belongs to do: bash$ rpm -qif /usr/bin/gawk Name : gawk Relocations: (not relocateable) Version : 3.0.6 Vendor: Red Hat, Inc. Group : Applications/Text Source RPM: gawk-3.0.6-1.src.rpm
First, you need to install the Gnu C compiler gcc. You can use one of the following three sources:
If you downloaded Solaris/Unix package:
# su - root # man pkgadd # pkgadd -d gcc-sparc*.pkg
If you downloaded rpm package:
bash$ mkdir my_temp_build bash$ cd my_temp_build bash$ rpm2cpio gcc-*.src.rpm | cpio -dimv bash$ tar zxvf gcc*.tar.gz bash$ cd gcc-2.96 bash$ ./configure bash$ make
Second, you need to install the BerkeleyDB embedded database from http://www.sleepycat.com. RPM internally uses the embedded database BerkeleyDB to store the package information. You can use one of the following three sources:
If you downloaded source rpm or source tar.gz file:
bash$ mkdir my_temp_build bash$ cd my_temp_build bash$ rpm2cpio db3-3.1.17-7.src.rpm | cpio -dimv bash$ tar zxvf db3*.tar.gz bash$ cd db3-3.1.17 bash$ cd build_unix bash$ ../dist/configure --enable-compat185 bash$ make bash$ make install
If you downloaded Unix package:
# su - root # man pkgadd # pkgadd -d db-3*-sparc*.pkg