Saturday, October 9, 2021

how to make app for debian in python?

 <1>

files and folders you should make (replace {app} with ur app name) :

|-> {app}.desktop

|-> main.py

|-> setup.py

|-> ui.glade (optional, you might want to make all layout in main.py file)

|->debian (folder):

|     |-> compat

|     |-> control

|     |-> rules

|     |-> changelog

|     |-> copyright (if needed)

|-> po (folder)

|     |-> (literally nothing, fill this if you want translations)

</1>

<2>

 fill files:

----------

/{app}.desktop :

[desktop entry]

Name={app name}

Comment={app description}

Exec=main.py

Terminal=false

Type=Application

Categories=GNOME;GTK;{your app tag, for example - game or util}

StartupNotify=false

----------

setup.py :

from distutils.core import setup


setup(name = "{your app name}",

    version = "{your app version, recommended in numbers}",

    description = "{your app description}",

    author = "{your name}",

    author_mail = "{your mail, mostly used for bug reports}",

    license = "{your app license}",

    scripts=[main.py],

    data_files = [ ("lib/{app name}", ["ui.glade"]), ("share/applications", ["{app name}.desktop"])

)])

-----------

(from now only debian folder)

control

Source: main.py

Maintainer: {your mail} {your name}

Section: main

Priority: optional

Standards-Version: 4.0.0

Build-Depends: debhelper (>= 9) {and here other dependencies}

Package: main.py

Architecture: any

Depends: python-gi {and here other python- related dependencies}

Description: {here place short description}

 {and here place

 long description,

 remember to type all description with

 spaces at start of lines !!!}

-----------

rules (replace spaces with tabs, it wasnt posible to add tabs in google blogger =p) :

#!/usr/bin/make -f

 

%:

    dh $@

override_dh_auto_install:

    python setup.py install --root=debian/main.py --install-layout=deb --install-scripts=/usr/bin/ 
    override_dh_auto_build:

------------

compat (no it isnt a joke) :

9

------------

changelog and copyright files -> use this instructions -> https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#changelog (and yes, here im basing on it)

</2>

<3>

how to make glade.ui file?

a) make it using gui method :

     |=> glade app (gtk 3 and lower)

     |=> cambalache (gtk 3 and 4)

b) code it using xml (docs here [i know its hard to find ;) ] => https://docs.gtk.org/gtk4/class.Builder.html )

</3>

<4>

code python :

basics -> (learn python lol, i recommend w3c tutorials =p) 

not basics -> tutorial - https://python-gtk-3-tutorial.readthedocs.io/en/latest/

full reference -> https://lazka.github.io/pgi-docs/Gtk-3.0/index.html#

</4>

<5>

HAPPY CODING =P

<5>

1 comment:

hacknorris said...

yes, i'll use it to make this game im saying about =p

Post a Comment