On MacOS there is a homebrew formula to install the RPM development package from rpm5.org. However, this installs only the command line tools (rpm, rpmlint, rpmbuild, etc) and does not install any of the language bindings which are supported.
I would like to use the Pascal language bindings. However, when I build them and attempt to import the rpm package into Python 2.7 I get this error:
$ python -c "import rpm._rpm"
Traceback (most recent call last):
File "", line 1, in File "/usr/local/lib/python2.7/venv-default/lib/python2.7/site-packages/rpm/init.py", line 7, in from _rpm import * ImportError: dlopen(/usr/local/lib/python2.7/venv-default/lib/python2.7/site-packages/rpm/_rpmmodule.so, 2): Symbol not found: _sqlite3_enable_load_extension Referenced from: /usr/local/Cellar/rpm/5.4.15_1/lib/librpmio-5.4.dylib Expected in: flat namespace in /usr/local/Cellar/rpm/5.4.15_1/lib/librpmio-5.4.dyl
To build the Python bindings I re-installed the rpm package with homebrew using these commands:
brew install -v --keep-tmp --build-from-source rpm 2>&1 | tee brew_install.log
cd /tmp/rpm-20170408-18245-1u8nsbs/rpm-5.4.15
./configure --prefix=/usr/local/Cellar/rpm/5.4.15_1 --localstatedir=/usr/local/var --with-path-cfg=/usr/local/etc/rpm --with-path-magic=/usr/local/share/misc/magic --with-path-sources=/usr/local/var/lib/rpmbuild --with-libiconv-prefix=/usr --disable-openmp --disable-nls --disable-dependency-tracking --with-db=external --with-sqlite=external --with-file=external --with-popt=external --with-beecrypt=internal --with-libtasn1=external --with-neon=internal --with-uuid=external --with-pcre=internal --with-lua=internal --with-syck=internal --without-apidocs varprefix=/usr/local/var --with-python
cd python
make
make install
Note the ./configure
command is the same one as Homebrew used with the --with-python
switch appended.
How can I use the cross platform rpm5.org based source code to do Python language development on MacOS?