summaryrefslogtreecommitdiffstats
path: root/system/tuptime
diff options
context:
space:
mode:
Diffstat (limited to 'system/tuptime')
-rw-r--r--system/tuptime/README17
-rw-r--r--system/tuptime/cronfile1
-rw-r--r--system/tuptime/slack-desc19
-rw-r--r--system/tuptime/tuptime.SlackBuild121
-rw-r--r--system/tuptime/tuptime.info10
5 files changed, 168 insertions, 0 deletions
diff --git a/system/tuptime/README b/system/tuptime/README
new file mode 100644
index 0000000000..4e984c6ebe
--- /dev/null
+++ b/system/tuptime/README
@@ -0,0 +1,17 @@
+tuptime is a daemon-less uptime statistics collection tool.
+
+It lets you know how long your machine manages to run without a reboot,
+and shows whether the reboot was graceful or hard.
+
+The slackbuild installs a SystemV-style initscript into rc3.d and rc4.d.
+The time your machine spends in other runlevels is not counter, because,
+presumably, it cannot be considered fully up.
+
+The slackbuild also installs a speically crafter crontab for the
+_tuptime user, to periodically log machine state.
+
+The scripts expects to have a system user called _tuptime. Create one
+by running:
+
+groupadd -g 379 _tuptime
+useradd -u 379 -g 379 -d /var/lib/_tuptime _tuptime
diff --git a/system/tuptime/cronfile b/system/tuptime/cronfile
new file mode 100644
index 0000000000..ce52dcc480
--- /dev/null
+++ b/system/tuptime/cronfile
@@ -0,0 +1 @@
+* * * * * ID=tuptime_log if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null 2>&1; fi
diff --git a/system/tuptime/slack-desc b/system/tuptime/slack-desc
new file mode 100644
index 0000000000..107a2ee52d
--- /dev/null
+++ b/system/tuptime/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------------------------------------------------------|
+tuptime: tuptime (uptime statistics collector)
+tuptime:
+tuptime: tuptime is a daemon-less uptime statistics collection tool.
+tuptime: It lets you know how long your machine manages to run without a
+tuptime: reboot, and shows whether the reboot was graceful or hard.
+tuptime:
+tuptime:
+tuptime:
+tuptime: Homepage: https://github.com/rfrail3/tuptime
+tuptime:
+tuptime:
diff --git a/system/tuptime/tuptime.SlackBuild b/system/tuptime/tuptime.SlackBuild
new file mode 100644
index 0000000000..f15adf2d1c
--- /dev/null
+++ b/system/tuptime/tuptime.SlackBuild
@@ -0,0 +1,121 @@
+#!/bin/bash
+
+# Slackware build script for tuptime
+
+# Copyright 2023, Lockywolf
+# 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=tuptime
+VERSION=${VERSION:-5.2.2}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+ARCH=noarch
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+MUID=${MUID:-379}
+MGID=${MGID:-379}
+
+if ! getent group _tuptime 2>&1 > /dev/null; then
+ echo " You must have an _tuptime group to run this script."
+ echo " # groupadd -g $MGID _tuptime"
+ exit 1
+elif ! getent passwd _tuptime 2>&1 > /dev/null; then
+ echo " You must have a _tuptime user to run this script."
+ echo " # useradd -u $MUID -g $MGID -d /var/lib/_tuptime _tuptime"
+ exit 1
+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
+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 {} +
+
+mkdir -p "$PKG"/usr/bin
+install -m 755 ./src/tuptime "$PKG"/usr/bin/tuptime
+mkdir -p "$PKG"/etc/rc.d/init.d
+install -m 755 ./src/init.d/redhat/tuptime "$PKG"/etc/rc.d/init.d/tuptime
+install -m 750 -d "$PKG"/var/spool/cron/crontabs/
+install -m 600 "$CWD"/cronfile "$PKG"/var/spool/cron/crontabs/_tuptime
+mkdir -p "$PKG"/etc/rc.d/rc3.d/
+mkdir -p "$PKG"/etc/rc.d/rc4.d/
+(
+ cd "$PKG"/etc/rc.d/rc3.d/
+ ln -sr ../init.d/tuptime ./S01_tuptime
+ ln -sr ../init.d/tuptime ./K99_tuptime
+ cd "$PKG"/etc/rc.d/rc4.d/
+ ln -sr ../init.d/tuptime ./S01_tuptime
+ ln -sr ../init.d/tuptime ./K99_tuptime
+)
+
+mkdir -p $PKG/var/lib/tuptime
+chown -R _tuptime:_tuptime $PKG/var/lib/tuptime
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -ar \
+ CHANGELOG CONTRIBUTING.md LICENSE README.md tuptime-manual.txt \
+ misc/scripts \
+ $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/system/tuptime/tuptime.info b/system/tuptime/tuptime.info
new file mode 100644
index 0000000000..f7f886707e
--- /dev/null
+++ b/system/tuptime/tuptime.info
@@ -0,0 +1,10 @@
+PRGNAM="tuptime"
+VERSION="5.2.2"
+HOMEPAGE="https://github.com/rfrail3/tuptime"
+DOWNLOAD="https://github.com/rfmoz/tuptime/archive/5.2.2/tuptime-5.2.2.tar.gz"
+MD5SUM="d5f4bfa0cd1be5d4353fdb4c5e68512b"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="lockywolf"
+EMAIL="for_sbo.tuptime_2023-11-22@lockywolf.net"