On Fri, Dec 08, 2017 at 07:03:48PM +0100, nicolas.mailhot@laposte.net wrote:
Hi,
I am proposing for inclusion a macro set aimed at automating the packaging of forge-hosted projects.
— Packaging draft: https://fedoraproject.org/wiki/Forge-hosted_projects_packaging_automation — FPC ticket: https://pagure.io/packaging-committee/issue/719 (without the “hasdraft” tag because I don't know how to add it in pagure) — fedora-rpm-macros RFE with the macro file: https://bugzilla.redhat.com/show_bug.cgi?id=1523779
What it does: conversion of a forge url, version, tag, commit set to the values expected in rpm specfiles, in optional rpm variables. Computation of the corresponding %{dist}.
Impressive! I just tested this on some random package using github and everything works great.
Would it be possible to drop the requirement to have "/" at the end of a github URL? I think it's natural to paste the URL without the trailing slash...
Your instructions say "just copy the file into /usr/lib/rpm/macros.d", suggesting that the name can by anything, but I think it has to start with "macros.". At least "forgeforge.macros" did not work here.
Wouldn't it be better to recommend %autosetup instead of %setup? It's one less thing to change if patches are added.
In the docs, the instructions under "Packaging a pre-release commit" actually apply to post-release commits. Maybe change the title to "Packaging a pre-release/post-release commit" and add a text like "See https://fedoraproject.org/wiki/Packaging:Versioning how to adjust Release tag for pre-/post- release commits.".
Zbyszek
Objective: centralize forge structure know-how in a single technical place, deprecate all the complex manual forge URL handling spread over many Fedora spec files, simplify packaging and spend time on more interesting stuff.
What's currently implemented: definitions for github.com and code.googlesource.com (I didn't want to propose stuff I didn't use myself. Adding more definitions is trivial. The macros are in Lua which is change-friendly, no arcane rpm syntax knowledge is needed).
Please consult packaging draft for full information.
This is a spin-off of the work I'm currently doing on Go packaging, as Go is heavily forge-oriented. I took the time to extract the generic non-Go-specific forge knowledge in a separate macro file. The macros have been heavily tested on real-life Go projects with quite a lot of variance, on EL7 and rawhide. That's why they come with built-in error handling.
Regards,
-- Nicolas Mailhot _______________________________________________ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-leave@lists.fedoraproject.org