Commit 7337f488 authored by sikeda's avatar sikeda
Browse files

[-feature][experimental] Add META.json to distribution. It can be useful to...

[-feature][experimental] Add META.json to distribution.  It can be useful to install dependent CPAN modules using such as cpanminus.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@11477 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 54b3aefc
# -*- indent-tabs-mode: nil; -*-
# vim:ft=perl:et:sw=4
# $Id$
use lib qw(src/lib);
use strict;
use warnings;
use CPAN::Meta '2.00';
use Sympa::Constants;
use Sympa::ModDef;
my $struct = {
# Required fields
abstract => 'Sympa is a powerful multilingual List Manager',
author => ['Sympa authors <sympa-authors@listes.renater.fr>'],
dynamic_config => 0,
license => [qw(gpl_2 gpl_3)],
name => 'sympa',
release_status => '', # See below
version => Sympa::Constants::VERSION(),
# Optional fields
no_index => {directory => [qw(po t www)],},
optional_features => {}, # See below
prereqs => {}, # See below
resources => {
homepage => 'https://www.sympa.org/',
bugtracker =>
{web => 'https://sourcesup.renater.fr/tracker/?group_id=23',},
repository => {
url => 'https://subversion.renater.fr/sympa',
type => 'svn',
},
},
};
$struct->{release_status} =
(Sympa::Constants::VERSION() =~ /\da/) ? 'unstable'
: (Sympa::Constants::VERSION() =~ /\db/) ? 'testing'
: 'stable';
$struct->{optional_features} = {optional_features()};
$struct->{prereqs} = {prereqs()};
my $meta = CPAN::Meta->create($struct);
print $meta->as_string;
exit 0;
sub optional_features {
my %features;
foreach my $mod (sort keys %Sympa::ModDef::cpan_modules) {
my $def = $Sympa::ModDef::cpan_modules{$mod};
next if $mod eq 'perl' or $def->{mandatory};
$features{$def->{package_name}} = {
($def->{gettext_id} ? (description => $def->{gettext_id}) : ()),
prereqs => {
runtime => {
requires => {$mod => ($def->{required_version} || '0'),},
},
},
};
}
return %features;
}
sub prereqs {
my %requires;
foreach my $mod (sort keys %Sympa::ModDef::cpan_modules) {
my $def = $Sympa::ModDef::cpan_modules{$mod};
next unless $mod eq 'perl' or $def->{mandatory};
$requires{$mod} = $def->{required_version} || '0';
}
return (runtime => {requires => \%requires});
}
......@@ -38,11 +38,13 @@ check_DATA = t/locale/cs/LC_MESSAGES/sympa.mo \
t/stub/Sympa/Constants.pm
EXTRA_DIST = important_changes.pl \
META.json.pl \
META.json \
sympa.spec.pl \
sympa.spec \
etc_README \
$(check_SCRIPTS) $(check_DATA)
CLEANFILES = previous_sympa_version sympa.spec sympa_wizard.pl.inst
CLEANFILES = META.json previous_sympa_version sympa.spec sympa_wizard.pl.inst
MSGFMT=@MSGFMT@
.po.mo:
......@@ -90,6 +92,8 @@ installconfig: installdir sympa_wizard.pl.inst
if [ ! -d $(DESTDIR)$(confdir) ]; then \
$(INSTALL) -d -m 755 $(DESTDIR)$(confdir); \
fi; \
chown $(USER) $(DESTDIR)$(confdir) || /bin/true; \
chgrp $(GROUP) $(DESTDIR)$(confdir) || /bin/true; \
$(PERL) sympa_wizard.pl.inst \
--create sympa.conf \
--target $(DESTDIR)$(confdir)/sympa.conf \
......@@ -154,6 +158,11 @@ uninstall-hook:
rm -f $(DESTDIR)$(confdir)/sympa.conf
rm -f $(DESTDIR)$(confdir)/wwsympa.conf
sympa.spec: sympa.spec.pl src/lib/Sympa/Constants.pm Makefile
META.json: META.json.pl Makefile
cd src/lib; $(MAKE) Sympa/Constants.pm
$(PERL) META.json.pl > META.json
sympa.spec: sympa.spec.pl Makefile
cd src/lib; $(MAKE) Sympa/Constants.pm
$(PERL) sympa.spec.pl > sympa.spec
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment