[c5c522c] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | # Copyright 2013 Patrick J. Volkerding, Sebeka, MN, USA |
---|
| 4 | # All rights reserved. |
---|
| 5 | # |
---|
| 6 | # Redistribution and use of this script, with or without modification, is |
---|
| 7 | # permitted provided that the following conditions are met: |
---|
| 8 | # |
---|
| 9 | # 1. Redistributions of this script must retain the above copyright |
---|
| 10 | # notice, this list of conditions and the following disclaimer. |
---|
| 11 | # |
---|
| 12 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
---|
| 13 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
| 14 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
---|
| 15 | # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 16 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 17 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
---|
| 18 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
---|
| 19 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
| 20 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
---|
| 21 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 22 | |
---|
| 23 | # Remove the reference PNG files from the cairo source tarball. |
---|
| 24 | # These are used only for build time testing, and cairo always fails |
---|
| 25 | # a large number of tests, making these files more or less useless to |
---|
| 26 | # the average end user. If you really need them for some reason, you |
---|
| 27 | # can fetch the original tarball from cairographics.org. |
---|
| 28 | # |
---|
| 29 | # Removing these files reduces the size of the source tarball by 93%. |
---|
| 30 | |
---|
| 31 | PKGNAM=cairo |
---|
| 32 | VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} |
---|
| 33 | |
---|
| 34 | if [ ! -r $PKGNAM-$VERSION.tar.xz ]; then |
---|
| 35 | echo "$PKGNAM-$VERSION.tar.xz is not a cairo tarball. Exiting." |
---|
| 36 | exit 1 |
---|
| 37 | fi |
---|
| 38 | |
---|
| 39 | touch -r $PKGNAM-$VERSION.tar.xz tmp-timestamp || exit 1 |
---|
| 40 | |
---|
| 41 | rm -rf $PKGNAM-$VERSION |
---|
| 42 | tar xvf $PKGNAM-$VERSION.tar.xz || exit 1 |
---|
| 43 | rm -f $PKGNAM-$VERSION/test/reference/* |
---|
| 44 | rm -f $PKGNAM-$VERSION.tar.xz |
---|
| 45 | tar cvf $PKGNAM-$VERSION.tar $PKGNAM-$VERSION |
---|
| 46 | touch -r tmp-timestamp $PKGNAM-$VERSION.tar |
---|
| 47 | xz -9 -v $PKGNAM-$VERSION.tar |
---|
| 48 | rm -rf $PKGNAM-$VERSION tmp-timestamp |
---|
| 49 | |
---|
| 50 | echo "Repacking of $PKGNAM-$VERSION.tar.xz complete." |
---|
| 51 | |
---|