| # This script is intended to be used after tagging the repository and updating |
| # the version files for a release. It will create a CPAN archive. Run this |
| # from inside a docker image like ubuntu-xenial. |
| # setup cpan without a prompt |
| cpan install HTTP::Date Log::Log4perl |
| cpan install CPAN::Meta ExtUtils::MakeMaker JSON::PP |
| # cpan install Module::Signature |
| # We unpack the archive so we can add version metadata for CPAN |
| # so that it properly indexes Thrift and remove unnecessary files. |
| echo '-----------------------------------------------------------' |
| DISTFILE=$(ls Thrift*.gz) |
| NEWFILE=${DISTFILE/t-v/t-} |
| if [[ "$DISTFILE" != "$NEWFILE" ]]; then |
| # cpan doesn't like "Thrift-v0.nn.0 as a directory name |
| # needs to be Thrift-0.nn.0 |
| if [[ "$DISTDIR" != "$NEWDIR" ]]; then |
| perl ../tools/FixupDist.pl |
| tar cvzf --hard-dereference $DISTFILE $DISTDIR |