1#!/bin/sh 2 3set -u 4set -e 5trap onexit INT 6trap onexit TERM 7trap onexit EXIT 8 9TMPDIR= 10 11onexit() 12{ 13 if [ ! "$TMPDIR" = "" ]; then 14 rm -rf $TMPDIR 15 fi 16} 17 18PACKAGE_NAME=@PKGNAME@ 19VERSION=@VERSION@ 20BUILD=@BUILD@ 21SRCDIR=@abs_top_srcdir@ 22 23PREFIX=%{__prefix} 24DOCDIR=%{__docdir} 25LIBDIR=%{__libdir} 26 27umask 022 28rm -f $PACKAGE_NAME-$VERSION-$BUILD.tar.bz2 29TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX` 30__PWD=`pwd` 31make install DESTDIR=$TMPDIR/pkg docdir=/usr/share/doc/$PACKAGE_NAME-$VERSION \ 32 exampledir=/usr/share/doc/$PACKAGE_NAME-$VERSION 33rm $TMPDIR/pkg$LIBDIR/*.la 34if [ "$PREFIX" = "/opt/libjpeg-turbo" -a "$DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then 35 ln -fs /usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/pkg$DOCDIR 36fi 37cd $TMPDIR/pkg 38tar cfj ../$PACKAGE_NAME-$VERSION-$BUILD.tar.bz2 * 39cd $__PWD 40mv $TMPDIR/*.tar.bz2 . 41 42exit 0 43