utility classes used in build.xml, and a dodgy perl script for
[jalview.git] / utils / jarunsigner.pl
diff --git a/utils/jarunsigner.pl b/utils/jarunsigner.pl
new file mode 100755 (executable)
index 0000000..f18f94c
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+use strict;
+
+# perverse script to get rid of unwanted jar signatures
+use Cwd qw(abs_path);
+use File::Temp qw(tempdir);
+
+my $tempdir = tempdir( CLEANUP => 1);
+
+my $jarfile;
+
+my @jarfiles;
+
+while (scalar @ARGV) {
+    my $jarfile = shift @ARGV;
+    ((-f $jarfile) and $jarfile=~/.+\.jar/) 
+        and push @jarfiles, abs_path($jarfile);
+}
+my $pwdir = `pwd`;
+chdir($tempdir);
+
+while (scalar @jarfiles) {
+    $jarfile = shift @jarfiles;
+    system("rm -Rf *");
+    system("jar xf $jarfile");
+    system("mv $jarfile $jarfile.bak");
+    system("rm META-INF/*.SF");
+    system("rm META-INF/*.RSA");
+    system("jar cf $jarfile *");
+}
+
+chdir($pwdir);