Dear Fedora Developers,
So recently I found myself desiring to update a .spec file for a snapshot of a git tree in an automated fashion. As you may or may not know, this actually has a surprising number of flaming hoops through which you must jump.
The first one, when scripting such a thing, is pulling the source tree and packing it into a source file. To this purpose, I propose we begin adding the following key to .spec files:
#VCS: <url format entry for version control system>
Note the use of a comment. There's a ticket to support this key more explicitly in RPM: http://rpm.org/attachment/ticket/143 However I didn't want to block my scripts on that patch landing; in any case we currently add human-consumable comments (https://fedoraproject.org/wiki/Packaging:SourceURL) for VCS snapshots now, so think of this key as just more of that. Having the version control system in the spec file will help a lot for other things like automating source tarball verification.
The second hoop is correctly handling the Release tag. https://fedoraproject.org/wiki/Packaging:NamingGuidelines#Package_Version has lots of gory details. But basically, this can be automated.
Another hoop is the autotools; you have a variety of choices here, but it's most common to add BuildRequires on them, and figure out how to bootstrap. This latter part requires a bit of build intelligence (my scripts recognize the case of autotools, and the more specific case of gnome-autogen.sh).
I'd actually like to break out the build recognition system into a separate python library of some sort.
So without further ado, my current scripts: http://fedorapeople.org/gitweb?p=walters/public_git/fedpkg-make-pull.git;a=s...
I'd actually like to get these into Jesse's new fedpkg work, but for now these operate on distcvs.
Executive summary: if you find yourself needing to automate git-spec integration, you should use my scripts, because they're cool. I'm sure I'm not the first person to write these scripts, but I'd like to get these upstream into fedpkg. Patches for other version control systems (and major build systems like distutils and cmake) are happily accepted!
What am I using them for? Automating gnome-shell stack snapshots for F12:
$ fedpkg-pull-build-chain --arch=i386 --arch=x86_64 --release=F-12 --resultdir=_repo gobject-introspection gir-repository gjs clutter mutter gnome-shell
On Fri, Feb 26, 2010 at 02:03:49AM +0000, Colin Walters wrote:
So recently I found myself desiring to update a .spec file for a snapshot of a git tree in an automated fashion. As you may or may not know, this actually has a surprising number of flaming hoops through which you must jump.
The first one, when scripting such a thing, is pulling the source tree and packing it into a source file. To this purpose, I propose we begin adding the following key to .spec files:
What am I using them for? Automating gnome-shell stack snapshots for F12:
$ fedpkg-pull-build-chain --arch=i386 --arch=x86_64 --release=F-12 --resultdir=_repo gobject-introspection gir-repository gjs clutter mutter gnome-shell
Thanks, this looks useful. I will try to use them, too. From their description they should be helpful to just check whether the current SPEC would still build the current upstream SCM version.
Regards Till
On Fri, Feb 26, 2010 at 6:04 PM, Till Maas opensource@till.name wrote:
Thanks, this looks useful. I will try to use them, too. From their description they should be helpful to just check whether the current SPEC would still build the current upstream SCM version.
Yeah, the basic idea is that they modify the .spec file in place, but don't affect Fedora mainline (i.e. commit or upload to the lookaside cache), though that would be a nice extra optional workflow step. If you just want to test a build:
$ fedpkg-make-pull $ make local $ rm *.spec sources && cvs up
On Fri, Feb 26, 2010 at 06:39:11PM +0000, Colin Walters wrote:
On Fri, Feb 26, 2010 at 6:04 PM, Till Maas opensource@till.name wrote:
Thanks, this looks useful. I will try to use them, too. From their description they should be helpful to just check whether the current SPEC would still build the current upstream SCM version.
Yeah, the basic idea is that they modify the .spec file in place, but don't affect Fedora mainline (i.e. commit or upload to the lookaside cache), though that would be a nice extra optional workflow step. If you just want to test a build:
Here is my first feature request: please make the fedora buildsys specific items optional, e.g. if there is no sources file, then just skip all the CVS etc. stuff, but only fetch the tarball and update the spec. This would make it possible to initially use the tools to create a spec for a review request.
Also a link to an example spec would be helpful.
Regards Till
On Fri, Mar 5, 2010 at 6:05 AM, Till Maas opensource@till.name wrote:
Here is my first feature request: please make the fedora buildsys specific items optional, e.g. if there is no sources file, then just skip all the CVS etc. stuff, but only fetch the tarball and update the spec. This would make it possible to initially use the tools to create a spec for a review request.
That's a good idea. Would depend on some refactoring that's overdue, but I need to do that anyways. I can't say when it will happen but I hope soon.
Also a link to an example spec would be helpful.
For just the #VCS key? Let me instead write up a formal proposal:
https://fedoraproject.org/wiki/User:Walters/Packaging_VCS_key_proposal
Spot can you add this to the agenda for a future packaging committee meeting?
On Fri, Mar 05, 2010 at 09:53:59AM -0500, Colin Walters wrote:
On Fri, Mar 5, 2010 at 6:05 AM, Till Maas opensource@till.name wrote:
Also a link to an example spec would be helpful.
For just the #VCS key? Let me instead write up a formal proposal:
It helps to have something that is supposed to work to get something that does not work, working. E.g. I suppose there might be special requirements for the version or release rpm tag, e.g. may the include custom macros?
But the proposal is also a good addition.
Regards Till
On Fri, Mar 05, 2010 at 09:53:59AM -0500, Colin Walters wrote:
On Fri, Mar 5, 2010 at 6:05 AM, Till Maas opensource@till.name wrote:
Also a link to an example spec would be helpful.
The fedora-easy-karma.spec now uses this, so in case anyone else is interested to test it, it can be used. But I needed some patches to get it work: http://till.fedorapeople.org/fedpkg-vcs-patches/
The command to get it to work was: fedpkg-vcs -f pull-update
For just the #VCS key? Let me instead write up a formal proposal:
https://fedoraproject.org/wiki/User:Walters/Packaging_VCS_key_proposal
Imho it should be #VCS0 to match Source0, to make it easier to maybe support several VCS for several sources.
Regards Till