#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-libpng rm -rf $PKG mkdir -p $PKG/usr VERSION=1.2.12 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 {} \; # Do *NOT* move this... put here in Slamd64 so that libdir # can be overriden and so that we don't have inline assembly problems # - if you change this, rebuilding libpng will break, and # you'll have to rebuild everything that links to it (e.g. KDE). # Link the custom makefile: ln -sf scripts/makefile.linux ./Makefile # Need this to substitute macros, but we'll keep using the # pre-built Makefile for now anyway... ./configure --prefix=/usr --libdir=/usr/lib64 # Might as well link to -lz -lm, since the ./configure seems # to be doing it that way now... finally. That'll prevent # a couple of emails a week. :-) zcat $CWD/libpng.libs.diff.gz | patch -p1 --verbose || exit 1 make prefix=/usr make install prefix=/usr DESTDIR=$PKG # This symlink is needed to keep old applications running: # I guess the real lib used the major number 3, then 0 for # a short while, and now .3 again. Hopefully it will stay # this way as it was .3 in Slackware 10.2. One can hope. ( cd $PKG/usr/lib64 if [ ! -e libpng.so.0 -a -e libpng.so.3 ]; then ln -sf libpng.so.3 libpng.so.0 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 makepkg -l y -c n ../libpng-$VERSION-$ARCH-$BUILD.tgz