Koji for RPMFusion

Creating the Bare Bones based on Fedora 11

First, we add the regular upstream repositories with tags. These include the -release and -updates repositories.

$ koji add-tag dist-f11-release
$ koji add-external-repo -t dist-f11-release dist-f11-release \
http://download.fedoraproject.org/pub/fedora/linux/releases/11/Everything/\$arch/os/
$ koji add-tag --parent dist-f11-release dist-f11-release-override
$ koji add-tag dist-f11-updates
$ koji add-external-repo -t dist-f11-updates dist-f11-updates \
http://download.fedoraproject.org/pub/fedora/linux/updates/11/\$arch/
$ koji add-tag --parent dist-f11-updates dist-f11-updates-override
$ koji add-tag dist-f11-updates-testing
$ koji add-external-repo -t dist-f11-updates-testing dist-f11-updates-testing \
http://download.fedoraproject.org/pub/fedora/linux/updates/testing/11/\$arch/
$ koji add-tag --parent dist-f11-updates-testing dist-f11-updates-testing-override

Add the build and srpm-build groups to a build tag, inheriting the base distribution. Remember to first inherit the -updates, and then add tag inheritance for the -release with a lower priority.

$ koji add-tag --parent dist-f11-updates-override dist-f11-build
$ koji add-tag-inheritance --priority=1 dist-f11-build dist-f11-release-override
$ koji add-group dist-f11-build build
$ koji add-group-pkg dist-f11-build build bash bzip2 coreutils \
cpio diffutils findutils gawk \
gcc gcc-c++ grep gzip \
info make patch redhat-rpm-config \
rpm-build sed shadow-utils tar \
unzip util-linux-ng which
$ koji add-group dist-f11-build srpm-build
$ koji add-group-pkg dist-f11-build srpm-build bash curl cvs gnupg make redhat-rpm-config shadow-utils

This has no fedora-release or generic-release package, so that it can function as the basis for any derivative distribution.

$ koji add-tag --arches="i586 x86_64" rpmfusion-f11-free-release
$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-free-release rpmfusion-f11-free-updates
$ koji add-tag --arches="i586 x86_64" rpmfusion-f11-nonfree-release
$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-nonfree-release rpmfusion-f11-nonfree-updates

Now, in the case of rpmfusion, we need a free and non-free build tag. The -free tag is easy, and is based on the dist-f11-build tag + the packages that have already been built in the -free-release and -free-updates tags:

$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-free-updates rpmfusion-f11-free-build
$ koji add-tag-inheritance --priority=2 rpmfusion-f11-free-build dist-f11-build

Now, the-nonfree part is a little harder:

$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-free-updates rpmfusion-f11-nonfree-build
$ koji add-tag-inheritance --priority=1 rpmfusion-f11-nonfree-build rpmfusion-f11-nonfree-updates
$ koji add-tag-inheritance --priority=2 rpmfusion-f11-nonfree-build dist-f11-build

Now we have the -free-build and -nonfree-build, we can also choose the -release package to use for (amongst other things) the %{?dist} macros. In the case of RPM Fusion, we want fedora-release for Fedora builds (and epel-release EPEL builds).

$ koji add-group-pkg rpmfusion-f11-free-build build fedora-release
$ koji add-group-pkg rpmfusion-f11-free-build srpm-build fedora-release
$ koji add-group-pkg rpmfusion-f11-nonfree-build build fedora-release
$ koji add-group-pkg rpmfusion-f11-nonfree-build srpm-build fedora-release

Updates Testing

We need an -updates-testing tag to mark the builds with that end up in the corresponding repository:

$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-free-updates rpmfusion-f11-free-updates-testing
$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-nonfree-updates rpmfusion-f11-free-nonupdates-testing

We also need a couple of build targets, and such build targets should not result in the builds becoming available in any kind of -updates or -updates-testing tag. Instead, we use a -updates-candidate tag.

$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-free-updates rpmfusion-f11-free-updates-candidate
$ koji add-tag --arches="i586 x86_64" --parent rpmfusion-f11-nonfree-updates rpmfusion-f11-nonfree-updates-candidate

Next Release

Commands:

$ koji add-tag dist-f12-release
$ koji add-tag --parent dist-f12-release dist-f12-release-override
$ koji add-external-repo -t dist-f12-release dist-f12-release \
http://download.etc.etc/
$ koji add-tag dist-f12-updates
$ koji add-tag --parent dist-f12-updates dist-f12-updates-override
$ koji add-external-repo -t dist-f12-updates dist-f12-updates \
http://download.etc.etc/
$ koji add-tag dist-f12-updates-testing
$ koji add-tag --parent dist-f12-updates-testing dist-f12-updates-testing-override
$ koji add-external-repo -t dist-f12-updates-testing dist-f12-updates-testing \
http://download.etc.etc/
$ koji add-tag --arches="i686 x86_64" --maxdepth=1 --parent dist-f11-build dist-f12-build

Adding the Build Targets

The build targets you add as follows:

