Skip to content

Commit

Permalink
optipng: upgraded to 0.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
conraid committed Apr 5, 2016
1 parent 72a7183 commit 4b4820f
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 82 deletions.
2 changes: 1 addition & 1 deletion optipng/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Slackware Current Repository by Conraid
Slackware Current Repository by Conraid

======================================================================

Expand Down
129 changes: 53 additions & 76 deletions optipng/optipng.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,121 +2,98 @@
#
# Slackware build script for optipng
#
# Copyright 2013-2014 Corrado Franco (http://conraid.net)
# Copyright 2013-2016 Corrado Franco (http://conraid.net)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version, with the following exception:
# the text of the GPL license may be omitted.

# This program is distributed in the hope that it will be useful, but
# without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose. Compiling,
# interpreting, executing or merely reading the text of the program
# may result in lapses of consciousness and/or very being, up to and
# including the end of all existence and the Universe as we know it.
# See the GNU General Public License for more details.

# You may have received a copy of the GNU General Public License along
# with this program (most likely, a file named COPYING). If not, see
# <http://www.gnu.org/licenses/>.
#
# Latest version of this SlackBuild at http://slackers.it/repository
# Latest version of this SlackBuild at https://github.com/conraid/SlackBuilds
#
# Exit on most errors or unset variables
set -eu

# Set variables:
CWD=$(pwd)

PRGNAME=${PRGNAME:-optipng}
PKGNAME=$(echo $PRGNAME | tr A-Z a-z)
VERSION=${VERSION:-0.7.5}
PKGVERSION=$(echo $VERSION | tr - _)
PRGNAM=optipng
VERSION=${VERSION:-0.7.6}
BUILD=${BUILD:-1}
TAG=${TAG:-cf}
TMP=${TMP:-/tmp/pkg}
PKG=$TMP/package-$PKGNAME
DOCS="$PKG/usr/doc/$PKGNAME-$PKGVERSION"
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

# Insert document files in this variable
DOCFILES="*.txt doc/*"

ARCH=${ARCH:=""} # Set ARCH or leave blank to determine it automatically
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
if [ -z ${ARCH:=""} ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC -pipe -fomit-frame-pointer"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi

# Set compiling FLAGS
case "$ARCH" in
i[3-5]86)
SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686"; CHOST="i486"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
i686)
SLKCFLAGS="-O2 -march=i686 -pipe -fomit-frame-pointer"; CHOST="i486"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
x86_64)
SLKCFLAGS="-O2 -fPIC -pipe -fomit-frame-pointer"; CHOST="x86_64"
SLKLDFLAGS="-L/lib64 -L/usr/lib64"; LIBDIRSUFFIX="64"
;;
*)
SLKCFLAGS="-O2"; CHOST=$ARCH
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
esac

# Extract source and prepare:
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PRGNAME-$VERSION
tar xvf $CWD/$PRGNAME-$VERSION.tar.gz
cd $PRGNAME-$VERSION
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION

# Make sure ownerships and permissions are sane:
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Configure
LDFLAGS="$SLKLDFLAGS" \
LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
CFLAGS="$SLKCFLAGS" \
./configure \
-prefix=/usr \
-mandir=/usr/man \
-with-system-zlib \

# Build and install:
make CFLAGS="$SLKCFLAGS -W -Wall" -C src
make install DESTDIR=$PKG prefix=/usr -C src

# Strip binaries:
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true

# Compress and link manpages, if any:
if [ -d $PKG/usr/man ]; then
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
fi

# Add a documentation directory:
mkdir -p ${DOCS}
cp -a $DOCFILES $DOCS || true

# Add a slackbuild script:
install -Dm644 $CWD/$PKGNAME.SlackBuild $DOCS/$PKGNAME.SlackBuild
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION || true
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Add slack-desc
install -Dm644 $CWD/slack-desc $PKG/install/slack-desc
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Create package:
cd $PKG
/sbin/makepkg -l y -c n $CWD/$PKGNAME-$PKGVERSION-$ARCH-${BUILD}${TAG}.txz
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD${TAG}.txz
10 changes: 5 additions & 5 deletions optipng/optipng.info
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PRGNAM="optipng"
VERSION="0.7.5"
VERSION="0.7.6"
HOMEPAGE="http://optipng.sourceforge.net/"
DOWNLOAD="http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.5/optipng-0.7.5.tar.gz"
FILENAME="optipng-0.7.5.tar.gz"
DOWNLOAD="http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz"
FILENAME="optipng-0.7.6.tar.gz"
REQUIRES=""
MD5SUM="90ac1ec7945d48c0e9859b977b5df411"
SHASUM="30b6c333d74fc0f5dc83004aace252fa3321368b"
MD5SUM="568e0738358450eca69ecf578d48f26c"
SHASUM="3b3e31430e735589470c4af204354d38823f4989"
MAINTAINER="Corrado Franco"
EMAIL="conraid (at) linux (dot) it"

0 comments on commit 4b4820f

Please sign in to comment.