forked from dash-project/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.pl
executable file
·176 lines (161 loc) · 4.59 KB
/
release.pl
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/perl
use strict;
use File::Basename;
my $rdir = "RELEASE";
my $version = "0.3.0";
my $base = "$rdir/dash-$version";
if( -e "$base" ) {
print "Directory $base exists, exiting.\n";
exit;
}
my @files;
@files = ("LICENSE",
"README.md",
"CHANGELOG.md",
"CMakeLists.txt",
"CMakeExt/*.cmake",
"CMakeExt/Code/*.c",
"build.sh",
"build.dev.sh",
"build.minimal.sh",
"config/*.cmake",
#
# DART interface specification
#
"dart-if/include/dash/dart/if/*.h",
"dart-if/CMakeLists.txt",
#
# DART base implementation
#
"dart-impl/CMakeLists.txt",
"dart-impl/base/include/dash/dart/base/*.h",
"dart-impl/base/include/dash/dart/base/internal/*.h",
"dart-impl/base/src/*.c",
"dart-impl/base/src/internal/*.c",
"dart-impl/base/CMakeLists.txt",
#
# DART MPI implementation
#
"dart-impl/mpi/include/dash/dart/mpi/*.h",
"dart-impl/mpi/src/*.c",
"dart-impl/mpi/src/Makefile",
"dart-impl/mpi/make.defs",
"dart-impl/mpi/CMakeLists.txt",
"dart-impl/mpi/*.in",
#
# DASH source and header files
#
"dash/include/*.h",
"dash/include/dash/*.h",
"dash/include/dash/algorithm/*.h",
"dash/include/dash/algorithm/internal/*.h",
"dash/include/dash/allocator/*.h",
"dash/include/dash/allocator/internal/*.h",
"dash/include/dash/atomic/*.h",
"dash/include/dash/bindings/*.h",
"dash/include/dash/coarray/*.h",
"dash/include/dash/exception/*.h",
"dash/include/dash/halo/*.h",
"dash/include/dash/halo/iterator/*.h",
"dash/include/dash/internal/*.h",
"dash/include/dash/io/*.h",
"dash/include/dash/io/hdf5/*.h",
"dash/include/dash/io/hdf5/internal/*.h",
"dash/include/dash/iterator/*.h",
"dash/include/dash/iterator/internal/*.h",
"dash/include/dash/list/*.h",
"dash/include/dash/list/internal/*.h",
"dash/include/dash/map/*.h",
"dash/include/dash/matrix/*.h",
"dash/include/dash/matrix/internal/*.h",
"dash/include/dash/memory/*.h",
"dash/include/dash/memory/internal/*.h",
"dash/include/dash/meta/*.h",
"dash/include/dash/pattern/*.h",
"dash/include/dash/pattern/internal/*.h",
"dash/include/dash/tools/*.h",
"dash/include/dash/util/*.h",
"dash/include/dash/util/*.h.in",
"dash/include/dash/util/internal/*.h",
"dash/include/dash/view/*.h",
"dash/src/*.cc",
"dash/src/algorithm/*.cc",
"dash/src/exception/*.cc",
"dash/src/io/*.cc",
"dash/src/util/*.cc",
"dash/src/Makefile",
"dash/make.defs",
"dash/CMakeLists.txt",
"dash/dash-config.cmake.in",
#
# DASH examples
#
"dash/examples/Makefile_cpp",
"dash/examples/*.h",
"dash/examples/ex*/*.h",
"dash/examples/ex*/*.cpp",
"dash/examples/ex*/*.cc",
"dash/examples/ex*/Makefile",
"dash/examples/bench*/*.cpp",
"dash/examples/bench*/*.cc",
"dash/examples/bench*/*.h",
"dash/examples/bench*/Makefile",
"dash/examples/Makefile",
# "dash/examples/CMakeLists.txt",
#
# DASH tests
#
"dash/test/Makefile",
# "dash/test/CMakeLists.txt",
"dash/test/*.h",
"dash/test/*.cc",
"dash/test/*.cpp",
#
# DASH scripts
#
"dash/scripts/*.sh",
"dash/scripts/dashcc/*.in",
#
# Documentation
#
"doc/config/*.dox",
"doc/config/*.in"
);
foreach my $path (@files)
{
foreach my $file (glob($path))
{
my $dirname = dirname("$base/$file");
system("mkdir -p $dirname");
print "copying '$file'\n";
# prepend license file for h,c,cc,cpp files
if( $file =~ /\.(c|h|cc|cpp)$/ && -e "LICENSE" ) {
system("cat ./LICENSE $file > $base/$file");
} else {
system("cp $file $dirname");
}
}
}
# use a fixed date (yesterday) and time to make sure the md5sum
# only depends on the content and not on the time-stamps
my $date = `date +%F --date yesterday`; chomp($date);
$date = $date." 10:02:33";
print "\nCreating tarball and cleaning up... ";
system("cd $rdir; tar --mtime='$date' -cf dash-$version.tar dash-$version/");
system("cd $rdir; touch -d '$date' dash-$version.tar");
system("cd $rdir; gzip -f dash-$version.tar");
system("rm -rf $base");
print "DONE!\n";
if( -e "$base.tar.gz" ) {
my $md5sum = `md5sum $base.tar.gz | cut -d ' ' -f 1`; chomp $md5sum;
my $fsize = `ls -l $base.tar.gz | cut -d ' ' -f 5`; chomp $fsize;
print "\n";
print "DASH $version release built!\n";
print "------------------------------------------------\n";
print "archive : $base.tar.gz\n";
print "md5sum : $md5sum\n";
print "file size : $fsize bytes\n";
print "------------------------------------------------\n";
} else {
print "Something went wrong, check directory '$rdir'\n";
}