I investigated how default running RPM v4.8.0 [1] is built and installed on CentOS6, because my application [1] needs to support CentOS6. Very old version RPM v4.8.0 is running as a default on CentOS6.
We can use CentOS6 environment, downloading CentOS6 image from DockerHub [3]. This time, I used my extended Docker image based on the CentOS6 image.
Build container's image, and run the built container with interactive mode.
$ git clone https://github.com/junaruga/rpm-py-installer.git $ sed -i "/^FROM / s|FROM .*|FROM centos:6|" .travis/Dockerfile.centos $ docker build --rm -t rpm-py-installer -f .travis/Dockerfile.centos . $ docker run -it rpm-py-installer bash
In container.
# cat /etc/centos-release CentOS release 6.9 (Final) # gcc --version | head -1 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) # yum install wget # mkdir git # cd git # wget https://github.com/rpm-software-management/rpm/archive/rpm-4.8.0-release.tar.gz # cd rpm-rpm-4.8.0-release
Below RPM packages are necessary. I also used minimal configure options to check it.
- libtool nss-devel nspr-devel: Need to pass ./autogen.sh (autoconf).
- db4-devel: Berkeley DB
- zlib-devel: To fix the error "librpmio.so: undefined reference to gzdFdopen" on
make
.
# yum install libtool nss-devel nspr-devel db4-devel zlib-devel # ./autogen.sh --noconfigure # ./configure \ --prefix=$(pwd)/dest \ --enable-python \ --with-external-db \ --without-lua \ CPPFLAGS="-I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/db4" # make # make install # dest/bin/rpm --version RPM version 4.8.0
And other important files for me.
# find ./dest/lib64/python2.6/site-packages/rpm -type f ./dest/lib64/python2.6/site-packages/rpm/__init__.py ./dest/lib64/python2.6/site-packages/rpm/transaction.py ./dest/lib64/python2.6/site-packages/rpm/_rpmmodule.so ./dest/lib64/python2.6/site-packages/rpm/_rpmmodule.la ./dest/lib64/python2.6/site-packages/rpm/_rpmbmodule.so ./dest/lib64/python2.6/site-packages/rpm/_rpmbmodule.la # cat rpm.pc prefix=/root/git/rpm-rpm-4.8.0-release/dest exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include rpmhome=/root/git/rpm-rpm-4.8.0-release/dest/lib/rpm Name: RPM Description: RPM Package Manager Version: 4.8.0 URL: http://rpm.org # Requires: # Conflicts: Cflags: -I${includedir} Libs: -L${libdir} -lrpm -lrpmio Libs.private: -lpopt -lrt -lpthread -ldb -lz -lnss3
The Python binding module looks working.
# cd dest/lib64/python2.6/site-packages # /usr/bin/python --version Python 2.6.6 # /usr/bin/python -c "import rpm; print(rpm.ts)" <class 'rpm.transaction.TransactionSet'>