Home > Uncategorized > Creating DEB installer files from python source

Creating DEB installer files from python source

How create a deb file from python source? its easy lets make it with 6 simple steps.

We need to add to main python script following lines:


import os

if os.path.isdir('modules'): MODULES_PATH = os.path.join(os.curdir, 'modules')
else: MODULES_PATH = '/usr/share/<projectname>/modules/'

Each step need to run command in console then lets open console and….

1) mkdir myproject
2) mkdir myproject/DEBIAN
3) touch myproject/DEBIAN/control
4) gedit myproject/DEBIAN/control
and paste to this file

Package: packagename
Version: 1.4.24-4
Section: tools
Priority: optional
Architecture: i386
Depends:
Suggests:
Conflicts:
Replaces:
Installed-Size: 76
Maintainer: your name <email@domain.com>
Description: <desctiptions>

5. Create folders structure for your application inside your project directory in example:

myprojct/usr/
myprojct/usr/bin/    (put here your script or binary files)
myprojct/usr/share/
myprojct/usr/share/<projectname>/modules/    (put here your modules)
myprojct/usr/share/doc/<projectname>/    (put here your documentation)

and others folder if needed. Replace <projectname> with your project name.

6. Build deb file:

dpkg -b myproject

Deb file is ready to install.

Advertisements
Categories: Uncategorized Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: