James E. King, III | f3490c5 | 2017-01-27 09:43:18 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # This script is intended to be used after tagging the repository and updating |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame^] | 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 MANIFEST |
| 11 | rm -rf Thrift-* |
| 12 | |
| 13 | # setup cpan without a prompt |
| 14 | echo | cpan |
| 15 | cpan install HTTP::Date |
| 16 | cpan install CPAN |
| 17 | cpan install CPAN::Meta ExtUtils::MakeMaker JSON::PP |
James E. King, III | f3490c5 | 2017-01-27 09:43:18 -0500 | [diff] [blame] | 18 | |
| 19 | perl Makefile.PL |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame^] | 20 | rm MYMETA.yml |
James E. King, III | f3490c5 | 2017-01-27 09:43:18 -0500 | [diff] [blame] | 21 | make |
| 22 | make manifest |
| 23 | make dist |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame^] | 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 | tar xzf Thrift-*.gz |
| 35 | rm Thrift-*.gz |
| 36 | DISTDIR=$(ls -d Thrift*) |
| 37 | cd $DISTDIR |
| 38 | perl ../tools/FixupDist.pl |
| 39 | cd .. |
| 40 | tar cvzf $DISTFILE $DISTDIR |
| 41 | rm -r $DISTDIR |