]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | #!/bin/bash |
2 | # | |
3 | # This script is intended to be used after tagging the repository and updating | |
4 | # the version files for a release. It will create a CPAN archive. Run this | |
5 | # from inside a docker image like ubuntu-xenial. | |
6 | # | |
7 | ||
8 | set -e | |
9 | ||
10 | rm -f MANIFEST | |
11 | rm -rf Thrift-* | |
12 | ||
13 | # setup cpan without a prompt | |
14 | echo | cpan | |
15 | cpan install HTTP::Date Log::Log4perl | |
16 | cpan install CPAN | |
17 | cpan install CPAN::Meta ExtUtils::MakeMaker JSON::PP | |
18 | # cpan install Module::Signature | |
19 | ||
20 | perl Makefile.PL | |
21 | rm MYMETA.yml | |
22 | make manifest | |
23 | make dist | |
24 | ||
25 | # | |
26 | # We unpack the archive so we can add version metadata for CPAN | |
27 | # so that it properly indexes Thrift and remove unnecessary files. | |
28 | # | |
29 | ||
30 | echo '-----------------------------------------------------------' | |
31 | set -x | |
32 | ||
33 | DISTFILE=$(ls Thrift*.gz) | |
34 | NEWFILE=${DISTFILE/t-v/t-} | |
35 | if [[ "$DISTFILE" != "$NEWFILE" ]]; then | |
36 | mv $DISTFILE $NEWFILE | |
37 | DISTFILE="$NEWFILE" | |
38 | fi | |
39 | tar xzf $DISTFILE | |
40 | rm $DISTFILE | |
41 | DISTDIR=$(ls -d Thrift*) | |
42 | # cpan doesn't like "Thrift-v0.nn.0 as a directory name | |
43 | # needs to be Thrift-0.nn.0 | |
44 | NEWDIR=${DISTDIR/t-v/t-} | |
45 | if [[ "$DISTDIR" != "$NEWDIR" ]]; then | |
46 | mv $DISTDIR $NEWDIR | |
47 | DISTDIR="$NEWDIR" | |
48 | fi | |
49 | cd $DISTDIR | |
50 | cp -p ../Makefile.PL . | |
51 | cp -pr ../gen-perl . | |
52 | cp -pr ../gen-perl2 . | |
53 | perl ../tools/FixupDist.pl | |
54 | cd .. | |
55 | tar cvzf --hard-dereference $DISTFILE $DISTDIR | |
56 | rm -r $DISTDIR |