summaryrefslogtreecommitdiff
path: root/packaging/utils/mkrel
blob: 3182d9d06a29f54688223aebae66ea78532c484a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/perl
# mkcand m.nn
# package candidate, leaving it in tmp directory

require($ENV{'HOME'}."/bin/disttools.pl");

&defvars;
&suckvars;

umask(022);

$localdir=$ENV{'HOME'}."/archive";

$tmpdir=$ENV{'BTMP'}."/".$ENV{'USER'}."/snapshots";

$transmit=1;
$snapprefix="";
$tarinfix="";
$date="";
$lastrel=$ENV{'LASTREL'};

sub usage {
    print STDERR "mkrel:\n";
    print STDERR "\t-l          do not transmit\n";
    print STDERR "\t-p name     set release name\n";
    print STDERR "\t-r rel      set release branch\n";
}

while(@ARGV) {
  $_=shift;

  if(/^-l/) {
    $transmit=0;

  } elsif(/^-S/) {
    $symlink=1;

  } elsif(/^-p/) {
    $rel=shift;
    $snapprefix="pre$rel-";

  } elsif(/^-r/) {
    $arg=shift;
    ($lastrel=$arg) =~ y/\./\_/;
    $relopt="-r PRE${lastrel}"

  } else {
    &usage;
    exit;
  }
}

if(!defined($relopt) ||
   !defined($rel)) {
	&usage;
	exit;
}

$dirname="freeswan-".$rel;
$pkgname="freeswan-".$rel;
$tarname=$pkgname.".tar";
$vername=$rel;

&nicesystem("mkdir -p $tmpdir");
print "BUILDING release $rel in $dirname\n";
if($transmit) {
  print "WILL TRANSMIT TO $ENV{'DISTHOST'}\n"
} else {
  print "WILL NOT TRANSMIT\n";
}

$ENV{'PGPPATH'}="/mnt/build/freeswan";
$ENV{'PGPNAME'}="build\@freeswan.org";

&makedisttarfile($tmpdir, $pkgname, $vername, $dirname, $date, $relopt, 1);

print "Please insert release key floppy for signature";
$ans=<STDIN>;
system("mount /mnt/build");
&dopgpsig($pkgname);
system("umount /mnt/build");

if($transmit) {
  print "Now transmitting to XS4all\n";
  print "Starting on: ";
  system("date");

  &upload($pkgname);

  &upsync;
 
  print "Finished on: ";
  system("date");
}