Creating A .DEB Package [How To]



You want release mods, hacks, etc really easy. Well packaging the hack makes it installing the hack very easy for the end-user without messing up permissions or other problems.


Tools:

* iPhone OR iPod touch
* SSH (OpenSSH installed on device)
* WinSCP (4.2.5 or higher)


1. Setup

First of all you would want to make a folder on your desktop. For this tutorial "X" is being used as a folder.

2 Control File

You will need a control file so you are able to package the DEB and for it to be viewable in Cydia/Rock.

To do this make a folder called "DEBIAN" (ALL CAPS) inside the folder "X".
Inside of the folder DEBIAN, make a file called "control" all lowercase and without an extension.

Here is a brief description of the fields in a control file
You need to add the below inside your control file except with your information. Make sure you add an extra space at the bottom of the control file

Code :
Package: com.yourcompany.yourapp
Name: YourAppNameHere
ecture: iphoneo
Version: Number Archi ts-arm
tion: Small Desc. about your app. Homepa
Descri pge: Your Website
me
Maintainer: YourN a
uthor: YourName
ASponsor: YourWebSiteName
Section: System
Here is one of my own control file I use in Advanced Preferences

Code :
Package: com.csdev.advpreferences2
Name: Advanced Preferences 2
phoneos-arm D
Version: B3-2 Architecture:
iescription: This hack will give you more settings and tweaks.
Homepage: http://www.csdev.2x.nu
Maintainer: CS Dev
uthor: CS Dev
ASponsor: CS Dev
Section: System

3. File Structure

Inside your "X" folder, it's going to be like the iPhone File System. Like if you want to add a file to the root partition, just put the file in "X".

A. Application Structure

To install apps with DEBs, inside of "X", make a folder called "Applications". Then inside of Applications, make your app folder (EX: Cydia.app)

B. Theme Structure

To install themes wth DEBs, inside of "X", make a folder called "Library". Then inside of Libary, make another folder called "Themes" . After that inside of themes make your theme folder (EX: Cydia.theme)

Add your files using the structure above

4. WinSCP and SSH.

Open up WinSCP and connect to your Device. Navigate on your Device to 
Code:
/var/root
Copy the X Folder to your device. File Structure should be below
Code:
/var/root/X
Inside the X Folder change the permissions of the DEBIAN folder and its files to 755
Navigate to var/root/ and open up the terminal im WinSCP. Do this by clicking the black box in one of the toolbars.

5. Terminal

Inside of Terminal type the following command in the "Enter Command" Box.
Code:
dpkg -b X.deb

It will pop-up some error and this is okay.

The DEB file will be located in var/root/

Code :
var/root/X.deb