[Fedora-packaging] Update guidelines for using darcs based sources in packages

Toshio Kuratomi a.badger at gmail.com
Wed Jan 7 19:09:39 UTC 2009


Yaakov Nemoy wrote:
> Hi List,
> 
> (Packaging list, i'm double posting because i want you guys to see
> this, but please put further comments on the haskell list :) )
> 
Not subscribed to the haskell list and this isn't really a haskell
specific question....

> Because the macros, last i checked were for ghc 6.10.1, some of the
> packages i'm still working on will only compile from darcs. I've put
> together a tool to help with development of packages from darcs, and
> i'm looking for a standardized way to note which revision from darcs
> is being used. Darcs has two relatively canonical ways to refer to a
> package, with a hash and a timestamp.  Internally this tool uses both.
> Judging from the different ways people note svn/git/other usage in
> fedora packages, i've put together a few recommendations that we can
> use for a standard.
> 
> Keep in mind, my goal is to support darcs, so please be nitpicky about
> these details. Just keep in mind, this is easily bikesheddable, and
> all i want to do is support darcs based packages systematically.
> 
> Normal Haskell Tarball name:
> %{hackage_name}-%{version}.tar.gz
> Output from darcs:
> %{hackage_name}-%{version}.%{timestamp_from_darcs}darcs.tar.gz
> 
> Accesible from:
> darcs dist -d %{hackage_name}-%{version}.%{timestamp_from_darcs}darcs
> Timestamp accessible from
> darcs changes --xml-output --last=1
> 
> To note this in the rpm
> Normal Dist:
> 1%{?dist}
> Darcs Dist
> 1.%{timestamp_from_darcs}darcs%{?dist}
> 
> I've attached a patch to the templates that puts in a placeholder to
> make it clearer how to do things. Note that in the timestamp i've
> added . and darcs systematically. Since the macro %dist includes the .
> prefix, as a matter of precedent, i've noted that we should just use
> the prefix and suffix in the %darcs macro as well.
> 
> Also, the names of everything here is not so important.  What's
> important is that i want to take a spec file that's been generated by
> cabal2spec, run it through a quick sed-like script that will append
> the correct darcs timestamp. Darcs doesn't make the timestamps that
> easily available, and i'm trying to automate a few things here.
> 
Four comments:

1) Why do we need to add this to the templates?  All packages could
potentially be built from snapshots or built from releases.  So I don't
see why the Haskell templates should be special.

2) %darcs doesn't seem to be a good choice for macro name if it's
intended for use in the Haskell Guidelines.  Perhaps this shouldn't be
part of the the Haskell Guidelines?

3) The patch has two wrong Release lines, %{?darcs} should come before
%{?dist} but two of the patch hunks place it after.

4) Why not use a datetime string like the guidelines currently have in
place?  You could use something like:
   DATESTAMP=date -u +'%Y%m%d' -d @`darcs-get-timestamp`
   sed "s/%define darcs \"\"/%define darcs \"$DATESTAMP\"/" -i foo.spec

-Toshio

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-packaging/attachments/20090107/e2e2f28d/attachment.sig>


More information about the Fedora-packaging mailing list