This is a very small guide to create .deb packages for your apps. You’ll need a system with dpkg installed, I’m guessing you can do it on the iDevice, but I do it on Linux.
First, create a folder called data, then make a folder inside called DEBIAN.
Insided DEBIAN you’ll have to make a text file called control, no extension, which will hold the info of your package. Here’s a small template for an iPhone OS package:
Name: Name of Package
Version: 1.2.6-1
Architecture: iphoneos-arm
Description: The Description.
Maintainer: Name
Section: Section
Installed-Size: 100
The only field you should not change is Architecture.
Now, inside data, put the files to be installed in an absolute path.
For example, if your files go inside /Applications/YourApp.app, create a folder called Applications, inside it create a folder called YourApp.app and inside it put the files.
Another example, if your files go into /var/mobile/Library/App, create a folder called var, inside that one a folder called mobile, inside that one a folder called Library, inside that one called App and inside that one put your files.
Easy enough I think.
Now, open a terminal and point it to where your data folder is.
Then execute this command, replacing PackageName.deb with the name you want the package to have:
The result will be a deb file in the same folder you are standing in.
That’s for a simple package. Another thing you can do is add bash scripts to be executed before/after the package is installed/removed.
This is as simple as adding a plain text file called preinst/postinst for pre and post install scripts and prerm/postrm for pre and post removal to the DEBIAN folder.
This can be used, for example to remove any settings saved by your app.
Another interesting field you can add to your control file is Depends: anotherPackage (>= 1.0), this tells dpkg that your package depends on anotherPackage, and that it should be at least version 1.0. If you are installing it via terminal, it will fail to install if the needed package is not installed. If you are using apt, like Cydia, it will try to install the required package.
If you are making a theme, for example, you might want your package to depend on Winterboard.
For more info about the control files: LINK.