$ koji add-target rpmfusion-f11-free-release rpmfusion-f11-free-build rpmfusion-f11-free-release
$ koji add-target rpmfusion-f11-nonfree-release rpmfusion-f11-nonfree-build rpmfusion-f11-nonfree-release

Note that the release tag does not require a staging tag, because it'll be used once (at the most), and then locked. Further targets include:

$ koji add-target rpmfusion-f11-free-updates rpmfusion-f11-free-build rpmfusion-f11-free-updates-candidate
$ koji add-target rpmfusion-f11-nonfree-updates rpmfusion-f11-free-build rpmfusion-f11-free-updates-candidate

Importing Existing Builds

You may want to import the existing builds, rather then to rebuild the entire lot. Some of the packages may have a .fc10 disttag (if they have not been rebuild for Fedora 11 by the previous build system in use), and will therefor fail to build (the release of the source will not match the release of the build).

Importing Fedora 11 General Availability

Now, import the builds in Everything for Fedora 11:

$ cd /data/os/repos/rpmfusion/free/fedora/releases/11/Everything/
$ for srpm in `find source/SRPMS/ -name "*.src.rpm"`; do
srpm_name=$(rpmquery --nosignature --queryformat="%{NAME}\n" -p $srpm)
# Maybe look up the owner here
koji add-pkg --owner=<owner> rpmfusion-f11-free-release $srpm_name
koji import --link $srpm
done
$ for rpm in `find i386/ x86_64/ -type f -name "*.rpm | sort`; do
koji import --link $rpm
done

Now, all these imported packages are untagged; tag them:

$ for build in `koji list-untagged`; do
echo Tagging build $build
koji call tagBuildBypass rpmfusion-f11-free-release $build
done

Wait until this command has completed, before attempting the next step!

Importing Fedora 11 Updates

Now, import the builds in updates for Fedora 11:

$ cd /data/os/repos/rpmfusion/free/fedora/updates/11/
$ for srpm in `find SRPMS/ -name "*.src.rpm"`; do
srpm_name=$(rpmquery --nosignature --queryformat="%{NAME}\n" -p $srpm)
# Maybe look up the owner here
koji add-pkg --owner=<owner> rpmfusion-f11-free-release $srpm_name
koji import --link $srpm
done
$ for rpm in `find i386/ x86_64/ -type f -name "*.rpm | sort`; do
koji import --link $rpm
done

Now, all these imported packages are untagged; tag them:

$ for build in `koji list-untagged`; do
echo Tagging build $build
koji call tagBuildBypass rpmfusion-f11-free-updates $build
done

Again, wait until this command has completed, before attempting the next step!

Comments

package tags

First, thanks for this information.

One thing I noticed as I pulled in f13 packages is there are alot of packages inherited from f12. The koji import and koji link gracefully fail, but since these packages are already tagged, then they aren't tagged for f13.

I modified your script do handle this as follows (note, I set FEDORA_RELEASE to whatever I am using, for example 13):

for srpm in `find . -type f -name "*.src.rpm" | sort`; do
        #for build in `koji list-untagged`; do
                build=$(rpmquery --nosignature --queryformat="%{NAME}-%{VERSION}-%{RELEASE}\n" -p $srpm)
                echo Tagging build $build
                koji call tagBuildBypass f${FEDORA_RELEASE}-free-release $build
done

Hope this helps others.

While importing the builds,

While importing the builds, you're not supposed to inherit a former tag from a more recent tag. Once having importing the builds, you can create the inheritance nonetheless, but the tree from which you import and tag the srpms/package builds may have some builds (name-version-release.architecture or NVRA) that already exist (in the former tag).

I guess I was really doing a

I guess I was really doing a "next release" since I already had fed some f12 stuff in. I see you listed, the following example:

koji add-tag --arches="i686 x86_64" --maxdepth=1 --parent dist-f11-build dist-f12-build

How to handle updates, planning for my future f14 setup? Wouldn't the next release have nvra most likely include/need stuff from previous release "updates"

koji add-tag --arches="i686 x86_64" --maxdepth=1 --parent dist-f13-build dist-f14-build

The -build tag is supposed to

The -build tag is supposed to only carry the build package groups "build" and "srpm-build", as such, you can inherit these groups between older and newer versions of the distribution (or repository).

The actual packages you build using the -build "build tag" can be tagged to something like custom-f12 or custom-f12-updates, while then of course a custom-f13 will need to inherit custom-f12-updates. custom-f12-updates in turn should inherit custom-f12, completing the path all the way from f12, through updates for f12, to the next release.

See also my blog post, with a "nice" diagram on the subject, and the documentation I'm working on.

Sorry, I initially misread

Sorry, I initially misread your comment. Yes, a lot of .fc12 builds will exist in Koji if you have imported Fedora 12's packages. Once you import the packages from Fedora 13, you're supposed to have inherited the tag you used for the Fedora 12 package builds, and let whatever build already exists (the .fc12 copies in Fedora 13) fail gracefully. The build will still be in the Fedora 13 tag, as an inherited build.