maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Could someone help me create a deb file for my app? (https://talk.maemo.org/showthread.php?t=28553)

Munk 2009-04-26 05:57

Could someone help me create a deb file for my app?
 
Hi could someone help me make a deb file for my python based app? I know Qwerty12 has helped a few people with this. My app consists of the following caveats:
  1. Python based app for a project I registered in the Garage
  2. A data directory containing just over 100 supporting files
  3. A data directory for WAV files, by default this should be "\media\mmc2"
  4. The WAV data directory could hold a total of about 10 or more megs.

I'm not releasing the source YET but instead am using a compiled Python file ".pyc". Not until I get a few more bugs wiped out.

Anyways, whoever is interested, please let me know and I will send you everything to get it going.

Pics of the app are to be found in the garage here:
https://garage.maemo.org/projects/traveller/

I'll announce the app once it is uploaded.

dzon@shaw.ca 2009-04-26 06:07

Re: Could someone help me create a deb file for my app?
 
I use pypackager on my N800 to do the packaging. You just need to setup the directory structure like you want it and it build the deb for you. Very simple.

qole 2009-04-26 06:41

Re: Could someone help me create a deb file for my app?
 
PyPackager is in Chinook Extras, if you're wondering.

I use it for my projects, too.

If you want more help, contact Jeremiah, our Debmaster. It's his job to help people with Maemo packaging issues.

Munk 2009-04-26 19:38

Re: Could someone help me create a deb file for my app?
 
dzon and qole,

Is there a more detailed step by step tutorial on PyPackager than this one?

http://wiki.maemo.org/PyPackager

It sounds like it's the answer but when it gets to asking about items such as these, I'm not sure what it's really looking for:

  • Binaries Folder = This is Python so is there really a binary? Or is this where I put supporting binaries such as .png files, etc.?
  • Sources Folder = I believe this is where I would point to my primary python folder. But, why is it completely on the other side of the tabs menu?
  • Build-Depends = Is this just a manually typed field where I specify depends upon Python 2.5, PyGame, etc? Wait, no it can't be because that is the "Depends" field.
  • Upload tab = I imagine this will send it up to garage.maemo.org. But, where do I get my GPG email key?
  • Icon Url = So, I have to point to an external URL to use an icon?

Then the buttons at the bottom are a bit cryptic with two of them looking exactly the same. Also, one is save but then what is the disk icon with the pencil on it? The Help-About doesn't show anything either.

Any help would be appreciated.

BrentDC 2009-04-26 19:57

Re: Could someone help me create a deb file for my app?
 
Just of note, PyPackager-made debs cannot be uploaded to the extras-* repos because the autobuilder won't except them.

twaelti 2009-04-26 20:02

Re: Could someone help me create a deb file for my app?
 
Pypackager is the easiest way to setup a deb in some way.
Once you know it work, you can then use py2deb to create something suitable for extras-* repositories. Check the wiki - there is an article about it.

jolouis 2009-04-27 15:33

Re: Could someone help me create a deb file for my app?
 
Py2Deb is pretty easy to use too, you just need to make sure you setup your config file properly as per the wiki... the only downside to it is that it's not very good and giving you useful errors, so if it doesn't work (or packages nothing) a lot of the time you have to hack up the code to find out where you went wrong... (things like wrong paths, missing a slash, etc)

Anunakin 2009-09-09 12:24

Re: Could someone help me create a deb file for my app?
 
I put all files on a folder like DEBFILES,
and create a DEBIAN folder inside it, with a control file like it:
Code:

Package: cmake
Priority: optional
Section: dev
Installed-Size: 29M
Maintainer: http://www.cmake.org/
Architecture: armel
Version: 2.6.4
Depends: libc6
Description: Cross platform Make

Next, I build .deb...
deb -b DEBFILES package-NUMVERSION.deb

qole 2009-09-09 16:25

Re: Could someone help me create a deb file for my app?
 
Hey, Khertan quietly added a section to the py2deb wiki article about how to add your pre / post install scripts to the build_myapp.py program. I'm not entirely clear on how this works (enclose the entire script in triple quotes? That's all?) but that is good news. I can probably use that script to package my Easy Debian stuff now... And with Fremantle coming, that's something I want to do.

