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 | |
James E. King III | cea5075 | 2017-12-12 18:41:40 -0500 | [diff] [blame] | 10 | rm -f MANIFEST |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 11 | rm -rf Thrift-* |
| 12 | |
| 13 | # setup cpan without a prompt |
| 14 | echo | cpan |
James E. King III | bbc1377 | 2019-01-14 12:07:10 -0500 | [diff] [blame] | 15 | cpan install HTTP::Date Log::Log4perl |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 16 | cpan install CPAN |
| 17 | cpan install CPAN::Meta ExtUtils::MakeMaker JSON::PP |
James E. King III | bbc1377 | 2019-01-14 12:07:10 -0500 | [diff] [blame] | 18 | # cpan install Module::Signature |
James E. King, III | f3490c5 | 2017-01-27 09:43:18 -0500 | [diff] [blame] | 19 | |
| 20 | perl Makefile.PL |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 21 | rm MYMETA.yml |
James E. King, III | f3490c5 | 2017-01-27 09:43:18 -0500 | [diff] [blame] | 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) |
James E. King III | cea5075 | 2017-12-12 18:41:40 -0500 | [diff] [blame] | 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 |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 41 | DISTDIR=$(ls -d Thrift*) |
James E. King III | 23dde8c | 2018-01-24 14:50:10 -0500 | [diff] [blame] | 42 | # cpan doesn't like "Thrift-v0.nn.0 as a directory name |
| 43 | # needs to be Thrift-0.nn.0 |
James E. King III | cea5075 | 2017-12-12 18:41:40 -0500 | [diff] [blame] | 44 | NEWDIR=${DISTDIR/t-v/t-} |
| 45 | if [[ "$DISTDIR" != "$NEWDIR" ]]; then |
| 46 | mv $DISTDIR $NEWDIR |
| 47 | DISTDIR="$NEWDIR" |
| 48 | fi |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 49 | cd $DISTDIR |
James E. King III | 23dde8c | 2018-01-24 14:50:10 -0500 | [diff] [blame] | 50 | cp -p ../Makefile.PL . |
James E. King III | bbc1377 | 2019-01-14 12:07:10 -0500 | [diff] [blame] | 51 | cp -pr ../gen-perl . |
| 52 | cp -pr ../gen-perl2 . |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 53 | perl ../tools/FixupDist.pl |
| 54 | cd .. |
Jens Geyer | 224b43e | 2019-10-09 00:03:11 +0200 | [diff] [blame] | 55 | tar cvzf --hard-dereference $DISTFILE $DISTDIR |
James E. King, III | 8101f00 | 2017-12-09 10:10:03 -0500 | [diff] [blame] | 56 | rm -r $DISTDIR |