rendered paste body#!/bin/sh
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-libpng
rm -rf $PKG
mkdir -p $PKG/usr
VERSION=1.2.10
ARCH=${ARCH:-x86_64}
BUILD=3
cd $TMP
rm -rf libpng-$VERSION
tar xjvf $CWD/libpng-$VERSION.tar.bz2
cd libpng-$VERSION
chown -R root.root .
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
ln -sf scripts/makefile.linux ./Makefile
./configure --prefix=/usr --libdir=/usr/lib64
make -j60 prefix=/usr
make install prefix=/usr DESTDIR=$PKG
#mv $PKG/usr/lib $PKG/usr/lib64
# This symlink is needed to keep old applications running:
( cd $PKG/usr/lib64
if [ ! -e libgpng.so.3 -a -e libpng.so.0 ]; then
ln -sf libpng.so.0 libpng.so.3
fi
)
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
gzip -9 $PKG/usr/man/man?/*
mkdir -p $PKG/usr/doc/libpng-$VERSION
cp -a \
ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt example.c \
$PKG/usr/doc/libpng-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
if [ -d usr/lib64/pkgconfig ]; then
mkdir -p usr/lib
mv usr/lib64/pkgconfig usr/lib/
fi
makepkg -l y -c n ../libpng-$VERSION-$ARCH-$BUILD.tgz
~