aboutsummaryrefslogtreecommitdiff
path: root/network/quark
diff options
context:
space:
mode:
Diffstat (limited to 'network/quark')
-rw-r--r--network/quark/README24
-rw-r--r--network/quark/config.def.h39
-rw-r--r--network/quark/git2tarxz.sh44
-rw-r--r--network/quark/quark.SlackBuild72
-rw-r--r--network/quark/quark.info10
-rw-r--r--network/quark/slack-desc19
6 files changed, 208 insertions, 0 deletions
diff --git a/network/quark/README b/network/quark/README
new file mode 100644
index 0000000000..5dfc04769f
--- /dev/null
+++ b/network/quark/README
@@ -0,0 +1,24 @@
+quark (simple HTTP server for static content)
+
+quark is an extremely small and simple HTTP GET/HEAD-only web server
+for static content. The goal of this project is to do one thing and do
+it well, namely serving static web directories and doing that right.
+
+If you want to use a custom config.h to build quark, copy config.def.h
+to config.h (in the SlackBuild directory) and edit it. The SlackBuild
+will use the config.h if it exists.
+
+quark does not natively support TLS. You can use a TLS reverse proxy
+such as tlstunnel, hitch, or stunnel to add TLS support to quark.
+
+The package doesn't include a startup script. To start quark on
+boot, edit /etc/rc.d/rc.local and add a section like this:
+
+if [ -x /usr/bin/quark ]; then
+ nohup /usr/bin/quark \
+ -l -p 80 -u apache -g apache -d /var/www/htdocs \
+ 1>/var/log/quark.log 2>&1 &
+fi
+
+The example above starts quark as an apache replacement. You can
+change the command-line arguments as needed, for your purposes.
diff --git a/network/quark/config.def.h b/network/quark/config.def.h
new file mode 100644
index 0000000000..56f62aa62d
--- /dev/null
+++ b/network/quark/config.def.h
@@ -0,0 +1,39 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#define BUFFER_SIZE 4096
+#define FIELD_MAX 200
+
+/* mime-types */
+static const struct {
+ char *ext;
+ char *type;
+} mimes[] = {
+ { "xml", "application/xml; charset=utf-8" },
+ { "xhtml", "application/xhtml+xml; charset=utf-8" },
+ { "html", "text/html; charset=utf-8" },
+ { "htm", "text/html; charset=utf-8" },
+ { "css", "text/css; charset=utf-8" },
+ { "txt", "text/plain; charset=utf-8" },
+ { "md", "text/plain; charset=utf-8" },
+ { "c", "text/plain; charset=utf-8" },
+ { "h", "text/plain; charset=utf-8" },
+ { "gz", "application/x-gtar" },
+ { "tar", "application/tar" },
+ { "pdf", "application/x-pdf" },
+ { "png", "image/png" },
+ { "gif", "image/gif" },
+ { "jpeg", "image/jpg" },
+ { "jpg", "image/jpg" },
+ { "iso", "application/x-iso9660-image" },
+ { "webp", "image/webp" },
+ { "svg", "image/svg+xml; charset=utf-8" },
+ { "flac", "audio/flac" },
+ { "mp3", "audio/mpeg" },
+ { "ogg", "audio/ogg" },
+ { "mp4", "video/mp4" },
+ { "ogv", "video/ogg" },
+ { "webm", "video/webm" },
+};
+
+#endif /* CONFIG_H */
diff --git a/network/quark/git2tarxz.sh b/network/quark/git2tarxz.sh
new file mode 100644
index 0000000000..895c631e48
--- /dev/null
+++ b/network/quark/git2tarxz.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Create source tarball from git repo, with generated version
+# number.
+
+# Note that this script doesn't need to be run as root. It does
+# need to be able to write to the current directory it's run from.
+
+# Takes one optional argument, which is the commit or tag to create
+# a tarball of. With no arg, HEAD is used.
+
+PRGNAM=quark
+CLONE_URL=https://git.suckless.org/quark
+
+set -e
+
+GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
+rm -rf $GITDIR
+git clone $CLONE_URL $GITDIR
+
+CWD="$( pwd )"
+cd $GITDIR
+
+if [ "$1" != "" ]; then
+ git reset --hard "$1" || exit 1
+fi
+
+GIT_SHA=$( git rev-parse --short HEAD )
+
+DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 )
+
+VERSION=${DATE}_${GIT_SHA}
+
+rm -rf .git
+find . -name .gitignore -print0 | xargs -0 rm -f
+
+cd "$CWD"
+rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz
+mv $GITDIR $PRGNAM-$VERSION
+tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION
+
+echo
+echo "Created tarball: $PRGNAM-$VERSION.tar.xz"
+echo "VERSION=$VERSION"
diff --git a/network/quark/quark.SlackBuild b/network/quark/quark.SlackBuild
new file mode 100644
index 0000000000..b5b3369aff
--- /dev/null
+++ b/network/quark/quark.SlackBuild
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# Slackware build script for quark
+
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=quark
+VERSION=${VERSION:-20230226_5ad0df9}
+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"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod -h 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod -h 644 {} +
+
+[ -e $CWD/config.h ] && cat $CWD/config.h > config.h
+
+sed -i "s,-Os,$SLKCFLAGS," config.mk
+make
+make install PREFIX=/usr MANPREFIX=/usr/man DESTDIR=$PKG
+gzip -9 $PKG/usr/man/man*/*
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a config.h LICENSE $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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/quark/quark.info b/network/quark/quark.info
new file mode 100644
index 0000000000..ddb34efa3d
--- /dev/null
+++ b/network/quark/quark.info
@@ -0,0 +1,10 @@
+PRGNAM="quark"
+VERSION="20230226_5ad0df9"
+HOMEPAGE="https://tools.suckless.org/quark/"
+DOWNLOAD="https://slackware.uk/~urchlay/src/quark-20230226_5ad0df9.tar.xz"
+MD5SUM="0a576fbee2c7dbc0cf99b4fd517ead9b"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="urchlay@slackware.uk"
diff --git a/network/quark/slack-desc b/network/quark/slack-desc
new file mode 100644
index 0000000000..111bfe4fa9
--- /dev/null
+++ b/network/quark/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------------------------------------------------------|
+quark: quark (simple HTTP server for static content)
+quark:
+quark: quark is an extremely small and simple HTTP GET/HEAD-only web server
+quark: for static content. The goal of this project is to do one thing and do
+quark: it well, namely serving static web directories and doing that right.
+quark:
+quark: quark does not natively support TLS. You can use a TLS reverse proxy
+quark: such as tlstunnel, hitch, or stunnel to add TLS support to quark.
+quark:
+quark:
+quark: