I still use the old "make sources" way. Pretty much copied from the Fedora set up, with the "lookaside" repository for the files.
Here's how I understood it, please correct me if I'm wrong: Koji checks out the package subdir and executes "make sources" there. The Makefile within the subdir of the package in svn references a "Makefile.common" that lives in "trunk/common". The Makefile retrieves the "Makefile.common" from svn and loads it. Makefile.common then retrieves the sources file and the sources. To download them it uses the REPOSITORY variable, i.e. the svn host. It fetches the sources like this: http://REPOSTITORY_HOST/repo/pkgs/<packagename>/<source file name>/<md5sum of source file>/<source file name>. If the md5sum matches, "make sources" returns and koji proceeds with building.
As Jesse wrote back then, if you don't want to do it that way, you're free to specify any other command that will download the sources. For me it was a good start without getting too much into fedpkg stuff.
Andreas.
On Fri, Apr 20, 2012 at 18:34, Moray Henderson < Moray.Henderson@ict-software.org> wrote:
Hello again,
I'm trying to understand how Koji does things in order to migrate from our previous home-made build system with svn repositories to Koji. Most of our stuff is in svn as source files, not tarballs, so I'll have to implement a "make sources". I was looking in the Fedora git repositories, but couldn't see how this is actually done. I can see how it _used_ to be done: with a common package containing a Makefile.common. However that doesn't seem to be available any more.
I've found fedora-packager and fedpkg; there was a thread here in 2010 ( http://www.mail-archive.com/buildsys@lists.fedoraproject.org/msg00619.html ) which suggested that they configured Koji to issue the command to get the sources. However, that's "allowed_scms" in kojid.conf, and I can't see anything in either package now which modifies that.
So basically I'd really like to know the steps that Fedora's Koji goes through to build packages like anaconda - which has an old Makefile, and has no URL to say where to find the sources.
Moray. "To err is human; to purr, feline."
-- buildsys mailing list buildsys@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/buildsys
Hello Moray,
As Andreas pointed out there are a lot of pieces involved in getting koji to build from git or hg or other revision control systems. I'll try to explain the process from my POV as I've now done it a few times. The project I work on is called GoOSe Linux, it's a similar project to what CentOS is doing. It's possible I'm going into too much information, but I figured it could not hurt to give you the pieces, included the makefile and makefile.common parts.
Essentially, we have all of our rpms separated into two basic components. First, we have a git repository for all of the rpms we wish to build. They can be found at http://github.com/gooselinux/<repo>. These consist of the spec, patch and Makefiles along with a file called sources. This is exactly similar to the method Andreas described in the previous mail. The other part is the lookaside cache which holds the actual upstream source code, usually in a tarball or zip file. These are all of the pieces you need to make koji work properly.
Assuming you have your koji system setup and the package tagged, you just have to tell koji to build your package. This can be done simply by running 'koji build gl6-alpha git://github.com/gooselinux/anaconda.git#HEAD' (your koji build line will vary). As other discussions have probably explained, there's a lot of magic that happens here, so I'll go through it step by step.
What happens next is that koji sets up a mock build environment to build the source rpm. Once the mock environment is initialized, make sources is called. Koji then takes the url you provided and checks it out into the mock build environment. Then, the lookaside cache is downloaded. You should have a look at our Makefile.common at https://github.com/gooselinux/common. There is also a Makefile for each rpm we have koji build, using anaconda as an example, you can find the Makefile at https://github.com/gooselinux/anaconda. The Makefile downloads the tarball from the lookaside cache and verifies the sha256sum from the 'sources' file in the anaconda git repository previously mentioned. If all of that completes successfully, then mock builds the source rpm.
After building the source rpm, koji then creates the mock environment(s) to build the binary rpm(s). The rpm(s) is/are built from the source rpm (SRPM) built in the previous explanation.
A couple things you mentioned about kojid.conf and the allowed_scms variable. I've attached a copy of my kojid.conf from one of the builders to help you along your way. Additionally, Andreas' Makefile.common is pretty long and does a lot of things, it's likely got some very nice checking and additional things that the goose Makefile.common doesn't. Ours is rather simple and just does the bare minimum to make things work.
I sure hope this explanation and files has helped you on your way to using Koji to build rpms!
Cheers,
Clint
On Fri, Apr 20, 2012 at 1:47 PM, Andreas Mack andreas.mack@gmail.com wrote:
Here's the Makefile.common that I use.
Andreas
-- buildsys mailing list buildsys@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/buildsys
buildsys@lists.fedoraproject.org