2017-04-07 11 views
0

MacOSの場合、rpm5.orgからRPM開発パッケージをインストールするにはhomebrew formulaがあります。ただし、コマンドラインツール(rpm、rpmlint、rpmbuildなど)のみがインストールされ、サポートされている言語バインディングはインストールされません。MacOSでRPM/RPM5のPython言語バインディングを使用するにはどうすればよいですか?

パスカル言語バインディングを使用したいと思います。私はそれらを構築し、Python 2.7にrpmパッケージをインポートしようとしたときしかし、私はこのエラーを取得する:

$ 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

これらのコマンドを使用して自作して、私は再インストールのPythonバインディングrpmパッケージをビルドするには:

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 

./configureコマンドは自作が添付--with-pythonスイッチを使用したものと同じものです。

MacOSでPython言語の開発を行うために、クロスプラットフォームのrpm5.orgベースのソースコードを使用するにはどうすればよいですか?

+0

近くrpmio/rpmsql.cを参照してください。 – pvg

答えて

1

エラーは、sqlite3とrpmがbrewでOS/Xでどのように構築されているかによって異なります。

_sqlite3_enable_load_extensionを追加するには、 を追加するか、_sqlite3_enable_load_extensionの必要性を除去するためにRPMをパッチすることができます。

RPMにパッチを適用した場合、私はそれは全く別に配布はないと思うライン2881.

関連する問題