This is the old SliTaz forum - Please use the main forum.slitaz.org

Convert deb rpm how to?
  • slicelslicel October 2009
    Old forum cache-



    #1 2009-05-22 16:07:52

    fireflyoo
    Member

    [script]deb2tazpkg

    filename: deb2tazpkg
    description:as the name,switch the debian package(deb) to slitaz package(tazpkg).
    Code:

    #!/bin/sh
    dpkg-deb -e $1 /tmp
    package=$(grep '^ *Package' /tmp/control)
    package=$(echo ${package##*:})
    version=$(grep '^ *Version' /tmp/control)
    version=$(echo ${version##*:})
    descrip=$(grep '^ *Description' /tmp/control)
    descrip=$(echo ${descrip##*:})
    file="$package-$version"
    file="$package-$version"
    mkdir -p $file/fs/
    dpkg-deb -x $1 $file/fs
    echo "\
    # SliTaz package receipt.
    PACKAGE=\"$package\"
    VERSION=\"$version\"
    CATEGORY=\"free\"
    SHORT_DESC=\"$descrip\"
    MAINTAINER=\"tux@slitaz.org\"
    DEPENDS=\"\" " > $file/receipt
    rm /tmp/*
    tazpkg pack $file

    usage example
    Code:

    deb2tazpkg example.deb

    Offline

    #2 2009-05-23 21:42:40

    Linea
    Contributor

    Re: [script]deb2tazpkg

    Hi fireflyoo

    I just tried this with Picasa 3: http://picasa.google.com/linux/download.html

    And it worked!

    Paul

    Offline

    #3 2009-05-23 22:58:12

    MImoza
    Member

    Re: [script]deb2tazpkg

    a package for this will be very usefull for everybody wink

    Offline

    #4 2009-05-23 23:36:09

    Pankso
    Contributor

    Re: [script]deb2tazpkg

    Hi,

    Nice touch fireflyoo! I also did a similar script a few time ago. I think a command 'deb2taz' in Tazpkg will be welcome

    http://labs.slitaz.org/projects/list_files/tazpkg

    - Christophe

    Offline

    #5 2009-05-24 10:03:16

    Linea
    Contributor

    Re: [script]deb2tazpkg

    Hi

    Any chance of a rpm2taz[pkg] smile

    Paul

    Offline

    #6 2009-05-24 16:23:44

    Bob le Pointu
    Contributor

    Re: [script]deb2tazpkg

    Any chance to see the same script without using dpkg-dev ?

    Offline

    #7 2009-05-24 18:18:53

    davesurrey
    Member

    Re: [script]deb2tazpkg

    Sorry but am I missing something?

    I thought that a deb package is used with a package manager (apt, or synaptic if you prefer a GUI). The package manager downloads the deb from a specific repository eg Debian Lenny or Ubutnu Ibex. Therefore it knows what libraries etc should already exist within that specific distro and what additional dependencies need to be downloaded. And then it automatically downloads them.

    And in a similar way a tazpkg is downloaded to a specific Slitaz system and thereby knows what dependencies are needed for that app to work on that specific distro and auto downloads them.

    Surely downloading any deb package from any debian/ubuntu/whatever source to slitaz won't necessarily result in the correct dependencies being downloaded in the same way they would if it were a "real" tazpkg with the correct receipt??

    Or am I wrong?

    edited: to correct typos

    Last edited by davesurrey (2009-05-24 18:23:00)

    Offline

    #8 2009-05-24 18:26:31

    Bob le Pointu
    Contributor

    Re: [script]deb2tazpkg

    You're right, some packages will work, other won't because SliTaz packages names are not always the same as other distros.

    Offline

    #9 2009-05-24 18:47:16

    davesurrey
    Member

    Re: [script]deb2tazpkg

    Hi Bob,
    Yes but I think there is something more fundamantal.

    Let's take an example of an application A which needs dependencies B, C and D in Debian Etch.

    If Debian Etch base install has B already installed then it is necessary for the package installer only to automatically download C and D as well as A.

    But if a base install of Slitaz includes C but not B and D then it is necessary for SliTaz package manager to download A , B and D and not C.

    How would that script work it out? I can't see it would be able to do so.

    Am I correct or perhaps I don't understand it correctly?

    dave

    Offline
  • slicelslicel October 2009
    #10 2009-05-25 20:29:23

    bellard
    Contributor

    Re: [script]deb2tazpkg

    Hi,

    Christophe wrote:

    I think a command 'deb2taz' in Tazpkg will be welcome

    Or tazpkg convert ? http://hg.slitaz.org/tazpkg/rev/a041e442f730

    Linea wrote:

    Any chance of a rpm2taz[pkg] smile

    Yes: http://hg.slitaz.org/tazpkg/rev/f91e0e647f54

    -pascal

    Offline

    #11 2009-05-25 22:36:44

    firmit
    Member

    Re: [script]deb2tazpkg

    I like the idea very much. But - there's always a but - I would like to keep the fs so I can modify the reciept before packing the tazpkg. Maybe add an option to this - something like:
    Code:

    tazpkg convert procps.deb -y|n

    where -y|n (y default) is for actually packing the fs. Default tmp_dir, I assume could be in the folder you are in. This way, the user can modify the reciept before packing.

    Just a thought - for now, I use the OP script.

    Last edited by firmitz (2009-05-25 22:38:17)
    --firmit

    Offline

    #12 2009-05-25 23:02:01

    bellard
    Contributor

    Re: [script]deb2tazpkg

    Hi,

    You can do:
    Code:

    tazpkg convert procps.deb
    tazpkg extract procps-xx.tazpkg
    vi procps-xx/receipt
    tazpkg pack procps-xx

    -pascal

    Offline

    #13 2009-05-25 23:21:36

    Linea
    Contributor

    Re: [script]deb2tazpkg

    Thanks Pascal cool

    Paul

    Offline

    #14 2009-05-26 20:06:04

    firmit
    Member

    Re: [script]deb2tazpkg

    Nice smile
    --firmit

    Offline

    #15 2009-06-03 14:24:29

    davesurrey
    Member

    Re: [script]deb2tazpkg

    firefly00/Linea/anyone ??

    I have tried this script on 3 machines now and with both v2 and cooking. Everytime it has broken my system when I try to use it to install picasa-beta !!!

    I cut the script out of the forum and pasted using leafpad into a file which i called deb2tazpkg. I put the script in /usr/bin, changed permissions so I could execute it, then ran it as root from terminal.

    Code:

    # deb2tazpkg /home/tux/picasaXXX.deb

    It does the converstion but gives me a blank desktop...only menu and panel remain. If, for example, I select Menu>System Tools >Package manager GUI then I get the login box but then nothing is displayed.
    I have done a recharge and upgrade from terminal but no difference.

    Linea you said you were successfull? Cooking or Stable2 ? Can you explain exactly what you did that was differnt to me?

    Anyone any ideas what caused it and how to get this back?


    This has really mssed things up.

    dave

    Offline

    #16 2009-06-03 20:24:37

    firmit
    Member

    Re: [script]deb2tazpkg

    I believe he referred to actually converting the debian package to tazpkg.
    For you to successfully run picasa, you would need to install some other tools as well. Though, I have not succesfully done this myself.
    --firmit

    Offline

    #17 2009-06-03 20:59:42

    Linea
    Contributor

    Re: [script]deb2tazpkg

    OK, here's what I did:

    As tux: copy and paste script to file named deb2tazpkg and place in /home/tux; then
    Code:


    $ chmod +x deb2tazpkg

    download picsasa .deb: http://dl.google.com/linux/deb/pool/non … t_i386.deb and place in /home/tux; then
    Code:

    $ ./deb2tazpkg picasa*.deb

    this should produce the .tazpkg file; then as root:
    Code:

    # tazpkg install picasa*.tazpkg

    Note there's no desktop entry; so in a terminal type:
    Code:

    picasa

    Paul

    Offline

    #18 2009-06-03 22:29:59

    firmit
    Member

    Re: [script]deb2tazpkg

    I tried the same thing, it did not work.
    I tried it again - pull my finger.... - wait for it - what do you know! It runs!

    I do have a flush of messages in my terminal though - stat is not correctly used. I remember previously that also top was not correctly used.
    --firmit

    Offline

    #19 2009-06-03 23:23:39

    davesurrey
    Member

    Re: [script]deb2tazpkg

    Yes that worked for me.
    Many thanks Linea.
    The difference between what you and I did is that I ran deb2tazpkg as root not user tux.
    Thanks
    Dave

    Offline

    #20 2009-06-07 04:36:19

    spork
    Member

    Re: [script]deb2tazpkg

    The only thing I've noticed is that it leaves a directory behind. What if you want to just convert it? Could your script delete the folder after it's done (if you don't put an argument flag first)?

    Offline
  • slicelslicel October 2009
    #21 2009-06-07 09:17:44

    firmit
    Member

    Re: [script]deb2tazpkg

    spork wrote:

    The only thing I've noticed is that it leaves a directory behind. What if you want to just convert it? Could your script delete the folder after it's done (if you don't put an argument flag first)?

    Use tazpkg convert pkg.deb instead then.
    --firmit

    Offline

    #22 2009-06-07 12:45:07

    davesurrey
    Member

    Re: [script]deb2tazpkg

    Away from home at the moment so can't check on my PC but could someone explain the difference between the different scripts mentioned in this thread.
    deb2tazpkg
    deb2taz
    tazpkg convert

    Thanks

    Offline

    #23 2009-06-07 13:07:02

    firmit
    Member

    Re: [script]deb2tazpkg

    My view of things:

    .deb, .rpm, .tazpkg is just a container of files for their own package manager. Each file type also contains a description or reciept which is recognized by its respective package manager.

    deb2tazpkg was created to convert a debian package to tazpkg. This script keep the fs-structure. It is not officially a part of Slitaz.

    Then this script-functionality was introduced in Slitaz as tazpkg convert, which handles both .rpm in addition to .deb. This functionality does not keep the fs. If you want to modify the reciept in the automatically created .tazpkg, you need to extract the package first, and repack it with the modified reciept. This is almost always necessary for dependencies and pre/post scripts.

    Last edited by firmitz (2009-06-07 13:10:44)
    --firmit

    Offline

    #24 2009-06-07 17:16:11

    davesurrey
    Member

    Re: [script]deb2tazpkg

    Hello firmitz,
    Thanks for your explanation. I think I understand it but am not too sure.
    Is it better to keep the fs or to change it to better integrate into Sltitaz?
    That is, is it better to use tazpkg convert than deb2tazpkg?
    Thanks for your help so far
    Dave

    Last edited by davesurrey (2009-06-07 17:16:52)

    Offline

    #25 2009-06-07 18:13:07

    firmit
    Member

    Re: [script]deb2tazpkg

    That's like deciding which beer to drink first!
    Try them both out and see which one you like the best! smile
    --firmit

    Offline

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social