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