Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 1101  / 1 Year ago, fri, may 26, 2023, 2:21:16

I write a pygtk app and want to make a deb pkg for it.



$ tree WebPad/
WebPad/
|-- jspad
| |-- __init__.py
| |-- main.py
| |-- t.py
|-- pixmaps
| |-- c.png
| |-- run.png
| `-- webpad.png
|-- README
|-- run.py
`-- templates
`-- webpad.tpl

3 directories, 19 files


Do I need to change the directory layout?


More From » deb

 Answers
5

First of all, you need to create a setup.py file using distutils in the root directory of your project. It should contain text similar to the following:



#!/usr/bin/env python

from distutils.core import setup
from glob import glob

setup(name = "WebPad",
version="0.1",
author="znetor",
packages=["jspad"],
data_files=[('share/webpad/pixmaps', glob("pixmaps/*"), ('share/webpad/templates', ['templates/webpad.tpl'])],
scripts=['run.py'])


And you should also create a MANIFEST.in file:



recursive-include pixmaps *
recursive-include templates *


One you've done that, you can run various commands on the terminal to distribute your project:



chmod +x setup.py
sudo ./setup.py install # installs your project to /usr/local
./setup.py sdist # creates a source distribution in dist/


The last command is the one we're interested in. Once you've got a source distribution with a distutils setup.py script, you can then follow the Python packaging guide for Ubuntu. Basically, it involves creating a debian/ directory in the root of your project with various bits of information and running debuild.



I wrote a tutorial on how to do this a while ago, some of it is not best practise, but it will help you understand a few concepts.


[#44879] Sunday, May 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leadprogres

Total Points: 298
Total Questions: 114
Total Answers: 139

Location: Samoa
Member since Mon, Nov 8, 2021
3 Years ago
;