为 debian 打包 python 程序的简单、直接的方法? [英] easy, straightforward way to package a python program for debian?

查看:39
本文介绍了为 debian 打包 python 程序的简单、直接的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在为 python 和 debian 分发工具的迷宫中导航时遇到了麻烦;cdbs, debhelper, python-support, python-central, blah blah blah ..

i'm having trouble navigating the maze of distribution tools for python and debian; cdbs, debhelper, python-support, python-central, blah blah blah ..

我的应用程序是一个相当简单的应用程序 - 一个单独的 python 包(包含模块和 __init__.py 的目录),一个用于运行程序的脚本(script.py) 和一些图标 (.png) 和菜单项 (.desktop 文件).

my application is a fairly straightforward one - a single python package (directory containing modules and a __init__.py), a script for running the program (script.py) and some icons (.png) and menu items (.desktop files).

在不使用上面列出的无意义工具的情况下,如何从头开始构建一个简单、干净的 .deb 文件?

from these files, how can i construct a simple, clean .deb file from scratch without using the nonsensical tools listed above?

我主要针对 ubuntu,但如果软件包在直接 debian 上工作,我会喜欢它

i'm mainly targeting ubuntu, but would like it if the package worked on straight debian

推荐答案

python-stdeb 应该适合你.它在 Debian 测试/不稳定和 Ubuntu(从 Lucid 开始).apt-get install python-stdeb

python-stdeb should work for you. It's on Debian testing/unstable and Ubuntu (Lucid onwards). apt-get install python-stdeb

它与其说是一种捷径,不如说是一种尝试生成尽可能多的源代码包的工具.它实际上可以构建一个既能正常工作又几乎符合标准的包.如果您希望您的软件包符合包含在 Debian、Ubuntu 等中的质量标准,您需要填写 debian/copyright 等文件.

It is less a shortcut method than a tool that tries to generate as much of the source package as possible. It can actualy build a package that both works properly and is almost standards compliant. If you want your package to meet the quality standards for inclusion in Debian, Ubuntu, etc you will need to fill out files like debian/copyright, etc.

尽管人们声称 cdbs 真的很简单,但我想指出,尼克提到的规则文件可以很容易地用 debhelper7 完成.不要忘记,dh7 的定制比 cdbs 容易得多.

As much as people claim cdbs is really easy, I'd like to point out that the rules file Nick mentioned could easily have been done with debhelper7. Not to forget, dh7 can be customized far more easily than cdbs can.

#!/usr/bin/make -f
%:
    dh $@

注意:在提交给 Debian 之前,您应该检查您的软件包是否符合 Debian 政策、Debian Python 政策等.您实际上需要为此阅读文档 - 没有捷径.

Note: You should check whether your package meets the Debian Policy, Debian Python Policy, etc before you submit to Debian. You will actually need to read documents for that - no shortcut.

这篇关于为 debian 打包 python 程序的简单、直接的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