graphics/mtpaint: Miscellaneous cleanups and a bugfix

Fix indentation. Move the sed before configuring, just as if it were a
patch. Remove useless strip and compress code and comment why. Make the
handbook handling better via an 'else' but also fix a bug where we were
in the wrong directory and copied the wrong COPYING/README files and
missed NEWS altogether. Now cd in a subshell and grab that COPYING as
COPYING.handbook. Bump BUILD because of this.

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
slakmagik 2011-01-28 23:10:34 -05:00 committed by Robby Workman
parent c4ada05295
commit 526942b9da
1 changed files with 15 additions and 18 deletions

View File

@ -6,7 +6,7 @@
PRGNAM=mtpaint
VERSION=${VERSION:-3.31}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -37,14 +37,15 @@ else
fi
if [ "$GTK1" = yes ]; then
GTK1=gtk1
GTK1=gtk1
fi
if [ "$TKWIDGETS" = yes ]; then
TKWIDGETS="gtkfilesel gtkcolsel"
TKWIDGETS="gtkfilesel gtkcolsel"
fi
if [ "$INTL" = yes ]; then
INTL=intl
INTL=intl
fi
HANDBOOK=${HANDBOOK:-no}
set -e
@ -61,31 +62,25 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
-o -perm 400 \) -exec chmod 644 {} \;
# bring deprecated function call into conformance with libpng14
sed -i~ 's/png_set_gray_1_2_4_to_8/png_set_expand_gray_1_2_4_to_8/' src/png.c
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure cflags man $GTK1 $TKWIDGETS $INTL \
--prefix=/usr \
--mandir=/usr/man/man1 \
--docdir=/usr/doc/$PRGNAM-$VERSION
# bring deprecated function call into conformance with libpng14
sed -i~ 's/png_set_gray_1_2_4_to_8/png_set_expand_gray_1_2_4_to_8/' src/png.c
# mtpaint autostrips the binary and autocompresses the manpage but doesn't
# automatically create the viewer link
make
make DESTDIR=$PKG install
(cd $PKG/usr/bin && ln -s mtpaint mtv)
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
# go ahead and make this in case the handbook is skipped
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
if [ "$HANDBOOK" = yes ]; then
unzip $CWD/${PRGNAM}_handbook-$VERSION.zip
cd ${PRGNAM}_handbook-$VERSION
unzip $CWD/${PRGNAM}_handbook-$VERSION.zip
( cd ${PRGNAM}_handbook-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@ -93,8 +88,10 @@ if [ "$HANDBOOK" = yes ]; then
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
-o -perm 400 \) -exec chmod 644 {} \;
make DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION install
cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION/COPYING.handbook )
else
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
fi
cp -a [CNR]* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild