4. Compiling RPM
After building Berkeley DB3 and gcc, compile rpm program now. Get rpm source code from one of the following two sources:
- Redhat source rpm from cdrom or from http://www.redhat.com or from http://www.rpmfind.net and look for proper version like 7.1
- Download source code of rpm from http://www.rpm.org go here and select proper version like 4.0.2 (one which matches with Redhat Linux 7.1). Download from ftp-site.
If you downloaded rpm*.tar.gz file:
bash$ mkdir my_temp_build bash$ cd my_temp_build bash$ tar zxvf rpm*.tar.gz bash$ cd rpm-4.0.2 bash$ export LIBS='-L/usr/local/BerkeleyDB.3.1/lib' bash$ export CPPFLAGS='-I/usr/local/BerkeleyDB.3.1/include' bash$ ./configure bash$ make
If you downloaded rpm source code file follow the steps below. But you may need rpm2cpio program, which is packaged in rpm package. Get rpm package (may be old version like 3.0) from Unix packages .
bash$ mkdir my_temp_build bash$ cd my_temp_build bash$ rpm2cpio rpm-4.0.2-8.src.rpm | cpio -dimv bash$ tar zxvf rpm*.tar.gz bash$ cd rpm-4.0.2 bash$ export LIBS='-L/usr/local/BerkeleyDB.3.1/lib' bash$ export CPPFLAGS='-I/usr/local/BerkeleyDB.3.1/include' bash$ ./configure bash$ make
4.1 Troubleshooting RPM Compile
If you encounter any problem in compiling rpm program, you may have to do some minor corrections.
In case of Solaris 8 and rpm v4.0.2, I got these problems:
- Error db3/db.h not found in lib/db3.c. Solution is - create a soft link:
bash# ln -s /usr/local/BerkeleyDB.3.1.17/include /usr/include/db3 Or edit the file lib/db3.c and change #include <db3/db.h> to #include <db.h>
- Edit Makefile and put -L before libmisc.a at line 186
- Compile error in file rpmsort.c: Function errx() not found. Solution is - edit the file rpmsort.c and copy and paste the function errx() from misc/err*.c. Or comment out line having errx() and put fprintf(stderr, "Error encountered - blah, blah"); exit(0);
Next Previous Contents