diff options
author | G. Galdini <jake@dioniso.com.br> | 2024-03-09 07:36:38 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-03-09 08:04:21 +0700 |
commit | 9c861ccf733c214c422b30a3f17fb3324e9f8348 (patch) | |
tree | 4180e3ed09da95c36fb1b1d15b2f0547d1f067e1 | |
parent | 9de959b5235556e31e75f76efe90d67918450365 (diff) |
network/gmi100: Added (Gemini CLI protocol).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/gmi100/README | 6 | ||||
-rw-r--r-- | network/gmi100/gmi100.1 | 83 | ||||
-rw-r--r-- | network/gmi100/gmi100.SlackBuild | 101 | ||||
-rw-r--r-- | network/gmi100/gmi100.info | 10 | ||||
-rw-r--r-- | network/gmi100/slack-desc | 19 |
5 files changed, 219 insertions, 0 deletions
diff --git a/network/gmi100/README b/network/gmi100/README new file mode 100644 index 0000000000000..e86f3f77a8564 --- /dev/null +++ b/network/gmi100/README @@ -0,0 +1,6 @@ +gmi100 (Gemini CLI protocol client written in 100 lines of ANSI C) + +I tried to pack as much as possible in 100 lines of ANSI C. Initially +I struggled to fit simple TLS connection in such small space but +eventually I ended up with CLI client capable of efficient navigation +between capsules of Gemini space. diff --git a/network/gmi100/gmi100.1 b/network/gmi100/gmi100.1 new file mode 100644 index 0000000000000..51c022e5de58b --- /dev/null +++ b/network/gmi100/gmi100.1 @@ -0,0 +1,83 @@ +.TH GMI100 1 "2024-03-03" +.SH NAME +gmi100 \- Gemini CLI protocol client written in 100 lines of ANSI C. +.SH SYNOPSIS +.B gmi100 +.IR [PAGER] +.SH DESCRIPTION +Other similar Gemini client projects written in few lines of code +successfully shows how simple Gemini protocol is. This code is far from +straight forward. But I had a different goal in mind. + +I tried to pack as much as possible in 100 lines of ANSI C. Initially I +struggled to fit simple TLS connection in such small space but +eventually I ended up with CLI client capable of efficient navigation +between capsules of Gemini space. + +.SH ACTIONS +.TP +.BR "N" +Number of link on current capsule +.TP +.BR "r" +Refresh current capsule +.TP +.BR "u" +Go "up" in URL directory path +.TP +.BR "b" +Go back in browsing history +.TP +.BR "c" +Print current capsule URI +.TP +.BR "q" +Quit +.TP +.BR "?" +Search, geminispace.info/search is used by default +.TP +.BR "!" +Shell command prefixed, run it on current capsule +. +.SH USAGE EXAMPLES +. +.TP +.BR "gmi100 cat" +Using "cat" as pager +.TP +.BR "gmi100> ACTION" +On prompt: execute any action (as above mentioned) +.TP +.BR "gmi100> geminiprotocol.net" +On prompt: go to capsule +.TP +.BR "gmi100> 3" +On prompt: go to link number 3 of current capsule +.TP +.BR "gmi100> !nsxiv" +On prompt: open file of current URL with nsxiv (image) +. +.SH HISTORY +After you run the program it will open or create history .gmi100 file. +Then every page you visits that is not a redirection to other page and +doesn't ask you for input will be appended at the end of history file. +File is never cleaned up by program itself to make history persistent +between sessions but that means cleaning up browsing history is your +responsibility. But this also gives you an control over history file +content. You can for example append some links that you want to visit +in next session to have easier access to them just by running program +and pressing "b" which will navigate to last link from history file. + +During browsing session typing "b" in program prompt for the first time +will result in navigation to last link in history file. Then if you +type "b" again it will open second to last link from history. But it +will also append that link at the end. You can input "b" multiple times +and it will always go back by one link in history and append it at then +end of history file at the same time. Only if you decide to navigate to +other page by typing URL or choosing link number you will break that +cycle. Then history "pointer" will go back to the very bottom of the +history file. + +.SH AUTHOR +irek@gabr.pl diff --git a/network/gmi100/gmi100.SlackBuild b/network/gmi100/gmi100.SlackBuild new file mode 100644 index 0000000000000..55fb39901c661 --- /dev/null +++ b/network/gmi100/gmi100.SlackBuild @@ -0,0 +1,101 @@ +#!/bin/bash + +# Slackware build script for gmi100 + +# Copyright 2024 G. Galdini <jake@dioniso.com.br> Brazil +# 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=gmi100 +VERSION=${VERSION:-20231020_f5c69e3} +COMMIT=f5c69e316781e8d411b46c1d901f3f9fc23f16cf +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" +elif [ "$ARCH" = "aarch64" ]; 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-$COMMIT +tar xvf $CWD/$PRGNAM-$COMMIT.tar.gz +cd $PRGNAM-$COMMIT +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 {} \; + +./build + +mkdir -p $PKG/usr/{bin,man/man1} + +cp $PRGNAM $PKG/usr/bin +cp $CWD/$PRGNAM.1 $PKG/usr/man/man1 + +strip --strip-unneeded $PKG/usr/bin/$PRGNAM +gzip -9 $PKG/usr/man/man?/*.? + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp 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 + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/network/gmi100/gmi100.info b/network/gmi100/gmi100.info new file mode 100644 index 0000000000000..0ee80fef8841f --- /dev/null +++ b/network/gmi100/gmi100.info @@ -0,0 +1,10 @@ +PRGNAM="gmi100" +VERSION="20231020_f5c69e3" +HOMEPAGE="https://github.com/ir33k/gmi100" +DOWNLOAD="https://github.com/ir33k/gmi100/archive/f5c69e3/gmi100-f5c69e316781e8d411b46c1d901f3f9fc23f16cf.tar.gz" +MD5SUM="f73987208cadafb025c7a75b21e9be84" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="G. Galdini" +EMAIL="jake@dioniso.com.br" diff --git a/network/gmi100/slack-desc b/network/gmi100/slack-desc new file mode 100644 index 0000000000000..0d36bc5b0efad --- /dev/null +++ b/network/gmi100/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------------------------------------------------------| +gmi100: gmi100 (Gemini CLI protocol client written in 100 lines of ANSI C) +gmi100: +gmi100: gmi100 has been written by irek <irek@gabr.pl> +gmi100: +gmi100: Homepage: https://github.com/ir33k/gmi100 +gmi100: +gmi100: +gmi100: +gmi100: +gmi100: +gmi100: |