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