***This page is still unfinished*** # Setting up your own custom xbps repository ## Creating a xbps package For your repository you want to create a package, this can be done multiple ways but this repository was created using [xbps-src](https://github.com/void-linux/void-packages) with which you can create `.xbps` files that can be installed. First you have to [set up xbps-src](https://github.com/void-linux/void-packages#quick-start). After that we can create an xbps package using ``` $ ./xbps-src pkg ``` which will compile a `.xbps` in `hostdir/binpkgs`. To create your own package using xbps-src you'll have to create a [template file](https://github.com/void-linux/void-packages/blob/master/Manual.md). After that you can compile the package and install it for testing using: ``` # xbps-install --repository hostdir/binpkgs ``` Or if you download the `xtools` packages you can install it using: ``` # xi ``` (Note that you have to be in the `void-packages/` directory) If the package is working it is ready to be put in the repository. ## Making the repository Now that we have a package we can make a repository. But first we'll have to create a local one. Make an empty directory. Then copy over your `.xbps` file from the package you want to add into the directory. If you created them using xbps-src they will be in `void-packages/hostdir/binpkgs/`. After that we can add the packages to the repository data. This will be necessary for the xbps package manager to find the packages. To add all the packages in the directory to the repository data you can issue the command: ``` $ xbps-rindex -a /path/to/repository/directory/*.xbps ``` There should now be an `x86_64-repodata` or `x86_64-musl-repodata` file in your directory. (If you wanted to create a local repository than after this you would only have to add the repository to your [xbps configuration](https://docs.voidlinux.org/xbps/repositories/custom.html) and you'd be done. But in this guide we're going to make a remote repository.) ## Signing the repository and the packages Now that we have our repository we're going to need to sign it with a key. To [generate a key](https://docs.voidlinux.org/xbps/repositories/signing.html) we can use the command: ``` $ ssh-keygen -t rsa -m PEM -f private.pem ``` This will create a `private.pem` which we can use to sign the repository and the packages. First we want to sign the repository **which only has to be done once**. This can be done with: ``` $ xbps-rindex --privkey private.pem --sign --signedby "" /path/to/repository/directory ``` Here the `` has to be replaced with the name you want to sign the repository with. And the `/path/to/repository/directory` has to be replaced with the directory where the packages are located. After that we also want to sign the packages themselves. To achieve this we use the command: ``` $ xbps-rindex --privkey private.pem --sign-pkg /path/to/repository/directory/*.xbps ``` Everytime we add or update packages we'll have to sign them again. ## Hosting the repository Although there are a lot of ways to host the repository this repository is being hosted on a git server. It is a fairly easy process and doesn't require a whole lot of knowledge but there are probably more optimal ways of hosting a repository.