blob: 3b80734f4b45c36d2859edc649a6cdffa7302c23 [file] [log] [blame]
James E. King, IIIf3490c52017-01-27 09:43:18 -05001#!/bin/bash
2#
3# This script is intended to be used after tagging the repository and updating
James E. King, III8101f002017-12-09 10:10:03 -05004# 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
8set -e
9
10rm MANIFEST
11rm -rf Thrift-*
12
13# setup cpan without a prompt
14echo | cpan
15cpan install HTTP::Date
16cpan install CPAN
17cpan install CPAN::Meta ExtUtils::MakeMaker JSON::PP
James E. King, IIIf3490c52017-01-27 09:43:18 -050018
19perl Makefile.PL
James E. King, III8101f002017-12-09 10:10:03 -050020rm MYMETA.yml
James E. King, IIIf3490c52017-01-27 09:43:18 -050021make
22make manifest
23make dist
James E. King, III8101f002017-12-09 10:10:03 -050024
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
30echo '-----------------------------------------------------------'
31set -x
32
33DISTFILE=$(ls Thrift*.gz)
34tar xzf Thrift-*.gz
35rm Thrift-*.gz
36DISTDIR=$(ls -d Thrift*)
37cd $DISTDIR
38perl ../tools/FixupDist.pl
39cd ..
40tar cvzf $DISTFILE $DISTDIR
41rm -r $DISTDIR