Commit 4be3f411 authored by Sebastien Moretti's avatar Sebastien Moretti

Core packages that can be updated are excluded from core + Add new licenses +...

Core packages that can be updated are excluded from core + Add new licenses + Fix for requirements linked to authors
parent 352f9400
......@@ -6,7 +6,7 @@ use diagnostics;
# Sebastien Moretti from the Vital-IT (http://www.vital-it.ch) Center
# for high-performance computing of the SIB Swiss Institute of Bioinformatics.
my $VERSION = '0.1.7';
my $VERSION = '0.1.8';
use Cwd 'abs_path';
use DateTime;
......@@ -181,6 +181,7 @@ if ( -e "$desc_file" && -s "$desc_file" ){
}
$requirements =~ s{ +}{ }g;
$requirements =~ s{\s*Authors\@R.+}{};
push @Deps, map { trim($_) }
split(/ *, */, $requirements);
......@@ -286,6 +287,7 @@ sub format_license {
'GPL-2 + file LICENSE' => 'GPLv2 with exceptions',
'GPL-2 | GPL-3' => 'GPLv2+',
'GPL-2 | file LICENSE' => 'GPLv2 with exceptions',
'GPL (>= 2) | file LICENCE' => 'GPLv2+ with exceptions',
'GPL-3' => 'GPLv3',
'GPL-3 | file LICENSE' => 'GPLv3 with exceptions',
'LGPL' => 'LGPLv2',
......@@ -300,6 +302,7 @@ sub format_license {
'LGPL-3' => 'LGPLv3',
'MIT' => 'MIT',
'MIT + file LICENSE' => 'MIT with advertising',
'Unlimited' => 'Public Use',
'file LICENSE' => '',
);
......@@ -309,35 +312,37 @@ sub format_license {
sub get_R_base_package {
my ($package) = @_;
#FIXME This list is hardcoded!!!
my %base = ('base' => 1,
'boot' => 1,
'class' => 1,
'cluster' => 1,
'codetools' => 1,
'datasets' => 1,
'foreign' => 1,
'graphics' => 1,
'grDevices' => 1,
'grid' => 1,
'KernSmooth' => 1,
'lattice' => 1,
'MASS' => 1,
'Matrix' => 1,
'methods' => 1,
'mgcv' => 1,
'nlme' => 1,
'nnet' => 1,
'parallel' => 1,
'rpart' => 1,
'spatial' => 1,
'splines' => 1,
'stats' => 1,
'stats4' => 1,
'survival' => 1,
'tcltk' => 1,
'tools' => 1,
'utils' => 1,
#FIXME This list is hardcoded, from Fedora R spec file!!!
my %base = ('base' => 1,
#'boot' => 1,
#'class' => 1,
#'cluster' => 1,
#'codetools' => 1,
'compiler' => 1,
'datasets' => 1,
#'foreign' => 1,
'graphics' => 1,
'grDevices' => 1,
'grid' => 1,
#'KernSmooth' => 1,
#'lattice' => 1,
#'MASS' => 1,
#'Matrix' => 1,
'methods' => 1,
#'mgcv' => 1,
#'nlme' => 1,
#'nnet' => 1,
'parallel' => 1,
#'rpart' => 1,
#'spatial' => 1,
'splines' => 1,
'stats' => 1,
'stats4' => 1,
#'survival' => 1,
'tcltk' => 1,
'tools' => 1,
'translations' => 1,
'utils' => 1,
);
return exists $base{$package} ? 1 : 0;
......@@ -398,8 +403,8 @@ sub get_template {
$depsR .= "Requires: $dep\n";
}
elsif ( get_R_base_package($dep) || $is_R==2 ){
$depsB .= "BuildRequires: R-$dep\n";
$depsR .= "Requires: R-$dep\n";
$depsB .= "BuildRequires: R$R_package-$dep\n";
$depsR .= "Requires: R$R_package-$dep\n";
}
# Distinct between CRAN (e.g. R311-XML) and Bioconductor packages (e.g. R311-Bioconductor-Biobase)
else {
......@@ -421,8 +426,8 @@ sub get_template {
else {
shift @part;
# Align versions for better display
$DepsB .= sprintf("%-15s %-38s %2s %s\n", 'BuildRequires:', @part);
$DepsR .= sprintf("%-15s %-38s %2s %s\n", 'Requires:', @part);
$DepsB .= sprintf("%-15s %-47s %2s %s\n", 'BuildRequires:', @part);
$DepsR .= sprintf("%-15s %-47s %2s %s\n", 'Requires:', @part);
}
}
......@@ -444,28 +449,29 @@ sub get_template {
# Build template
my $template = "# Define R version and package prefix
my $template = "# Define R version, package prefix and category
%define _R_version $R_version
%define _prefix $R_path/R/%{_R_version}
%define category Applications/R-BioC
%define _realname $package
Name: $Name
Version: $Version
Release: 1%{?dist}
Summary: $Summary
Group: Applications/R-BioC
Group: %{category}
License: $License
URL: $URL
Source0: $Source0
Prefix: %{_prefix}
BuildRequires: R = %{_R_version}
BuildRequires: R-core = %{_R_version}
BuildRequires: R-devel = %{_R_version}
BuildRequires: R = %{_R_version}
BuildRequires: R-core = %{_R_version}
BuildRequires: R-devel = %{_R_version}
$DepsB
Requires: R = %{_R_version}
Requires: R-core = %{_R_version}
Requires: R = %{_R_version}
Requires: R-core = %{_R_version}
$DepsR
%description
......
Markdown is supported
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