JAL-4012 tweak release notes wording for legacy.uniprot
[jalview.git] / utils / jarunsigner.pl
1 #!/usr/bin/perl
2 ##
3 # Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
4 # Copyright (C) $$Year-Rel$$ The Jalview Authors
5
6 # This file is part of Jalview.
7
8 # Jalview is free software: you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License 
10 # as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 #  
12 # Jalview is distributed in the hope that it will be useful, but 
13 # WITHOUT ANY WARRANTY; without even the implied warranty 
14 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15 # PURPOSE.  See the GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
18 # The Jalview Authors are detailed in the 'AUTHORS' file.
19 ##
20 use strict;
21
22 # perverse script to get rid of unwanted jar signatures
23 use Cwd qw(abs_path);
24 use File::Temp qw(tempdir);
25
26 my $tempdir = tempdir( CLEANUP => 1);
27
28 my $jarfile;
29
30 my @jarfiles;
31
32 while (scalar @ARGV) {
33     my $jarfile = shift @ARGV;
34     ((-f $jarfile) and $jarfile=~/.+\.jar/) 
35         and push @jarfiles, abs_path($jarfile);
36 }
37 my $pwdir = `pwd`;
38 chdir($tempdir);
39
40 while (scalar @jarfiles) {
41     $jarfile = shift @jarfiles;
42     system("rm -Rf *");
43     system("jar xf $jarfile");
44     system("mv $jarfile $jarfile.bak");
45     system("find META-INF \\( -name \"*.SF\" \\) -exec rm -f \\{\\} \\;");
46     system("find META-INF \\( -name \"*.RSA\" \\) -exec rm -f \\{\\} \\;");
47     system("find META-INF \\( -name \"*.DSA\" \\) -exec rm -f \\{\\} \\;");
48     system("jar cf $jarfile *");
49 }
50
51 chdir($pwdir);