简体   繁体   中英

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. I'm running Ubuntu 14.04 and the location of the tar.gz file and .py files are in:

/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. 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). The package should also depend on PyQt4 and 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.

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 . .. It will kick out the debian package in /home/nyoa/trafgen6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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