简体   繁体   English

使用Python脚本制作deb软件包时出现问题

[英]Problems making a deb package out of a Python script

I have read a lot of guides about creating a .deb package, but so far I haven't been able to succeed. 我已经阅读了很多有关创建.deb包的指南,但是到目前为止,我还没有成功。 I'm running Ubuntu 14.04 and the location of the tar.gz file and .py files are in: 我正在运行Ubuntu 14.04,tar.gz文件和.py文件的位置在:

/home/nyoa/trafgen6/trafgen6-1.0#

The folder contains following files: 该文件夹包含以下文件:

root@nyoa-VirtualBox:/home/nyoa/trafgen6/trafgen6-1.0# ls
DEBIAN  trafgen6-1.tar.gz  trafgen6.py

DEBIAN is folder where the files guiding the packaging should be. DEBIAN是用于指导包装的文件所在的文件夹。 My question is what do I do next to achieve the following result: 我的问题是我接下来要做什么才能达到以下结果:

Python script is installed so it can be started by only typing trafgen6 on command line and the name of the package is Trafgen6 (For some reason it is only Trafgen when I have tried to do it previously). 已安装Python脚本,因此可以通过仅在命令行上键入trafgen6来启动它,并且包的名称为Trafgen6(出于某种原因,当我之前尝试过时,它仅为Trafgen)。 The package should also depend on PyQt4 and Qwt. 封装也应取决于PyQt4和Qwt。

The package isn't meant for public release yet so I don't need to worry about licenses and all the package details to be correct. 该软件包尚不打算公开发布,因此我不必担心许可证和所有软件包详细信息都是正确的。 I only need to be able to install it easily. 我只需要能够轻松安装它。

Thank you in advance for any advice you can give 预先感谢您提供的任何建议

Assuming the metadata inside DEBIAN is correct, and the install simply requires copying the files to the appropriate locations, all you need is to set up your fs hierarchy properly. 假设DEBIAN中的元数据正确,并且安装仅需要将文件复制到适当的位置,您所需要做的就是正确设置fs层次结构。

Should look like 应该看起来像

DEBIAN/control
usr/bin/trafgen6 -- python script which sets os.cwd, imports and launches program
usr/lib/python<version>/dist-packages/trafgen6/ -- directory containing all trafgen6 associated files (perhaps try unpacking your .gz here.

When you install the package, it will copy them to / To assemble the debian package, go into /home/nyoa/trafgen6/trafgen6-1.0# and run dpkg-buildpackage . 安装软件包时,它将复制到/组装debian软件包,进入/home/nyoa/trafgen6/trafgen6-1.0#并运行dpkg-buildpackage。 .. It will kick out the debian package in /home/nyoa/trafgen6. ..它会在/ home / nyoa / trafgen6中删除debian软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM