From aa0bae77499378280fceaf945ca66925a519d4bf Mon Sep 17 00:00:00 2001 From: Steven Voges Date: Thu, 11 May 2023 21:40:30 +0100 Subject: misc/pokemon-colorscripts: Added (Pokemon terminal images) Signed-off-by: bedlam Signed-off-by: Willy Sudiarto Raharjo --- misc/pokemon-colorscripts/README | 31 ++++++ misc/pokemon-colorscripts/doinst.sh | 25 +++++ .../pokemon-colorscripts-login.sh | 10 ++ .../pokemon-colorscripts.SlackBuild | 112 +++++++++++++++++++++ .../pokemon-colorscripts/pokemon-colorscripts.info | 10 ++ misc/pokemon-colorscripts/slack-desc | 19 ++++ 6 files changed, 207 insertions(+) create mode 100644 misc/pokemon-colorscripts/README create mode 100644 misc/pokemon-colorscripts/doinst.sh create mode 100644 misc/pokemon-colorscripts/pokemon-colorscripts-login.sh create mode 100644 misc/pokemon-colorscripts/pokemon-colorscripts.SlackBuild create mode 100644 misc/pokemon-colorscripts/pokemon-colorscripts.info create mode 100644 misc/pokemon-colorscripts/slack-desc (limited to 'misc') diff --git a/misc/pokemon-colorscripts/README b/misc/pokemon-colorscripts/README new file mode 100644 index 000000000000..7d9ae4ef09b3 --- /dev/null +++ b/misc/pokemon-colorscripts/README @@ -0,0 +1,31 @@ +Prints out colored unicode sprites of pokémon onto your terminal. +Contains almost 900 pokémon from gen 1 to gen 8. Has all the pokémons +you could ever want, including shinies and alternate forms (okay it's +still missing some female forms but cut me some slack). + +The program requires python3 to run and a terminal with true color +support, which most modern terminals have. + +You can run the program from the command line to either display a +pokémon of your choice by specifying the pokémon name or make it +display a random pokémon. + +The program itself is a simple python script that prints out text +files corresponding to the relevant pokémon or a randomly selected +pokémon. The sprites are simple text files that use unicode characters +and ANSI color codes to display images of pokémon. The text sprite +files can be found in the colorscripts folder. The files were +generated using sprites taken from PokéSprite as the base and +converted to unicode sprites using custom scripts that can be found at +https://gitlab.com/phoneybadger/pokémon-generator-scripts + +You can display a random pokémon whenever a terminal gets launched by +adding the "pokemon-colorscripts" -r command to your .bashrc or +.zshrc, or by chmoding the provided shell script to be executable: + + # chmod +x /etc/profile.d/pokemon-colorscripts-login.sh + +You may also choose to disable Slackware's default fortune script by +disabling execution with chmod: + + # chmod -x /etc/profile.d/bsd-games-login-fortune.sh diff --git a/misc/pokemon-colorscripts/doinst.sh b/misc/pokemon-colorscripts/doinst.sh new file mode 100644 index 000000000000..2b7a395946dc --- /dev/null +++ b/misc/pokemon-colorscripts/doinst.sh @@ -0,0 +1,25 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/profile.d/pokemon-colorscripts-login.sh.new diff --git a/misc/pokemon-colorscripts/pokemon-colorscripts-login.sh b/misc/pokemon-colorscripts/pokemon-colorscripts-login.sh new file mode 100644 index 000000000000..952b2fda0fd5 --- /dev/null +++ b/misc/pokemon-colorscripts/pokemon-colorscripts-login.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Print a random pokemon for interactive shells: + +case $- in +*i* ) # We're interactive + echo + pokemon-colorscripts -r + echo + ;; +esac diff --git a/misc/pokemon-colorscripts/pokemon-colorscripts.SlackBuild b/misc/pokemon-colorscripts/pokemon-colorscripts.SlackBuild new file mode 100644 index 000000000000..017885671a24 --- /dev/null +++ b/misc/pokemon-colorscripts/pokemon-colorscripts.SlackBuild @@ -0,0 +1,112 @@ +#!/bin/bash + +# Slackware build script for pokemon-colorscripts + +# Copyright 2023 Steven Voges +# 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. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=pokemon-colorscripts +VERSION=${VERSION:-20221028_0483c85} +SRCVER=${SRCVER:-0483c85b93362637bdd0632056ff986c07f30868} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +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-$SRCVER +tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz +cd $PRGNAM-$SRCVER +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 {} \; + +mkdir -p $PKG/usr/bin +install -vDm755 ${PRGNAM}.py $PKG/usr/share/$PRGNAM/${PRGNAM}.py +install -vDm644 pokemon.json $PKG/usr/share/$PRGNAM/pokemon.json +install -vDm644 $CWD/${PRGNAM}-login.sh $PKG/etc/profile.d/${PRGNAM}-login.sh.new +install -vDm644 colorscripts/small/regular/* -t \ + $PKG/usr/share/$PRGNAM/colorscripts/small/regular +install -vDm644 colorscripts/small/shiny/* -t \ + $PKG/usr/share/$PRGNAM/colorscripts/small/shiny +install -vDm644 colorscripts/large/regular/* -t \ + $PKG/usr/share/$PRGNAM/colorscripts/large/regular +install -vDm644 colorscripts/large/shiny/* -t \ + $PKG/usr/share/$PRGNAM/colorscripts/large/shiny +install -vDm644 ${PRGNAM}.1 $PKG/usr/man/man1/${PRGNAM}.1 +ln -s ../share/$PRGNAM/${PRGNAM}.py $PKG/usr/bin/$PRGNAM + +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 \ + LICENSE.txt README.md \ + $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 diff --git a/misc/pokemon-colorscripts/pokemon-colorscripts.info b/misc/pokemon-colorscripts/pokemon-colorscripts.info new file mode 100644 index 000000000000..feb9e1c4dd8e --- /dev/null +++ b/misc/pokemon-colorscripts/pokemon-colorscripts.info @@ -0,0 +1,10 @@ +PRGNAM="pokemon-colorscripts" +VERSION="20221028_0483c85" +HOMEPAGE="https://gitlab.com/phoneybadger/pokemon-colorscripts" +DOWNLOAD="https://gitlab.com/phoneybadger/pokemon-colorscripts/-/archive/0483c85b93362637bdd0632056ff986c07f30868/pokemon-colorscripts-0483c85b93362637bdd0632056ff986c07f30868.tar.gz" +MD5SUM="0a8caa8cd6ac3fbd04b04fd104117adc" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Steven Voges" +EMAIL="svoges.sbo@gmail.com" diff --git a/misc/pokemon-colorscripts/slack-desc b/misc/pokemon-colorscripts/slack-desc new file mode 100644 index 000000000000..f249ccc9cb11 --- /dev/null +++ b/misc/pokemon-colorscripts/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +pokemon-colorscripts: pokemon-colorscripts (Pokemon terminal images) +pokemon-colorscripts: +pokemon-colorscripts: A script to print out images of pokemon to the terminal. Inspired by +pokemon-colorscripts: DT's colorscripts compilation. +pokemon-colorscripts: +pokemon-colorscripts: Homepage: https://gitlab.com/phoneybadger/pokemon-colorscripts +pokemon-colorscripts: +pokemon-colorscripts: +pokemon-colorscripts: +pokemon-colorscripts: +pokemon-colorscripts: -- cgit v1.2.3