diff options
author | Petar Petrov <ppetrov@paju.oulu.fi> | 2013-06-03 16:27:37 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-06-04 00:11:33 -0500 |
commit | 9a1f447dfc912da1dbb9c656ee1ab54cbb8af686 (patch) | |
tree | bc879b2ab623028224152b9220dc3958633e8a8f /graphics/gpaint/gpaint.SlackBuild | |
parent | bf4ab6962d0aa471d1906c66041b0f45f8e0391f (diff) |
graphics/gpaint: Added (GNU Paint: a small-scale GTK2 painting program)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'graphics/gpaint/gpaint.SlackBuild')
-rw-r--r-- | graphics/gpaint/gpaint.SlackBuild | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/graphics/gpaint/gpaint.SlackBuild b/graphics/gpaint/gpaint.SlackBuild new file mode 100644 index 000000000000..76c486b6c27e --- /dev/null +++ b/graphics/gpaint/gpaint.SlackBuild @@ -0,0 +1,124 @@ +#!/bin/sh + +# Slackware build script for gpaint + +# Copyright 2013 Petar Petrov, ppetrov@paju.oulu.fi +# 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. + +PRGNAM=gpaint +VERSION=${VERSION:-0.3.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-2-$VERSION +tar xvf $CWD/${PRGNAM}_${VERSION}.orig.tar.gz +cd $PRGNAM-2-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Thanks to Debian for the patches! And the man page and icon! And the +# whole source tarball, actually... +patch -p1 -i $CWD/patches/01_drawing.patch +patch -p1 -i $CWD/patches/02_remove_menu_h_reference.patch +patch -p1 -i $CWD/patches/09_fix_menu_entry.patch +patch -p1 -i $CWD/patches/10_fix_crash_on_font_select.patch +patch -p1 -i $CWD/patches/11_fix_image_rotation.patch +patch -p1 -i $CWD/patches/20_fix_line_width_combo.patch +patch -p1 -i $CWD/patches/21_fix_crash_on_fill_button_click.patch +patch -p1 -i $CWD/patches/22_fix_not_printable_string.patch +patch -p1 -i $CWD/patches/23_add_accelerator_keys.patch +patch -p1 -i $CWD/patches/24_fix_crash_on_failed_write.patch +patch -p1 -i $CWD/patches/25_fix_color_selection.patch +patch -p1 -i $CWD/patches/26_fix_toolbar.patch + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +install -D -m644 $CWD/$PRGNAM.1 $PKG/usr/man/man1/$PRGNAM.1 + +find $PKG -print0 | xargs -0 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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + AUTHORS ChangeLog COPYING INSTALL NEWS README THANKS TODO \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +# Menu item and icon +mkdir -p $PKG/usr/share/{applications,pixmaps} +cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications +cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |