#!/bin/bash
#
# Remove documentation files from source archives 
# 
# Copyright (c) 2013 Andreas Stieger <andreas.stieger@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#

XTRABACKUP_VERSION=2.1.3
MYSQL51_VERSION=5.1.59
MYSQL55_VERSION=5.5.17
MYSQL56_VERSION=5.6.10

gunzip -v < percona-xtrabackup-${XTRABACKUP_VERSION}.tar.gz > percona-xtrabackup-${XTRABACKUP_VERSION}.tar && \
tar -v --delete -f percona-xtrabackup-${XTRABACKUP_VERSION}.tar "percona-xtrabackup-${XTRABACKUP_VERSION}/doc" && \
mv -v percona-xtrabackup-${XTRABACKUP_VERSION}.tar percona-xtrabackup-${XTRABACKUP_VERSION}-nodoc.tar && \
gzip -v percona-xtrabackup-${XTRABACKUP_VERSION}-nodoc.tar

gunzip < mysql-${MYSQL51_VERSION}.tar.gz > mysql-${MYSQL51_VERSION}.tar && \
tar -v --delete -f mysql-${MYSQL51_VERSION}.tar "mysql-${MYSQL51_VERSION}/Docs" && \
mv -v mysql-${MYSQL51_VERSION}.tar mysql-${MYSQL51_VERSION}-nodoc.tar && \
gzip -v mysql-${MYSQL51_VERSION}-nodoc.tar

gunzip < mysql-${MYSQL55_VERSION}.tar.gz > mysql-${MYSQL55_VERSION}.tar && \
tar -v --delete -f mysql-${MYSQL55_VERSION}.tar "mysql-${MYSQL55_VERSION}/Docs" && \
mv -v mysql-${MYSQL55_VERSION}.tar mysql-${MYSQL55_VERSION}-nodoc.tar && \
gzip -v mysql-${MYSQL55_VERSION}-nodoc.tar

gunzip < mysql-${MYSQL56_VERSION}.tar.gz > mysql-${MYSQL56_VERSION}.tar && \
tar -v --delete -f mysql-${MYSQL56_VERSION}.tar "mysql-${MYSQL56_VERSION}/Docs" && \
mv -v mysql-${MYSQL56_VERSION}.tar mysql-${MYSQL56_VERSION}-nodoc.tar && \
gzip -v mysql-${MYSQL56_VERSION}-nodoc.tar


