Author Topic: How Do I Make An Ipk?  (Read 4905 times)

kurochka

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
How Do I Make An Ipk?
« on: November 09, 2006, 05:20:15 pm »
You can call me a novice Linux user; however, it is not true because I have "used" Linux for about 5-6 years.  I guess I will remain a "user" forever.

With my level in mind, could somebody describe step-by-step how to make an ipk package from the files that I already have on my Zaurus?  For example, a dictionary for Zbedic or a font.

I understand that an ipk is just an archive with some control where to put files and a log what files and where have been installed.  I've searched and could not find an easy tutorial on how to make those ipks.
« Last Edit: November 09, 2006, 05:20:48 pm by kurochka »
SL-C3100 (from PriceJapan.com): modified Sharp Rom (couldn't make Japanese input work in Cacko Rom)

ex-SL-C3000; ex-SL-5600; ex-Simpad

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
How Do I Make An Ipk?
« Reply #1 on: November 09, 2006, 06:00:32 pm »
I will try to explain it.

You make a folder with the name of the app/font/etc. Inside of that, make 2 folders, one named CONTROL and one named data. For simplicity, I will assume that this folder is on /mnt/card.

Open up a text editor and write 2.0 on the first line. Save this as /mnt/card/appname/debian-binary.

In the directory labeled "data" make the path of folders starting from root that you want to include in your install. Example: If your dictionary is in /home/root you would make a folder (inside of "data") called home, and one inside of that called "root". You then put the dictionary file in that "root" directory.

Open up a text editor and write the following:

Package: (package name)
Version: (version)
Architecture: (for pdaXrom, armv5tel, I don't know about Cacko. I would assume arm)
Maintainer: (your name)
Description: (description)

Save this as /mnt/card/appname/CONTROL/control

Once all of that is done, open up a terminal.

type:

#cd /mnt/card/appname/CONTROL
#tar -czf ../control.tar.gz ./*
#cd /mnt/card/appname/data
#tar -czf ../data.tar.gz ./*
#cd /mnt/card/appname
#tar -czf name_version_arm.ipk ./debian-binary ./data/tar/gz ./control.tar.gz

You're done. That's how it works in pdaXrom, I assume it's the same in Cacko.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
How Do I Make An Ipk?
« Reply #2 on: November 09, 2006, 06:18:44 pm »
Quote
I will try to explain it.

You make a folder with the name of the app/font/etc. Inside of that, make 2 folders, one named CONTROL and one named data. For simplicity, I will assume that this folder is on /mnt/card.

Open up a text editor and write 2.0 on the first line. Save this as /mnt/card/appname/debian-binary.

In the directory labeled "data" make the path of folders starting from root that you want to include in your install. Example: If your dictionary is in /home/root you would make a folder (inside of "data") called home, and one inside of that called "root". You then put the dictionary file in that "root" directory.

Open up a text editor and write the following:

Package: (package name)
Version: (version)
Architecture: (for pdaXrom, armv5tel, I don't know about Cacko. I would assume arm)
Maintainer: (your name)
Description: (description)

Save this as /mnt/card/appname/CONTROL/control

Once all of that is done, open up a terminal.

type:

#cd /mnt/card/appname/CONTROL
#tar -czf ../control.tar.gz ./*
#cd /mnt/card/appname/data
#tar -czf ../data.tar.gz ./*
#cd /mnt/card/appname
#tar -czf name_version_arm.ipk ./debian-binary ./data/tar/gz ./control.tar.gz

You're done. That's how it works in pdaXrom, I assume it's the same in Cacko.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=145939\"][{POST_SNAPBACK}][/a][/div]

busybox on cacko/sharp doesn't have the -z option for tar so you can't do the above on the Z directly unless you install a replacement package for tar which supports that option.

just substitute
 tar -czf ../name.tar.gz ./*
with
 tar cf - ./* | gzip > ../name.tar.gz

alternatively, just install my ipktools package and you can then do

# ipknew myappp

to create a skeleton package structure and edit the control file and replace the template with appropriate values, and dump the files you want under the data directory with the corresponding directory structure. then just run

# makeipk myapp

and your ipk file is created for you.

if you ever want to update or modify an ipk file, then you can do

# unpackipk myapp

refresh/update the files and regenerate with

# makeipk myapp
« Last Edit: November 09, 2006, 06:20:31 pm by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
How Do I Make An Ipk?
« Reply #3 on: November 09, 2006, 06:18:56 pm »
Chero has written an excellent guide, which was my very first lesson on compiling and packaging: http://users.telenet.be/zaurususer/Chero/compiling/  

To my mind there also seems to be a page on packaging either in the oesf wiki or the pdaxrom website. Maybe it's just my imagination?

Edited:
Hey, here you go:
https://www.oesf.org/index.php?title=IPKG_Howto
https://www.oesf.org/index.php?title=Pdaxro...te_An_Ipk_Howto
« Last Edit: November 09, 2006, 06:23:36 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

kurochka

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
How Do I Make An Ipk?
« Reply #4 on: November 10, 2006, 11:31:22 am »
This is awesome!  Thank you, everybody, for a prompt response.  Using ipk is much easier than copying by hand.  I understand that I can put simlinks in data and they will be part of the package, right?  In that case, I guess I shouldn't use a FAT card.
« Last Edit: November 10, 2006, 11:31:44 am by kurochka »
SL-C3100 (from PriceJapan.com): modified Sharp Rom (couldn't make Japanese input work in Cacko Rom)

ex-SL-C3000; ex-SL-5600; ex-Simpad