【问题标题】:Making a .deb file from a Python file从 Python 文件制作 .deb 文件
【发布时间】:2011-01-22 21:56:34
【问题描述】:

在关注http://ubuntuforums.org/showthread.php?t=406069 之后,我开始知道如何制作一个 .deb 文件,该文件会自动将 Python 文件作为可执行文件放置到 /usr/bin 目录中。我希望我的程序具有类似“grep”的结构。我应该使用哪些库,程序的结构应该是什么。

在图书馆,我必须使用Get::Opt library吗?

“grep 结构”是指以下内容:

program-name func-name -a arg1 --b arg2 should work
man program-name should open the man page
and
program-name should open an in interactive help shell...

【问题讨论】:

  • 这实际上与 perl 编程有关,而不是任何软件包。另外,我真的建议正确学习打包——制作一个兼容 cpan (perldoc.perl.org/ExtUtils/MakeMaker.html) 或兼容 pypi (docs.python.org/distutils) 的包。然后通过 debuild/pdebuild(debian.org/doc/debian-policyjoey.kitenet.net/talks/debhelper/debhelper-slides.pdf)创建一个 deb。一开始需要做很多工作,但它会在几周/几个月后为您省去很多麻烦。
  • 如果我必须为 python 做同样的事情呢??
  • cpan 兼容是指与 perl 环境很好交互的 perl 包。 Pypi 是 python 包的类似服务。如果你的 perl 包中有标准的Makefile.pl 或你的 python 包中有标准的setup.py,debhelper 会做“正确的事”。来自“不是你爷爷的 debhelper”的%: dh $@ sn-p 应该是 debian 部分所需的全部内容。
  • 关于选项 - perl 有 Getopt::Longsearch.cpan.org/dist/Getopt-Long/lib/Getopt/Long.pm 等),python 有 optparse(或 2.7+ 中的 argparse docs.python.org/library/argparse.html#module-argparse
  • 我正在开发的应用程序不一定是 python 模块,它是我项目某些部分的 api。无论如何,我想听听你所说的,希望能得到一些好的解决方案+大量的学习。

标签: python package eps deb


【解决方案1】:

http://svn.debian.org/wsvn/python-modules/packages 有很多 Debian 打包 Python 包的示例。许多项目包括手册页支持,例如http://svn.debian.org/wsvn/python-modules/packages/python-paver/trunk/debian/

【讨论】:

  • 第二个链接现在好像坏了。
  • 第一个链接也坏了
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-01
  • 2013-05-30
  • 1970-01-01
  • 2010-12-07
  • 1970-01-01
相关资源
最近更新 更多