forked from szabgab/perlmaven.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhow-to-add-list-of-contributors-to-the-cpan-meta-files.tt
More file actions
102 lines (73 loc) · 2.98 KB
/
how-to-add-list-of-contributors-to-the-cpan-meta-files.tt
File metadata and controls
102 lines (73 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
=title Adding list of contributors to the CPAN META files
=timestamp 2013-02-27T20:45:56
=indexes META, x_contributors, contributors, ExtUtils::MakeMaker, Module::Build, Module::Install, Dist::Zilla
=status show
=author szabgab
=index 1
=archive 1
=feed 1
=comments 1
=social 1
=abstract start
The META.json and META.yml files of the CPAN distributions are very important sources
of automated information. For example it can list
<a href="/how-to-add-the-license-field-to-meta-files-on-cpan">license</a> of the distribution
and <a href="/how-to-add-link-to-version-control-system-of-a-cpan-distributions">link to the version control system</a>
of the distribution.
These fields are listed in the <a href="https://metacpan.org/module/CPAN::Meta::Spec">CPAN::Meta::Spec</a>.
There is no field specified for listing the contributors of a distribution,
but there is a way to add arbitrary fields. They just need to start with x_ or X_.
=abstract end
<h2>Why should I list the contributors in the META file too?</h2>
After all they are already listed either in the Changes file or in
the POD of the module.
Having the list in the META files will allow someone to extract this automatically,
patch <a href="https://metacpan.org/">Meta CPAN</a> and show the list there.
This will make it easier to find the areas a person has contributed.
Even if she never released a module.
<h2>How?</h2>
I asked <a href="http://www.dagolden.com/">David Golden</a>, and he suggested to use the name <b>x_contributors</b>
to list the contributors the same way they are in the 'authors' section in the module POD. (Name <email>)
Let's see how can this be achieved by the major packaging systems.
<h2>ExtUtils::MakeMaker</h2>
The most recent release of <a href="https://metacpan.org/release/Test-Strict">Test::Strict</a>
already has this in the call of WriteMakefile:
<code lang="perl">
META_MERGE => {
x_contributors => [
'Foo Bar <foo@bar.com>',
'Zorg <zorg@cpan.org>',
],
},
</code>
<h2>Module::Build</h2>
I've added the appropriate section to <a href="https://metacpan.org/release/XML-Feed">XML::Feed</a>
though it has not been released since.
Add this in the <b>Module::Build->new</b> call:
<code lang="perl">
meta_merge =>
{
x_contributors => [
'Foo Bar <foo@bar.com>',
'Zorg <zorg@cpan.org>',
],
},
</code>
<h2>Module::Install</h2>
I just added this to the upcoming release of <a href="http://padre.perlide.org/">Padre, the Perl IDE</a>.
<code lang="perl">
Meta->add_metadata(
x_contributors => [
'Foo Bar <foo@bar.com>',
'Zorg <zorg@cpan.org>',
],
);
</code>
<h2>Dist::Zilla</h2>
When I started this there was no manual way to add an extra field with multiple values,
but David Golden quickly released Dist::Zilla::Plugin::Meta::Contributors that allows you to write this:
<code lang="perl">
[Meta::Contributors]
contributor = Foo Bar <foo@bar.com>
contributor = Zorg <zorg@cpan.org>
</code>