2008年1月8日火曜日
setuptools and rpm
> python setup.py bdist_rpm
するとDistributionNotFoundがraiseされるので、どうしたものか。しかもほとんどいじっていないTurboGearsのProjectのsetup.pyからだ。
googleでしらべてみたら、requires.txtを見ていろいろするものなようなので、とりあえずrequires.txtを眺めてみる。
TurboKid-1.0.4-py2.4.egg-info/requires.txt
の中で、
kid >= 0.9.6
となっていてここの処理をしようとしておかしくなるようだ。
> rpm -q -a | grep kid
python-kid-0.9.6-l.el5.rf
python-turbokid-1.0.4-l.el5
なので依存関係は満たされるはずだが、実際にはそうならない。requires.txtがおかしいのだろうか?
kidのrequires.txtの中身をコメントアウトすると動くが、正しい直し方ではなさそう。
TurboGearsのrequires.txtの中身とrpmの名前を比較する限りよくわからない。pythonのimport時のモジュール名じゃないといけないのかな?
う~~ん。ipythonからimportしてしらべてみると、
import turbogearsがそもそも機能していない。configがimportできんといわれる。
登録:
コメントの投稿 (Atom)
9 件のコメント:
とりあえず、requires.txtを変更。
だが、pyc/pyo問題再発。なので.pydistutils.cfgに
[install]
optimize=1
を追加。
しかしegg-info下のPKG-INFOやらSOURCES.txtが多重にリストされるやら、start-xxx.pycがリストされないやらが問題になる。
う~~。
正確に書くと
setup.pyの中の
setup(
...
scripts=['hogehoge.py'],
...
)
のhogehoge.pyに関してhogehoge.pycとhogehoge.pyoが%installで実行されるpython setup.py install --recored=INSTALLED_FILESのINSTALLED_FILESに入っていなくてrpmbuildがエラーをはくのだ。
Ian Bicking on setuptools
これと同じ問題だと思われる。
なんだかわからんが、setupに渡す名前を変更したら、前のscriptの名前を忘れてくれた。
bugっぽい・・・。
/usr/lib64/python2.4/distutils/build_py.py
line 305
self.run_command('sdist')
source = sdist.get_archive_files()[0]
source_dir = rpm_dir['SOURCES']
self.copy_file(source, source_dir)
/usr/lib64/python2.4/distutils/command/sdist.py
line 344
def prune_file_list (self):
"""Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp, or it aborted)
* any RCS, CVS and .svn directories
"""
build = self.get_finalized_command('build')
base_dir = self.distribution.get_fullname()
self.filelist.exclude_pattern(None, prefix=build.build_base)
self.filelist.exclude_pattern(None, prefix=base_dir)
self.filelist.exclude_pattern(r'/(RCS|CVS|\.svn)/.*', is_regex=1)
たぶんこのコードで取っているファイルリストが変なのだろう・・・。
bdist_rpmはsdistを呼んでいて、そのなかでarchiveが生成されている。archiveされた中身を見る限り正しくfile listが作られている。
となるとfile listに含まれないコードがなぜかinstallに到達していることになる??。
/var/tmpのキャッシュが原因
コメントを投稿