Author Topic: How to create .deb packages for iOS/Cydia  (Read 3603 times)

Offline iTechy21

  • Bashing the shell
  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 1675
  • Country: gb
  • Well errr... Stuff :3
    • View Profile
    • My Blog
  • Device: iPod Touch 1G
  • My Computer: Windows
How to create .deb packages for iOS/Cydia
« on: August 22, 2014, 01:25:02 PM »
Introduction
To create a cydia package or .deb as it's also known, you need to have a bit of know how on how iPods work. Firstly they are a unix based system (as well as Linux and OSX) so at the end of every line there is a break which you don't see.
In windows this break is
[LF][CR]
And in unix it's
[LF]

iPods will only work with the LF meathard so if using windows you will need notepad++ or create the debs on your iPod.

Step one - control files
A control file is needed as the base of your deb as everyone needs one.
The basic layout is as follows
Create a folder called: DEBIAN (all caps) and then a file within that that is called control. Then the text file should be called control with no extention. And the file should contain this basic layout.
Code: [Select]
Package: com.yourname.packagename
Name: Name of package
Version: Version number
Section: is it a tweak, utility, app or theme
Architecture: iphoneos-arm (the base architecture of ios do not change this!)
Depends: any package dependacies or firmware dependacies (line can be removed if there are no dependacies)
Description: Insert a discription
Author: your name <[email protected]>
Maintainer: Your name or maintainers name <[email protected]>
This is the basic layout of a control file. Everytime you want to put out an update change the version number to be higher than the current version.

Creating your layout
Depending on where you want your files to go depends on the layout of this section. As an example I am going to use a typical module layout.

The path to the folder is
/var/mobile/Library/Configurator
This will place the file in that folder and dpkg (the way packages install. I will explain this more later).
So create a folder for
var then a folder within that called mobile and so on...
after that is done you have told dpkg where your files go.

Once the folder layout has been setup you can build your package. To do this you need to have dpkg installed (it comes pre-loaded on Jailbroken devices and all the diffrent Linux flavors). It is a lot easier to do this stage on a Linux computer or the iPod itself. This will be written if you where doing it on an iPod.
Firstly open terminal and login as root (su then alpine or whatever your password is)
The use the cd command to your folder you stored your debian and files for your package (for me it would be cd /var/mobile/debs)
Then type dpkg -b com.name.packagename
Dpkg will return errors (at a maximum of 3 ignorable errors about user defined fields which you can ignore) and then the deb will have been created in the same directory.

(screenshots are from the building of my update to the retina remover module)

Edit by Bruan to provide more keywords in the title :)
« Last Edit: September 20, 2014, 07:41:27 PM by iTechy21 »
Follow me on twitter! | Subscribe to my YouTube Channel! | Follow my blog!
Please Read all the stickies if you're new. And follow the rules, please :)

Offline [email protected]

  • SuperHero Member
  • *****
  • Posts: 617
  • Country: in
  • Old is Smart!
    • View Profile
  • Device: iPhone 3G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #1 on: February 19, 2015, 02:57:24 PM »
Thank you for the tutorial it will help me a lot....
Was this fully done on an iPod ? 
I will have some doubts please help me out (I'll start the project next month)..
New Thinking New Possiblities.
Proud owner of the legendary iPhone 3G.
And Proud Owner of the best budget phone Xiaomi Redmi Note 3 and iPad 3

Offline iTechy21

  • Bashing the shell
  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 1675
  • Country: gb
  • Well errr... Stuff :3
    • View Profile
    • My Blog
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #2 on: February 19, 2015, 03:00:51 PM »
Yep done on an iPod ;) just remember every time you change something you have to update the version number so cydia / apt sees it an update :)
If you have your own VPS you can do this server side but I'm not working on a tutorial for that though... As I'm still setting it up for my repo...
And what's the project if you don't mind me asking? I can help with bag scripts if you need any :P
Follow me on twitter! | Subscribe to my YouTube Channel! | Follow my blog!
Please Read all the stickies if you're new. And follow the rules, please :)

Offline [email protected]

  • SuperHero Member
  • *****
  • Posts: 617
  • Country: in
  • Old is Smart!
    • View Profile
  • Device: iPhone 3G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #3 on: February 19, 2015, 04:39:26 PM »
