如何使用dh-virtualenv构建Debian软件包?规则文件不与fakeroot一起使用

时间:2016-08-23 02:28:56

标签: debian virtualenv dpkg fakeroot

我正在尝试用Spotify的dh-virtualenv debian包助手构建一个deb包。

我收到错误消息: 在运行dpkg-buildpackage -us -uc

(venv) $ dpkg-buildpackage -us -uc
dpkg-buildpackage: source package ese-xlr8r
dpkg-buildpackage: source version 1.4.7
dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Special Characters <casDTV_SpecChars@echostar.com>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build active
 fakeroot debian/rules clean
: No such file or directory
'.  Stop. No rule to make target `
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2

我不知道为什么它找不到规则文件。我可以在没有fakeroot的情况下手动运行文件并且它可以工作(或者至少它传递了初始错误):

: command not found
: no such job
   dh_testdir
   dh_auto_clean
pyversions: missing X(S)-Python-Version in control file, fall back to debian/pyversions
pyversions: missing debian/pyversions file, fall back to supported versions
/home/echostar/projects/XLR8R/active/venv/local/lib/python2.7/site-packages/setuptools/dist.py:364: UserWarning: Normalizing '1.4.10
' to '1.4.10'
  normalized_version,
running clean
'build/lib.linux-x86_64-2.7' does not exist -- can't clean it
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
   dh_clean

因为您没有看到“没有此类文件或目录”错误。我可以使用 fakeroot

重现错误
(venv) $ fakeroot debian/rules
: No such file or directory
'.  Stop. No rule to make target `

这是我的规则文件:

(venv) $ cat debian/rules
#!/usr/bin/make -f

%:
      dh $@ --with python-virtualenv

我错过了什么吗?

注意:'venv'是我的virtualenv的名字并且是活跃的。

更新08/23/2016 我将我的代码复制到我们的数据中心中的另一个VM,使用稍微旧的Ubuntu并重新安装所有内容并运行buildpackage命令。这次它更进一步,但最后仍然是类似的错误。我不会发布整个buildpackage日志,但这里是最后的要点:

New python executable in debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/python
Installing setuptools, pip...done.
Downloading/unpacking behave==1.2.5 (from -r ./requirements.txt (line 1))
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement behave==1.2.5 (from -r ./requirements.txt (line 1))
Cleaning up...
No distributions at all found for behave==1.2.5 (from -r ./requirements.txt (line 1))
Storing debug log for failure in /home/echostar/.pip/pip.log
Traceback (most recent call last):
  File "/usr/bin/dh_virtualenv", line 106, in <module>
    sys.exit(main() or 0)
  File "/usr/bin/dh_virtualenv", line 86, in main
    deploy.install_dependencies()
  File "/usr/lib/python2.7/dist-packages/dh_virtualenv/deployment.py", line 172, in install_dependencies
    subprocess.check_call(self.pip('-r', requirements_path))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/echostar/dan/xlr8r/debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/python', '/home/echostar/dan/xlr8r/debian/ese-xlr8r/usr/share/python/ese-xlr8r/bin/pip', 'install', '--log=/tmp/tmpNybuqh', '-r', './requirements.txt']' returned non-zero exit status 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2

我不知道它为什么用python前缀调用pip,如:     python pip install -r ./requirements.txt

Pip不是一个像这样被调用的python文件。 dh-virtualenv中可能存在的错误?

1 个答案:

答案 0 :(得分:2)

在构建Python virtualenv时,pip无法满足项目的某个依赖项:

  

没有找到针对behave = = 1.2.5

的发行版

这将列在项目的requirements.txt文件中。