Ignore:
Timestamp:
Apr 28, 2018, 1:21:43 PM (6 years ago)
Author:
g7moreau
Message:
  • Add many link in the doc and change licence to license (beginning)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/project-meta/project-meta

    r200 r201  
    3232   'make-zip'        => \&cmd_make_zip,
    3333   'make-author'     => \&cmd_make_author,
    34    'make-licence'    => \&cmd_make_licence,
     34   'make-license'    => \&cmd_make_license,
    3535   'make-copyright'  => \&cmd_make_copyright,
    36    'list-licence'    => \&cmd_list_licence,
     36   'list-license'    => \&cmd_list_license,
    3737   );
    3838
     
    9090 project-meta remove-link
    9191 project-meta make-zip
    92  project-meta list-licence
    93  project-meta make-licence
     92 project-meta list-license
     93 project-meta make-license
    9494 project-meta make-author
    9595 project-meta make-copyright
     
    128128   my $data_set    = $meta->{'public-dap'}{'data-set'};
    129129
    130    push @{$data_set}, 'AUTHORS.txt', 'COPYRIGHT.txt', 'LICENCE.txt';
     130   push @{$data_set}, 'AUTHORS.txt', 'COPYRIGHT.txt', 'LICENSE.txt';
    131131   {
    132132      # Remove doublon
     
    187187   my $acronym     = $meta->{'project'}{'acronym'};
    188188
    189    push @{$data_set}, 'AUTHORS.txt', 'COPYRIGHT.txt', 'LICENCE.txt';
     189   push @{$data_set}, 'AUTHORS.txt', 'COPYRIGHT.txt', 'LICENSE.txt';
    190190   {
    191191      # Remove doublon
     
    266266################################################################
    267267
    268 sub cmd_make_licence {
    269    my $meta = YAML::Syck::LoadFile("PROJECT-META.yml");
    270 
    271    my $current_dir = Cwd::getcwd();
    272 
    273    if (-f "$current_dir/LICENCE.txt") {
    274       print "Warning: LICENCE.txt already exists\n";
     268sub cmd_make_license {
     269   my $meta = YAML::Syck::LoadFile("PROJECT-META.yml");
     270
     271   my $current_dir = Cwd::getcwd();
     272
     273   if (-f "$current_dir/LICENSE.txt") {
     274      print "Warning: LICENSE.txt already exists\n";
    275275      return;
    276276      }
    277277
    278    my $licence = $meta->{'public-dap'}{'data-licence'};
    279 
    280    if (not -f "/usr/share/project-meta/licence.d/$licence.txt") {
    281       print "Error: licence $licence doesn't exists in project-meta database\n";
     278   my $license = $meta->{'public-dap'}{'data-license'};
     279
     280   if (not -f "/usr/share/project-meta/license.d/$license.txt") {
     281      print "Error: license $license doesn't exists in project-meta database\n";
    282282      exit 1;
    283283      }
    284284
    285    copy("/usr/share/project-meta/licence.d/$licence.txt", "$current_dir/LICENCE.txt")
    286       or die "Error: licence copy failed - $!";
    287 
    288    print "Info: LICENCE.txt file create\n";
     285   copy("/usr/share/project-meta/license.d/$license.txt", "$current_dir/LICENSE.txt")
     286      or die "Error: license copy failed - $!";
     287
     288   print "Info: LICENSE.txt file create\n";
    289289   return;
    290290   }
     
    326326         authorlist  => $meta->{'project'}{'authors'},
    327327         description => $meta->{'project'}{'short-description'},
    328          licence     => $meta->{'public-dap'}{'data-licence'},
     328         license     => $meta->{'public-dap'}{'data-license'},
    329329         doi         => $meta->{'publication'}{'doi'},
    330330      }, \$msg_format) || die $tt->error;
     
    337337################################################################
    338338
    339 sub cmd_list_licence {
    340    opendir my $dh, '/usr/share/project-meta/licence.d/' or die $!;
    341    for my $licence (readdir $dh) {
     339sub cmd_list_license {
     340   opendir my $dh, '/usr/share/project-meta/license.d/' or die $!;
     341   for my $license (readdir $dh) {
    342342      # Keep only file
    343       next if not -f "/usr/share/project-meta/licence.d/$licence";
     343      next if not -f "/usr/share/project-meta/license.d/$license";
    344344     
    345345      # Keep only .txt file
    346       next if not $licence =~ m/\.txt$/;
    347 
    348       $licence =~ s/\.txt$//;
    349       print "$licence\n";
     346      next if not $license =~ m/\.txt$/;
     347
     348      $license =~ s/\.txt$//;
     349      print "$license\n";
    350350      }
    351351   closedir $dh;
     
    371371 project-meta remove-link
    372372 project-meta make-zip
    373  project-meta list-licence
    374  project-meta make-licence
     373 project-meta list-license
     374 project-meta make-license
    375375 project-meta make-author
    376376 project-meta make-copyright
     
    408408
    409409Create UNIX soft links on the OpeNDAP folder to the real data.
    410 Files F<AUTHORS.txt>, F<LICENCE.txt> and F<COPYRIGHT.txt> are mandatory but could be generated (see below).
     410Files F<AUTHORS.txt>, F<LICENSE.txt> and F<COPYRIGHT.txt> are mandatory but could be generated (see below).
    411411The main keys use in the F<PROJECT-META.yml> are:
    412412
     
    443443
    444444Create a ZIP archive with the open data set.
    445 Files F<AUTHORS.txt>, F<LICENCE.txt> and F<COPYRIGHT.txt> are mandatory but could be generated (see below).
     445Files F<AUTHORS.txt>, F<LICENSE.txt> and F<COPYRIGHT.txt> are mandatory but could be generated (see below).
    446446The main keys use in the F<PROJECT-META.yml> are:
    447447
     
    454454=back
    455455
    456 =head2 list-licence
    457 
    458  project-meta list-licence
    459 
    460 Give the list of all the open data licence supported by the project-meta licence database.
    461 At this time the possible licence are:
     456=head2 list-license
     457
     458 project-meta list-license
     459
     460Give the list of all the open data license supported by the project-meta license database.
     461At this time the possible license are:
    462462
    463463 license-ouverte-v2.0
    464464 open-database-license-v1.0
    465465
    466 Note that these licences are dedicated to open data.
    467 Please do not use open licence that have been written for code or documentation for data.
    468 
    469 =head2 make-licence
    470 
    471  project-meta make-licence
    472 
    473 Copy the licence file from the project-meta licence database at the current folder
    474 with the file name: F<LICENCE.txt>.
    475 
    476 The licence is defined in the F<PROJECT-META.yml> specification under the key C<public-dap/data-licence>.
    477 The list of possible licence is given with the command L</list-licence>.
     466Note that these licenses are dedicated to open data.
     467Please do not use an open license that would have been thought for source code or documentation and not for open data.
     468
     469=head2 make-license
     470
     471 project-meta make-license
     472
     473Copy the license file from the project-meta license database at the current folder
     474with the file name: F<LICENSE.txt>.
     475
     476The license is defined in the F<PROJECT-META.yml> specification under the key C<public-dap/data-license>.
     477The list of possible license is given with the command L</list-license>.
    478478
    479479=head2 make-author
     
    489489
    490490Create or update the F<COPYRIGHT.txt> file at the current folder.
    491 Authors, licence and copyright data are extracted from the C<PROJECT-META.yml> file.
     491Authors, license and copyright data are extracted from the C<PROJECT-META.yml> file.
    492492
    493493
     
    508508=head1 SEE ALSO
    509509
    510 yamllint(1), ysh(1)
    511 
    512 In Debian, package for C<yamllint> and C<ysh> are
     510yamllint(1), ysh(1), YAML, Archive::Zip
     511
     512In Debian GNU/Linux distribution, packages for C<yamllint> and C<ysh> are:
    513513
    514514=over
     
    517517
    518518=item * C<libyaml-shell-perl> - YAML test shell (Perl)
     519
     520=back
     521
     522
     523Own project ressources:
     524
     525=over
     526
     527=item * L<Web site|http://servforge.legi.grenoble-inp.fr/projects/soft-trokata/wiki/SoftWare/ProjectMeta>
     528
     529=item * L<Online Manual|http://servforge.legi.grenoble-inp.fr/pub/soft-trokata/project-meta/project-meta.html>
     530
     531=item * L<SVN repository|http://servforge.legi.grenoble-inp.fr/svn/soft-trokata/trunk/project-meta>
    519532
    520533=back
     
    539552=head1 LICENSE AND COPYRIGHT
    540553
    541 Licence GNU GPL version 2 or later and Perl equivalent
     554License GNU GPL version 2 or later and Perl equivalent
    542555
    543556Copyright (C) 2017-2018 Gabriel Moreau <Gabriel.Moreau(A)univ-grenoble-alpes.fr>.
Note: See TracChangeset for help on using the changeset viewer.