jeremiah 2009-09-09 16:31

Re: Could someone help me create a deb file for my app?
 
I'd be happy to help too! You can fire off an email or we can talk here, or even on IRC at #maemo.

It looks like you have already got some good advice. :)

Jeremiah

jolouis 2009-09-09 19:21

Re: Could someone help me create a deb file for my app?
 
Quote:

Originally Posted by qole (Post 324334)
Hey, Khertan quietly added a section to the py2deb wiki article about how to add your pre / post install scripts to the build_myapp.py program. I'm not entirely clear on how this works (enclose the entire script in triple quotes? That's all?) but that is good news. I can probably use that script to package my Easy Debian stuff now... And with Fremantle coming, that's something I want to do.

Postinst/preinst/etc are very easy, all you need to do is make sure that your scripts are set to executable and stored somewhere, then add them directly as arguments to the p object. For example, in flipClock I've got:
Code:

p.postinst = "control/postinst"
the extra code in the wiki just seems to be to make sure that the script gets the execute permission set on it; if you've already done that first then you don't need the extra stuff...

qole 2009-09-09 19:38

Re: Could someone help me create a deb file for my app?
 
the "control/postinst" corresponds to a text file called "postinst" in a "control" directory?

jolouis 2009-09-11 13:57

Re: Could someone help me create a deb file for my app?
 
Quote:

Originally Posted by qole (Post 324442)
the "control/postinst" corresponds to a text file called "postinst" in a "control" directory?

Yup exactly.

qole 2009-09-28 06:24

Re: Could someone help me create a deb file for my app?
 
Bad news, guys.
When using Maemo py2deb, putting
p.postinst = "control/postinst"
in my script puts a literal string "control/postinst" as my postinst script, not the contents of that file.

jolouis, what version of py2deb are you using? I'm using the one from Diablo Extras.

The good news is that the control scripts are the only broken thing with the package... Oh, and the .png file for my icon doesn't seem to show up in App Manager...

qole 2009-09-28 07:03

Re: Could someone help me create a deb file for my app?
 
OK, update.

This worked for me. I'll update the wiki when I get a chance.

Code:

    qolepostinst = open("control/postinst", "r")
    p.postinstall=qolepostinst.read()
    qolepostrm = open("control/postrm", "r")
    p.postremove=qolepostrm.read()

I had to look that up, but it works, so I'm happy.

Khertan 2009-09-28 07:27

Re: Could someone help me create a deb file for my app?
 
with py2deb i use the postinstall like that :

p.postinstall="""#!/bin/sh
chmod +x /usr/bin/pygtkeditor"""

as this way i keep all the package information in my make.py script

qole 2009-09-28 07:53

Re: Could someone help me create a deb file for my app?
 
Khertan, any hints as to why the p.icon isn't working in the App Manager? I'm using the full path, should I be using just a relative path? Does the icon need to be a certain size or something?

fredoll 2009-09-28 07:59

Re: Could someone help me create a deb file for my app?
 
shouldn't you use the uuencode (text) version of the icon ?

qole 2009-09-28 17:54

Re: Could someone help me create a deb file for my app?
 
Py2Deb should do the uuencode for you, shouldn't it?

qole 2009-11-17 21:58

Re: Could someone help me create a deb file for my app?
 
Just a bump to an old thread:

Thanks to Khertan and twaelti (and thp for pushing me), I have managed to use py2deb to package all of my stuff for Extras.

You can browse my source in my project's git repository, and see what my py2deb build scripts look like.


All times are GMT. The time now is 06:20.

vBulletin® Version 3.8.8