rustypaste: initial commit, version 0.15.0

This commit is contained in:
Tim Biermann 2024-06-17 18:45:26 +02:00
parent 4156ba7af7
commit 9d0c91ed60
Signed by: tb
GPG Key ID: 42F8B4E30B673606
5 changed files with 85 additions and 0 deletions

11
rustypaste/.footprint Normal file
View File

@ -0,0 +1,11 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/rc.d/
-rwxr-xr-x root/root etc/rc.d/rustypaste
drwxr-xr-x root/root etc/rustypaste/
-rw-r--r-- root/root etc/rustypaste/config.toml
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/rustypaste
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/lib/
drwxr-xr-x rustypaste/rustypaste var/lib/rustypaste/

6
rustypaste/.signature Normal file
View File

@ -0,0 +1,6 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF33b7CCVM/mEF3mvjahUKvsI022VI+8nI8B5P8DZzliQ6/g127BYzui/hNQRxV6LM6vzcd5QhyLNscIdnbUFy/gg=
SHA256 (Pkgfile) = 86086b1493211fa063ffa2c76af24ec4a11219b4dcd1b22e6623bffb4afc7746
SHA256 (.footprint) = 1bc5bfaecd6a97d5baac2f2a5b1d3ec9f0b3f37eb2b22f00127014412114b8e6
SHA256 (rustypaste-0.15.0.tar.gz) = d2f23fa70f389dc0e57606799e780ba7bcfc648514e72de55154ccf5571fc6cf
SHA256 (rustypaste.service) = 41f83ce326530c8fb867be54fb557d6f32e6542682268d54d09263e99704d323

25
rustypaste/Pkgfile Normal file
View File

@ -0,0 +1,25 @@
# Description: A minimal file upload/pastebin service
# URL: https://github.com/orhun/rustypaste
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: rust
name=rustypaste
version=0.15.0
release=1
source=(https://github.com/orhun/rustypaste/archive/v$version/$name-$version.tar.gz
rustypaste.service)
build() {
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
[[ ! -e $PKGMK_SOURCE_DIR/rust ]] && mkdir $PKGMK_SOURCE_DIR/rust
CFLAGS+=' -ffat-lto-objects' \
cargo build --release --manifest-path $name-$version/Cargo.toml \
--no-default-features --features openssl
install -Dt $PKG/usr/bin $name-$version/target/release/$name
install -Dm644 $name-$version/config.toml -t $PKG/etc/rustypaste
install -Dm755 $SRC/rustypaste.service $PKG/etc/rc.d/rustypaste
sed -i 's!./upload!/var/lib/rustypaste/upload!' $PKG/etc/rustypaste/config.toml
install -d -o rustypaste -g rustypaste $PKG/var/lib/rustypaste
}

11
rustypaste/pre-install Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh -e
_USER=rustypaste
_HOME=/var/lib/rustypaste
_GROUP=rustypaste
test -d $_HOME && exit 0
/usr/bin/getent group $_GROUP > /dev/null 2>&1 || /usr/sbin/groupadd $_GROUP
/usr/bin/getent passwd $_USER > /dev/null 2>&1 || /usr/sbin/useradd -c "${_USER} system user" -g $_GROUP -d $_HOME -s /bin/false $_USER
passwd -l $_USER > /dev/nulL

32
rustypaste/rustypaste.service Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
#
# /etc/rc.d/rustypaste: start/stop rustypaste daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/bin/rustypaste
OPTS=""
case $1 in
start)
CONFIG=/etc/rustypaste/config.toml $SSD --start -b --exec $PROG -- $OPTS ;;
stop)
$SSD --stop --retry 10 --exec $PROG ;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --exec $PROG
case $? in
0) echo "$PROG is running with pid $(pidof $PROG)" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]" ;;
esac
# End of file