Tuesday, March 9, 2010

Local Fedora ARM Repository

Since we are going to be working on the ARM architecture for Fedora and because the repository is located over seas we will be hosting the RPMs locally for faster speeds. This isn't hard to do but it does take some configurations to get it working.
  1. Install and Configure Apache.
  2. Download all RPMs from current over sea repository.
  3. Sign packages.
  4. Create repository meta-data.
As you can see there are a few steps that need to be taken but they are all fairly simple and easy to do.

Ok, so the first thing we need to do choice a host system. For our local repository we choose HongKong.proximity.on.ca as the host and simply had to make sure that Apache was configured for port 80 and that the firewall was allowing connections on port 80.

BOOM done! It was working on that host already but for a quick refresher, all you would do is install it using yum and open the port using your preferred firewall software.

Ok so I tried using rsync to download the repository however no matter how I tried I never got it to work. The repository didn't support the rsync protocol, so instead I used plain old wget to download all the files and directories required. Than I made a file hierarchy that will allow me to expand the repository if needed in the future.

Now we just sign all the packages by creating a public key with GPG and than you just sign it using this tutorial. Don't see a point in rewriting what has been written so well.
http://fedoranews.org/tchung/gpg/

Now the final step, to create the repo meta-data.
createrepo /absolute/path/to/repo/on/filesystem

And that's it. Create a cron job that will periodically check for new files and sign them and for updating the repo meta-data.

Building RPMs Part 4

Building with Koji

We use Koji to build a package on different architectures such as i386, x86_64, ppc32, and ppc64. This will allow us to check if the rpm package we created will work on different machines with different architectures. When building for the 'Fedora Project' they will provide you with a certificate so you could use their servers. Using Koji can also be a good way to monitor errors and to get stats of how long it takes to build.

I'm not going to lie, I haven't done much with Koji. I've only used it as a client and haven't created my own Koji farm yet. But I'll explain how to get a certificate from Fedora and how to submit your package for building.

First thing is to create an account with the Fedora Project. click here to start creating your account. Once your account is done click here to create your certificate.

Now save it to your build user's home directory. Let's install Koji as root before we do anything else.

yum install fedora-packager


Now run this as your build user.
fedora-packager-setup
Now when I downloaded the certificate it got a file called dogencert which I changed to .fedora.cert
mv dogencert ~/.fedora.cert
Now we can start to build.
koji build dist-f12 --scratch 'rpmbuild/SRPMS/packagename.src.rpm'
And now we just play the waiting game to see if all is well.

If I missed anything please comment below and I will gladly add it to my 4 piece HowTo.