diff options
author | Slack Coder <slackcoder@server.ky> | 2025-07-18 11:16:10 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2025-07-20 14:42:29 -0500 |
commit | 0fed111f691bc06dab097d07e7f6c73ae2e090ab (patch) | |
tree | 42310c4839e522f3fe1063ce7a76c3ca8237584c | |
parent | 4a5b937da54351d9cac3475954852d9964c9c268 (diff) | |
download | slackbuilds-0fed111f691bc06dab097d07e7f6c73ae2e090ab.tar.xz |
Add galileo 0.3
Galileo is a gemini proxy.
-rw-r--r-- | galileo/README | 25 | ||||
-rw-r--r-- | galileo/doinst.sh | 25 | ||||
-rw-r--r-- | galileo/file/galileo-apache.conf | 42 | ||||
-rw-r--r-- | galileo/file/galileo.conf.new | 3 | ||||
-rw-r--r-- | galileo/galileo.SlackBuild | 86 | ||||
-rw-r--r-- | galileo/galileo.info | 10 | ||||
-rw-r--r-- | galileo/patch/0001-Fix-socket-configuration.patch | 36 | ||||
-rw-r--r-- | galileo/patch/0002-configure-allow-setting-mandir-prefix.patch | 89 | ||||
-rw-r--r-- | galileo/slack-desc | 19 | ||||
-rw-r--r-- | mirror/mirror.toml | 1 |
10 files changed, 335 insertions, 1 deletions
diff --git a/galileo/README b/galileo/README new file mode 100644 index 0000000..4cb495b --- /dev/null +++ b/galileo/README @@ -0,0 +1,25 @@ +Galileo is a FastCGI server that proxies the content of a Gemini capsule +to the World Wide Web. It has been designed to work out of the box with +the OpenBSD httpd(8) web server, but it's known to work also with nginx +and lighttpd. + +The program runs as the user 'apache'. You may change this during build +time, for example: + + GALILEO_USER=apache ./galileo.SlackBuild + +To have the galileo daemon start and stop with your host, add to +/etc/rc.d/rc.local: + + if [ -x /etc/rc.d/rc.galileo ]; then + /etc/rc.d/rc.galileo start + fi + +and to /etc/rc.d/rc.local_shutdown (creating it if needed): + + if [ -x /etc/rc.d/rc.galileo ]; then + /etc/rc.d/rc.galileo stop + fi + +You will find sample HTTP configuration in the application's +documentation directory. diff --git a/galileo/doinst.sh b/galileo/doinst.sh new file mode 100644 index 0000000..dc77396 --- /dev/null +++ b/galileo/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/galileo.conf.new diff --git a/galileo/file/galileo-apache.conf b/galileo/file/galileo-apache.conf new file mode 100644 index 0000000..af57baf --- /dev/null +++ b/galileo/file/galileo-apache.conf @@ -0,0 +1,42 @@ +<VirtualHost _default_:80> + ServerName gemini.example.com + + ProxyPass /.well-known ! + Alias /.well-known/acme-challenge /var/www/dehydrated + <Directory /var/www/dehydrated> + Options None + AllowOverride None + Require all granted + </Directory> + + # Galileo expects the stylesheet here. + Alias /galileo.css /srv/httpd/htdocs/galileo.css + ProxyPass /galileo.css ! + + SetEnvIf Request_URI . proxy-fcgi-pathinfo=other + ProxyPass "/" "unix:/run/galileo.sock|fcgi://localhost/" enablereuse=on +</VirtualHost> + +<VirtualHost _default_:443> + ServerName gemini.example.com + + ProxyPass /.well-known ! + Alias /.well-known/acme-challenge /var/www/dehydrated + <Directory /var/www/dehydrated> + Options None + AllowOverride None + Require all granted + </Directory> + + # Galileo expects the stylesheet here. + Alias /galileo.css /srv/httpd/htdocs/galileo.css + ProxyPass /galileo.css ! + + SetEnvIf Request_URI . proxy-fcgi-pathinfo=other + ProxyPass "/" "unix:/run/galileo.sock|fcgi://localhost/" enablereuse=on + + SSLEngine on + SSLCertificateFile "/etc/dehydrated/certs/gemini.example.com/cert.pem" + SSLCertificateKeyFile "/etc/dehydrated/certs/gemini.example.com/privkey.pem" + SSLCertificateChainFile "/etc/dehydrated/certs/gemini.example.com/fullchain.pem" +</VirtualHost> diff --git a/galileo/file/galileo.conf.new b/galileo/file/galileo.conf.new new file mode 100644 index 0000000..02dd3f1 --- /dev/null +++ b/galileo/file/galileo.conf.new @@ -0,0 +1,3 @@ +proxy "www.example.com" { + source "gemini.example.com" +} diff --git a/galileo/galileo.SlackBuild b/galileo/galileo.SlackBuild new file mode 100644 index 0000000..d574de8 --- /dev/null +++ b/galileo/galileo.SlackBuild @@ -0,0 +1,86 @@ +#!/bin/bash + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=galileo +VERSION=${VERSION:-0.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_slackcoder} +PKGTYPE=${PKGTYPE:-txz} + +GALILEO_USER=${GALILEO_USER:-apache} + +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} + +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 {} \; + +# Get this working on Slackware +find "$CWD/patch" -type f -print0 | while IFS= read -r -d $'\0' file; + do patch -p1 -i "$file" +done + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + USER="$GALILEO_USER" \ + --prefix=/usr \ + --mandir=/usr/man + +make +make install DESTDIR=$PKG + +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +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 +install -D -m 0644 \ + CHANGES \ + README \ + "$CWD/file/galileo-apache.conf" \ + "$CWD/$PRGNAM.SlackBuild" \ + "$PKG/usr/doc/$PRGNAM-$VERSION" + +install -D -m 0644 "$CWD/README" "$PKG/usr/doc/$PRGNAM-$VERSION/README_slackware.md" + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +mkdir -p "$PKG/etc" +install -D -m 0644 "$CWD/file/galileo.conf.new" "$PKG/etc" + +cd "$PKG" +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/galileo/galileo.info b/galileo/galileo.info new file mode 100644 index 0000000..82079d6 --- /dev/null +++ b/galileo/galileo.info @@ -0,0 +1,10 @@ +PRGNAM="galileo" +VERSION="0.3" +HOMEPAGE="https://galileo.omarpolo.com" +DOWNLOAD="https://ftp.omarpolo.com/galileo-0.3.tar.gz" +MD5SUM="a0600c910d78c91a117e38ab84c5de91" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="libasr libtls" +MAINTAINER="Slack Coder" +EMAIL="slackcoder@server.ky" diff --git a/galileo/patch/0001-Fix-socket-configuration.patch b/galileo/patch/0001-Fix-socket-configuration.patch new file mode 100644 index 0000000..b1c9815 --- /dev/null +++ b/galileo/patch/0001-Fix-socket-configuration.patch @@ -0,0 +1,36 @@ +From a26d35df77d938cfea8039215d7b8ebd960a8ea1 Mon Sep 17 00:00:00 2001 +From: Slack Coder <slackcoder@server.ky> +Date: Thu, 17 Jul 2025 11:02:18 -0500 +Subject: [PATCH] Fix socket configuration + +Make compile time socket path configuration work by correcting +assignment typo's in the configuration script. +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 0568bea..b97b5fd 100755 +--- a/configure ++++ b/configure +@@ -88,7 +88,7 @@ while [ $# -gt 0 ]; do + PKG_CONFIG) + pkgconfig="$val" ;; + SOCK) +- sock="$sock" ;; ++ sock="$val" ;; + USER) + user="$val" ;; + YACC) +@@ -123,7 +123,7 @@ echo "returning to the configure for \`galileo':" >&2 + CFLAGS="${CFLAGS} -I. -Itemplate" + test -n "$conf" && CFLAGS="${CFLAGS} -DGALILEO_CONF=\"\\\"$conf\\\"\"" + test -n "$user" && CFLAGS="${CFLAGS} -DGALILEO_USER=\"\\\"$user\\\"\"" +-test -n "$sock" && CFLAGS="${CFLAGS} -DGALILEO_SOCK=\"\\\"$conf\\\"\"" ++test -n "$sock" && CFLAGS="${CFLAGS} -DGALILEO_SOCK=\"\\\"$sock\\\"\"" + + [ -w config.log ] && mv config.log config.log.old + +-- +2.46.3 + diff --git a/galileo/patch/0002-configure-allow-setting-mandir-prefix.patch b/galileo/patch/0002-configure-allow-setting-mandir-prefix.patch new file mode 100644 index 0000000..4e78b71 --- /dev/null +++ b/galileo/patch/0002-configure-allow-setting-mandir-prefix.patch @@ -0,0 +1,89 @@ +From 67154066915430626eff8ddf88632fa94558841a Mon Sep 17 00:00:00 2001 +From: Slack Coder <slackcoder@server.ky> +Date: Fri, 18 Jul 2025 12:34:15 -0500 +Subject: [PATCH] configure: allow setting mandir+prefix + +Follow the pattern from gmid to implement the configuration options mandir and prefix. +--- + Makefile | 2 -- + configure | 26 ++++++++++++++++++-------- + 2 files changed, 18 insertions(+), 10 deletions(-) + +diff --git a/Makefile b/Makefile +index 8007454..62ef4f3 100644 +--- a/Makefile ++++ b/Makefile +@@ -2,9 +2,7 @@ include config.mk + + # -- options -- + +-PREFIX = /usr/local + SBINDIR = ${PREFIX}/sbin +-MANDIR = ${PREFIX}/man + WWWDIR = /var/www/htdocs + + # -- build-related variables -- +diff --git a/configure b/configure +index 0568bea..ae93be8 100755 +--- a/configure ++++ b/configure +@@ -54,16 +54,18 @@ while [ $# -gt 0 ]; do + usage + fi + +- if [ "$key" = --prefix ]; then +- key=PREFIX +- if [ "$1" = --prefix ]; then # no =, look at next arg +- if !shift 2>&1 >/dev/null; then +- echo "$0: missing value for --prefix" >&2 +- exit 1 +- fi +- val="$1" ++ if [ "$key" = "$1" ]; then ++ # if no --xy=, look at the next arg ++ if ! shift 2>/dev/null; then ++ echo "$0: missing value for $key" >&2 ++ exit 1 + fi ++ val="$1" + fi ++ case "$key" in ++ --mandir) key=MANDIR ;; ++ --prefix) key=PREFIX ;; ++ esac + + if [ "$1" = "$key" ]; then + echo "$0: invalid key-value: $1" >&2 +@@ -85,8 +87,12 @@ while [ $# -gt 0 ]; do + LDADD_LIBEVENT="$val" ;; + LDADD_LIBSOCKET) + LDADD_LIBSOCKET="$val" ;; ++ MANDIR) ++ MANDIR="$val" ;; + PKG_CONFIG) + pkgconfig="$val" ;; ++ PREFIX) ++ PREFIX="$val" ;; + SOCK) + sock="$sock" ;; + USER) +@@ -388,12 +394,16 @@ EOF + exec > config.mk + echo "config.mk: writing..." >&2 + ++[ -z "${MANDIR}" ] && MANDIR="\${PREFIX}/man" ++ + cat <<EOF + CC= ${CC} + CFLAGS= ${CFLAGS} + LIBS= ${LIBS} + LDFLAGS= ${LDFLAGS} + YACC= ${YACC} ++PREFIX= ${PREFIX} ++MANDIR= ${MANDIR} + + COMPATS= ${COMPATS} + +-- +2.46.3 + diff --git a/galileo/slack-desc b/galileo/slack-desc new file mode 100644 index 0000000..bee0c30 --- /dev/null +++ b/galileo/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------------------------------------------------------| +galileo: galileo (Gemini proxy for the World Wide Web) +galileo: +galileo: Galileo is a FastCGI server that proxies the content of a Gemini +galileo: capsule to the World Wide Web. It has been designed to work out of +galileo: the box with the OpenBSD httpd(8) web server, but it's known to work +galileo: also with nginx and lighttpd. +galileo: +galileo: +galileo: +galileo: +galileo: diff --git a/mirror/mirror.toml b/mirror/mirror.toml index d3522e6..f734253 100644 --- a/mirror/mirror.toml +++ b/mirror/mirror.toml @@ -7,4 +7,3 @@ method = "git" from = "https://github.com/ytdl-org/youtube-dl" to = "/home/cypher/Desktop/youtube-dl" description = "Command-line program to download videos from YouTube.com and other video sites" - |