summaryrefslogtreecommitdiffstats
path: root/graphics/gcolor2/gcolor2.SlackBuild
diff options
context:
space:
mode:
author Dominik Drobek2020-01-12 00:49:04 +0100
committer Willy Sudiarto Raharjo2020-01-12 16:13:57 +0100
commitba14d4c733eec4d0ccdd4783e0ec3eb9a4c35317 (patch)
tree8bca49a253677834900722c91b033791e094aa11 /graphics/gcolor2/gcolor2.SlackBuild
parent3672e52cf9ce23c0e32dfe432f967c3e99fc8340 (diff)
downloadslackbuilds-ba14d4c733eec4d0ccdd4783e0ec3eb9a4c35317.tar.gz
graphics/gcolor2: Changed category, updated script
Added license and aligned SlackBuild script with the SBo template. Added SVG icon, and made doinst.sh update the icon cache. Changed source URL to gzip-compressed tarball. Category is changed from "misc" to "graphics", as it seems more appropriate. This change is also reflected in the .desktop file. Old Debian patches are dropped, and more up-to-date Gentoo patch is used instead. rgb.txt patch is renamed. Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics/gcolor2/gcolor2.SlackBuild')
-rw-r--r--graphics/gcolor2/gcolor2.SlackBuild108
1 files changed, 108 insertions, 0 deletions
diff --git a/graphics/gcolor2/gcolor2.SlackBuild b/graphics/gcolor2/gcolor2.SlackBuild
new file mode 100644
index 0000000000..abde646cf7
--- /dev/null
+++ b/graphics/gcolor2/gcolor2.SlackBuild
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# Slackware build script for gcolor2
+#
+# Copyright 2010, 2011 slakmagik <slakmagik@gmail.com>
+# Copyright 2020 Dominik Drobek <dominik.drobek (at) o2.pl>
+# 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=gcolor2
+VERSION=${VERSION:-0.4}
+BUILD=${BUILD:-4}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+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"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# add path to rgb.txt color definitions provided by X11:
+patch -p1 < $CWD/color_definition_path.patch
+# fix segfaults on x86_64 and remove some compilation warnings:
+patch -p1 < $CWD/amd64_segfault.patch
+# correct character class definition in configure script:
+sed -i '/gentoo_ltmain_version/s/\[:space:\]/[&]/g' configure
+
+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 -m 644 $CWD/$PRGNAM.svg $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg
+install -D -m 644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
+
+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
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS ChangeLog COPYING INSTALL $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+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}