Getting RPM built by Koji into YUM-able repo

By following my article series about Fedoras RPM build system Koji, you should by now have a fully working setup that even builds RPMs from Git.
However, by design, the built RPMs cant be directly used as a yum repo. They need to be transformed first. Therefore the tool “mash” exists.
Luckily setting up mash is easy compared to Koji itself.

yum install mash
# create a storage path, this can also be a network mount
mkdir -p /mnt/custom-repo/{mash,rpm}
ln -s /mnt/custom-repo/mash/centos6-release/ /mnt/custom-repo/rpm/centos6

In /etc/mash/mash.conf set

configdir = /etc/mash
buildhost =
repodir = file:///mnt/koji
use_sqlite = True
use_repoview = False

Create /etc/mash/centos6-release.mash

rpm_path = %(arch)s/os/Packages
repodata_path = %(arch)s/os/
source_path = source/SRPMS
debuginfo = True
# Do not create i386s in x86_64
multilib = False
multilib_method = devel
# Use old-style sha hash for EPEL5 only
hash = sha
tag = dist-centos6-release
# Next one is needed to prevent mixing of testing and release.
inherit = False
# for GPG signed rpm's
#strict_keys = True
#keys = bb3b9d78
arches = x86_64
delta = False
hash_packages = False
# This forces to also create older version of same package
latest = False

Add a new tag in koji

su kojiadmin
koji add-tag --parent dist-centos6 dist-centos6-release

Add the tag “dist-centos6-release” to all packages that shall go into the repo

su kojiadmin
koji tag-pkg dist-centos6-release elasticsearch-0.20.5-1.el6  # [more pkg] [more pkg]

# list tagged packages
koji list-tagged dist-centos6-release

Then run mash

mash -o /mnt/custom-repo/mash centos6-release

setup httpd to expose the repo /etc/httpd/conf.d/custom-repo.conf

# Also serve /mnt/custom-repo
Alias /rpm "/mnt/custom-repo/rpm"

<Directory "/mnt/custom-repo/rpm">
Options FollowSymLinks Indexes
AllowOverride None
Order allow,deny
Allow from all

As yum.repo use

name=MyRepo Software

Thats it ! Mash should render Kojis RPMs into the /mnt/custom-repo folders and you should be able to see and install them on other machines via yum.

If you are running Spacewalk, you can have it automatically sync the repo after mash run. See my custom Koji task handler for that

  1. No comments yet.

  1. February 18th, 2014