Over at JBQA I’ve seen the occasional query about how to host a Cydia Repository. Since I figured it all out and did it myself, I should go ahead and tell how I did it. I started by reading the very good article written by @Saurik and found some other bits and pieces elsewhere and by using the time-tested trial and error method.
There are several things you have to do in order to host a Cydia repo. It is not really that hard. Believe it or not, I do a good portion of the setup and maintenance of my Pepper dot Net repo (www.pepper.net) directly on my iPhone.
A repository is simply a particular arrangement of files on a website, so the first thing you need is a website hosted somewhere. The only requirements are that it support HTTP on port 80, and has (or you can add) a defined MIME-type of “application/x-deb” for .deb files.
You also need to know how to create and maintain package (.deb) files, and how to generate the Packages and Release files. In this article I’ll be covering all of this except for the actual package files, that will need another more detailed article all its own. In the meantime, you can read Saurik’s definitive article on the subject. His article mentions a tool “dpkg-scanpackages” which is included in my repotools package, mostly because I got tired of installing it manually every time I wipe my development device.
Before this will work, you need the APT packaging system, this file (or install repotools package) and some implementation of Perl. If you’re going to do this on your iDevice, APT is already there as part of Cydia, and I get the perl package from CoreDev.nl.
Here’s an overview of the repo file structure. Simply create and upload each of these to your website. When everything is there you can add your repo to Cydia and hopefully everything will work.
The first three files should appear in the root folder of your website (technically the “root” of the URL you intend to use for the repo, it doesn’t have to be the “root” of the whole site).
Use your favorite PNG editing program to create an icon. It will appear in Cydia (1.1 and later) next to your repo in the “Manage Sources” area.
This file is generated from the individual control files of each of your packages and then compressed. It has a specific format that I won’t get into at this point, but the important thing to remember is you need to regenerate it any time you add, change or delete packages. The commands I use are:
./dpkg-scanpackages -m [name.of.repo.folder] /dev/null >Packages
This is a plaintext file containing some basic information about your repo. The fields are self explanatory and there are additonal, optional fields. These few fields are plenty enough to get started. Among other things, this information determines part of what appears in the description of your packages when viewed in Cydia.
Origin: Pepper dot Net Label: PepperdotNet Suite: stable Version: 0.3 Architectures: iphoneos-arm Components: main Description: Welcome to the experimental repository from www.pepper.net! @PepperdotNet on Twitter
Put all of your packages (the .deb files) in the repo folder. While technically they could be in the root, I suggest a separate folder to keep things organized. It works best if the name of this folder is exactly the same relative to the root, as where the packages were when you generated the Packages.bz2 file relative to where you ran the command from.
As mentioned before, you’ll need to regenerate Packages.bz2 anytime you add, change or delete packages.
That’s about all you need to know to get started hosting your own Cydia repository. Good luck, and let me know in the comments area if you have any questions and something about your new repo!