Yep done on an iPod ;) just remember every time you change something you have to update the version number so cydia / apt sees it an update :)
If you have your own VPS you can do this server side but I'm not working on a tutorial for that though... As I'm still setting it up for my repo...
And what's the project if you don't mind me asking? I can help with bag scripts if you need any :P
Not a big thing but more like a beginners project still thinking what to do for now I am not free at all :( maybe some fancy animation for the icons ? Or calender app icon tweak or something like that....
Anyways I wanted to create a deb for iPH0NE_3GS mod because it's getting too big....
New Thinking New Possiblities.
Proud owner of the legendary iPhone 3G.
And Proud Owner of the best budget phone Xiaomi Redmi Note 3 and iPad 3

Offline iTechy21

  • Bashing the shell
  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 1675
  • Country: gb
  • Well errr... Stuff :3
    • View Profile
    • My Blog
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #4 on: February 19, 2015, 04:44:32 PM »
Not a big thing but more like a beginners project still thinking what to do for now I am not free at all :( maybe some fancy animation for the icons ? Or calender app icon tweak or something like that....
Anyways I wanted to create a deb for iPH0NE_3GS mod because it's getting too big....
You may want to use a script before the install to back everything up before install and then restore it after removal. I think its post unist and something else before inst (I think) scripts and similar things you might need. I can help make them as it's bash scripting :P but it's harder to do without the mod as I need to know what to backup...
Follow me on twitter! | Subscribe to my YouTube Channel! | Follow my blog!
Please Read all the stickies if you're new. And follow the rules, please :)

Offline [email protected]

  • SuperHero Member
  • *****
  • Posts: 617
  • Country: in
  • Old is Smart!
    • View Profile
  • Device: iPhone 3G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #5 on: February 20, 2015, 03:27:35 AM »
You may want to use a script before the install to back everything up before install and then restore it after removal. I think its post unist and something else before inst (I think) scripts and similar things you might need. I can help make them as it's bash scripting :P but it's harder to do without the mod as I need to know what to backup...
Yep I'll need your help (I am still learning ) I don't know yet about bash scripting and all that stuff (I am still in c# ,c++ and HTML )
I'll give you the mod soon.... We have some work to do on it.... ;)
New Thinking New Possiblities.
Proud owner of the legendary iPhone 3G.
And Proud Owner of the best budget phone Xiaomi Redmi Note 3 and iPad 3

Offline iTechy21

  • Bashing the shell
  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 1675
  • Country: gb
  • Well errr... Stuff :3
    • View Profile
    • My Blog
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #6 on: February 20, 2015, 07:12:15 AM »
:P Bash is fairly easy to pickup as it's very visual. But I'm always there to help (of I get time...)
Follow me on twitter! | Subscribe to my YouTube Channel! | Follow my blog!
Please Read all the stickies if you're new. And follow the rules, please :)

Offline [email protected]

  • SuperHero Member
  • *****
  • Posts: 617
  • Country: in
  • Old is Smart!
    • View Profile
  • Device: iPhone 3G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #7 on: February 20, 2015, 07:27:48 AM »
So I just wanted to do a little of codeing a tweak (or to get a tast of it) I found in this website on how to do it http://iphonedevwiki.net/index.php/Theos/Getting_Started

So I installed Theos but I coudnt install iOS Toolchain" (it said something about conflict and required 2 extra things) and  perl (because o coudnt add the repo due to invalid certificates )
Can you tell me what to install and from where. ??? Thanks in advance :)
New Thinking New Possiblities.
Proud owner of the legendary iPhone 3G.
And Proud Owner of the best budget phone Xiaomi Redmi Note 3 and iPad 3

Offline iTechy21

  • Bashing the shell
  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 1675
  • Country: gb
  • Well errr... Stuff :3
    • View Profile
    • My Blog
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #8 on: February 20, 2015, 07:30:03 AM »
So I just wanted to do a little of codeing a tweak (or to get a tast of it) I found in this website on how to do it http://iphonedevwiki.net/index.php/Theos/Getting_Started

So I installed Theos but I coudnt install iOS Toolchain" (it said something about conflict and required 2 extra things) and  perl (because o coudnt add the repo due to invalid certificates )
Can you tell me what to install and from where. ??? Thanks in advance :)
You need to add it in the back end of Cydia in the file system like it says inn that tutorial.
You cannot do it through Cydia annoyingly...
Follow me on twitter! | Subscribe to my YouTube Channel! | Follow my blog!
Please Read all the stickies if you're new. And follow the rules, please :)

Offline [email protected]

  • SuperHero Member
  • *****
  • Posts: 617
  • Country: in
  • Old is Smart!
    • View Profile
  • Device: iPhone 3G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #9 on: February 20, 2015, 10:05:25 AM »
You need to add it in the back end of Cydia in the file system like it says inn that tutorial.
You cannot do it through Cydia annoyingly...
Thanks for the Heads up
I did everything and even got that repo but I didn't install perl because I am on my iPhone with 2g Internet enabled with a Less data and my wifi is down till next month and secondly I have exams! Now I am realizing what am I doing !!??!! I should be studying now !!!
I'll ask you for help if needed next month
Cheers !!! Thanks for helping !! ;)   .
New Thinking New Possiblities.
Proud owner of the legendary iPhone 3G.
And Proud Owner of the best budget phone Xiaomi Redmi Note 3 and iPad 3

Offline iTechy21

  • Bashing the shell
  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 1675
  • Country: gb
  • Well errr... Stuff :3
    • View Profile
    • My Blog
  • Device: iPod Touch 1G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #10 on: February 20, 2015, 10:07:31 AM »
Thanks for the Heads up
I did everything and even got that repo but I didn't install perl because I am on my iPhone with 2g Internet enabled with a Less data and my wifi is down till next month and secondly I have exams! Now I am realizing what am I doing !!??!! I should be studying now !!!
I'll ask you for help if needed next month
Cheers !!! Thanks for helping !! ;)   .
Don't worry about it. I have exams in May / June. And I seriously got to study. Gotta Love college A2's
Follow me on twitter! | Subscribe to my YouTube Channel! | Follow my blog!
Please Read all the stickies if you're new. And follow the rules, please :)

Offline [email protected]

  • SuperHero Member
  • *****
  • Posts: 617
  • Country: in
  • Old is Smart!
    • View Profile
  • Device: iPhone 3G
  • My Computer: Windows
Re: How to create .deb packages for iOS/Cydia
« Reply #11 on: February 20, 2015, 01:52:22 PM »
My exams have already started :P but I am already ready for it ;)
New Thinking New Possiblities.
Proud owner of the legendary iPhone 3G.
And Proud Owner of the best budget phone Xiaomi Redmi Note 3 and iPad 3