Setting up a software repository
Having the official repository, HaikuPorts, is nice, but not all software fits there.
For example, some software is made with the yab buildfactory and the author does not want to distribute it in source code, even if it is open source. Some is just easier to package using the package command and not haikuporter.
This does not prevent the software from being listed in HaikuDepot.
What is required
A web server with adequate bandwidth and disk space to host a repository
The knowledge of how to create .hpkg files
The first step in accomplishing this goal should be to get haikuporter and the haikuports repository. Follow the steps described at the haikuports wiki.
This creates an environment set-up to build packages. For a new repository, you have to make some changes to haikuporter.
Since this repository is not going to be associated with the Haiku Project, do a TextSearch for "vendor" in the haikuporter directory and replace "Haiku Project" with an appropriate vendor string. You'll have to edit two files: DependencyAnalyzer.py and Package.py. This will make all .hpkg files built with haikuporter have a vendor string that matches the new repository.
Or use the "package" command if the requirements for the app are simple and it can be run within a read-only file system.
Creating the repository
Thanks to KapiX for providing a script that makes creating a working repository extremely easy. Get this archive from http://fatelk.com/repo/reposetup.zip and then:
Create a new folder "my-repo".
Unzip the archive into "my-repo".
Place all of your .hpkg files in the "my-repo" directory.
Edit the "example.info" file to meet your needs. Here is my example.info:
name "FatElk" vendor "Fat Elk Software" summary "Fat Elk x86_gcc2 package repository" priority 2 url <http://fatelk.com/repo> architecture x86_gcc2
The name is what shows up in the "Depot" list in HaikuDepot.
The vendor field needs to match the changes made to haikuporter described above.
Leave the priority at 2.
The url is where you will upload your repository to.
The architecture x86_gcc2 is for the standard gcc2 hybrid
Open a Terminal in the "my-repo" directory and type:
chmod +x ./build.sh ./build.sh
The "chmod" line is only needed the first time to make sure the script is executable.
If all went as planned, you now have a "repo" directory that contains all the files for your repository.
Add an index.html page to the "repo" folder with instructions on how to add/remove the repository to/from HaikuDepot. In my case:
pkgman add-repo fatelk.com/repo
pkgman drop-repo FatElk
It's also a nice touch to add links to other known repositories on the index.html page.
Finally, upload all the files and folders to the URL specified in your "example.info" file. In my case, I upload the "repo" folder and all its contents to http://fatelk.com.