aboutsummaryrefslogtreecommitdiff
path: root/network/copyparty
diff options
context:
space:
mode:
Diffstat (limited to 'network/copyparty')
-rw-r--r--network/copyparty/README16
-rw-r--r--network/copyparty/README.SBo31
-rw-r--r--network/copyparty/copyparty.SlackBuild107
-rw-r--r--network/copyparty/copyparty.conf7
-rw-r--r--network/copyparty/copyparty.info10
-rw-r--r--network/copyparty/doinst.sh15
-rw-r--r--network/copyparty/rc.copyparty53
-rw-r--r--network/copyparty/slack-desc19
8 files changed, 258 insertions, 0 deletions
diff --git a/network/copyparty/README b/network/copyparty/README
new file mode 100644
index 0000000000..56f1cb6067
--- /dev/null
+++ b/network/copyparty/README
@@ -0,0 +1,16 @@
+copyparty (Portable file server)
+
+copyparty is a file server with accelerated resumable uploads, dedup,
+WebDAV, FTP, TFTP, zeroconf, media indexer, thumbnails, and more.
+
+The README.SBo file distributed with this SlackBuild includes
+instructions for setting up copyparty to run as an init service. This
+file will also be included in copyparty's documentation directory when
+installed.
+
+copyparty supports the following optional dependencies:
+ - python3-argon2-cffi: Hashed passwords in config
+ - pyftpdlib: FTP
+ - pyOpenSSL: FTP with TLS encryption
+ - mutagen: Faster music tag processing
+ - python3-pyzmq: Sending zeromq messages from event-hooks
diff --git a/network/copyparty/README.SBo b/network/copyparty/README.SBo
new file mode 100644
index 0000000000..7ad31b13f7
--- /dev/null
+++ b/network/copyparty/README.SBo
@@ -0,0 +1,31 @@
+README.SBo (copyparty)
+
+To run copyparty as a service that runs at boot, you must first make
+sure its init script is executable.
+
+ # Run as root
+ chmod +x /etc/rc.d/rc.copyparty
+
+Then you will want to add the following lines to your
+/etc/rc.d/rc.local to run copyparty on startup.
+
+ # Start copyparty
+ if [ -x /etc/rc.d/rc.copyparty ]; then
+ /etc/rc.d/rc.copyparty start
+ fi
+
+After that, you will want to add the following lines to your
+/etc/rc.d/rc.local_shutdown to gracefully stop copyparty on shutdown.
+If rc.local_shutdown does not already exist, you will want to create
+it and make it executable.
+
+ # Stop copyparty
+ if [ -x /etc/rc.d/rc.copyparty ]; then
+ /etc/rc.d/rc.copyparty stop
+ fi
+
+When running copyparty from the SlackBuild's init script, copyparty
+will read configuration from /etc/copyparty.d/copyparty.conf. This
+SlackBuild also installs an example config file into copyparty's
+documentation directory, which you can consult for some guidance on
+writing your own configuration file.
diff --git a/network/copyparty/copyparty.SlackBuild b/network/copyparty/copyparty.SlackBuild
new file mode 100644
index 0000000000..69100461aa
--- /dev/null
+++ b/network/copyparty/copyparty.SlackBuild
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+# Slackware build script for copyparty
+
+# Copyright 2025 Samuel Young, MO, USA
+# 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=copyparty
+VERSION=${VERSION:-1.19.8}
+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-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+cp $CWD/README.SBo .
+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 {} \;
+
+PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')
+export PYTHONPATH=/opt/python$PYVER/site-packages
+
+python3 -m build --wheel --no-isolation
+python3 -m installer --destdir "$PKG" dist/*.whl
+
+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/etc/rc.d
+install -m 644 $CWD/rc.copyparty $PKG/etc/rc.d/rc.copyparty.new
+mkdir -p $PKG/etc/copyparty.d
+install -m 644 $CWD/copyparty.conf $PKG/etc/copyparty.d/copyparty.conf.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ CONTRIBUTING.md LICENSE README.md SECURITY.md README.SBo docs/changelog.md \
+ docs/example.conf docs/xff.md docs/TODO.md docs/versus.md \
+ docs/synology-dsm.md docs/rclone.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/network/copyparty/copyparty.conf b/network/copyparty/copyparty.conf
new file mode 100644
index 0000000000..1d90d772bc
--- /dev/null
+++ b/network/copyparty/copyparty.conf
@@ -0,0 +1,7 @@
+## import all *.conf files from the current folder (/etc/copyparty.d)
+% ./
+
+# add additional .conf files to this folder;
+# see example config files for reference:
+# https://github.com/9001/copyparty/blob/hovudstraum/docs/example.conf
+# https://github.com/9001/copyparty/tree/hovudstraum/docs/copyparty.d
diff --git a/network/copyparty/copyparty.info b/network/copyparty/copyparty.info
new file mode 100644
index 0000000000..a823c13760
--- /dev/null
+++ b/network/copyparty/copyparty.info
@@ -0,0 +1,10 @@
+PRGNAM="copyparty"
+VERSION="1.19.8"
+HOMEPAGE="https://github.com/9001/copyparty"
+DOWNLOAD="https://github.com/9001/copyparty/releases/download/v1.19.8/copyparty-1.19.8.tar.gz"
+MD5SUM="fead8dfb661bf576fefb501e4d3dce4a"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="python3-build python3-setuptools-opt python3-wheel"
+MAINTAINER="Samuel Young"
+EMAIL="samyoung12788@gmail.com"
diff --git a/network/copyparty/doinst.sh b/network/copyparty/doinst.sh
new file mode 100644
index 0000000000..ce6c16dd79
--- /dev/null
+++ b/network/copyparty/doinst.sh
@@ -0,0 +1,15 @@
+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...
+}
+
+config etc/rc.d/rc.copyparty.new
+config etc/copyparty.d/copyparty.conf.new
diff --git a/network/copyparty/rc.copyparty b/network/copyparty/rc.copyparty
new file mode 100644
index 0000000000..db8b22b704
--- /dev/null
+++ b/network/copyparty/rc.copyparty
@@ -0,0 +1,53 @@
+#!/bin/sh
+# Start/stop/restart copyparty.
+
+# TODO: This script probably shouldn't run copyparty as root
+
+PIDFILE="/run/copyparty.pid"
+LOGFILE="/var/log/copyparty"
+CONFILE="/etc/copyparty.d/copyparty.conf"
+COPYPARTY_OPTS="-c $CONFILE -lo $LOGFILE --no-ansi"
+
+copyparty_start() {
+ if [ -e "$PIDFILE" ]; then
+ rm -f "$PIDFILE"
+ fi
+ if [ -x /usr/bin/copyparty ]; then
+ echo -n "Starting copyparty: /usr/bin/copyparty $COPYPARTY_OPTS"
+ /usr/bin/copyparty $COPYPARTY_OPTS 2>&1 >/dev/null &
+ echo -n "$!" > "$PIDFILE"
+ fi
+ echo
+}
+
+copyparty_stop() {
+ echo -n "Stopping copyparty... "
+ if [ -e "$PIDFILE" ]; then
+ echo -n "(PID $(cat "$PIDFILE"))"
+ kill -HUP $(cat "$PIDFILE")
+ rm -f "$PIDFILE"
+ else
+ killall --ns $$ -HUP -q copyparty
+ fi
+ echo
+}
+
+copyparty_restart() {
+ copyparty_stop
+ sleep 1
+ copyparty_start
+}
+
+case "$1" in
+'start')
+ copyparty_start
+ ;;
+'stop')
+ copyparty_stop
+ ;;
+'restart')
+ copyparty_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac
diff --git a/network/copyparty/slack-desc b/network/copyparty/slack-desc
new file mode 100644
index 0000000000..6ae5c089da
--- /dev/null
+++ b/network/copyparty/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------------------------------------------------------|
+copyparty: copyparty (Portable file server)
+copyparty:
+copyparty: copyparty is a file server with accelerated resumable uploads, dedup,
+copyparty: WebDAV, FTP, TFTP, zeroconf, media indexer, thumbnails, and more.
+copyparty:
+copyparty:
+copyparty:
+copyparty:
+copyparty:
+copyparty: Homepage: https://github.com/9001/copyparty
+copyparty: