summaryrefslogtreecommitdiff
path: root/community/uptimed
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/uptimed
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/uptimed')
-rw-r--r--community/uptimed/PKGBUILD42
-rwxr-xr-xcommunity/uptimed/uptimed39
-rw-r--r--community/uptimed/uptimed.install7
3 files changed, 88 insertions, 0 deletions
diff --git a/community/uptimed/PKGBUILD b/community/uptimed/PKGBUILD
new file mode 100644
index 000000000..7b60c38b8
--- /dev/null
+++ b/community/uptimed/PKGBUILD
@@ -0,0 +1,42 @@
+# $Id: PKGBUILD 17435 2010-05-24 10:30:22Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Tom Killian <tomk@runbox.com>
+# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+pkgname=uptimed
+pkgver=0.3.16
+pkgrel=3
+pkgdesc="A system uptime record daemon"
+arch=(i686 x86_64)
+install=$pkgname.install
+url="http://podgorny.cz/uptimed/"
+license=('GPL')
+depends=('glibc')
+backup=(etc/uptimed.conf)
+source=(http://podgorny.cz/$pkgname/releases/$pkgname-$pkgver.tar.bz2
+ uptimed)
+md5sums=('f87ec2cc39039239004afa542cf99c59'
+ '4ae90bee9fc78014a889a5072effb735')
+
+build() {
+ cd $startdir/src/$pkgname-$pkgver
+
+ # Change log path to Arch standard
+ for M in `ls M*`; do
+ sed -i "s|/var/spool/uptimed|$startdir/pkg/var/log/uptimed|" $M
+ done
+ sed -i 's|spool|log|' libuptimed/urec.h
+
+ autoreconf
+ libtoolize --force
+
+ ./configure --prefix=/usr --sysconfdir=/etc
+
+ make || return 1
+ make prefix=$startdir/pkg/usr sysconfdir=$startdir/pkg/etc install
+
+ mv $startdir/pkg/etc/uptimed.conf-dist \
+ $startdir/pkg/etc/uptimed.conf
+ install -D ../uptimed $startdir/pkg/etc/rc.d/uptimed
+ find $startdir/pkg -name '*.la' -exec rm {} \;
+}
diff --git a/community/uptimed/uptimed b/community/uptimed/uptimed
new file mode 100755
index 000000000..6fe9ec3e3
--- /dev/null
+++ b/community/uptimed/uptimed
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/uptimed`
+case "$1" in
+ start)
+ stat_busy "Starting Uptimed Daemon"
+ [ -z "$PID" ] && /usr/sbin/uptimed -b # create the boot record
+ if [ $? -gt 0 ] ; then
+ stat_fail
+ else
+ add_daemon uptimed # create the 'state' dir
+ /usr/sbin/uptimed # fire up the daemon
+ if [ $? -gt 0 ]; then
+ stat_fail
+ fi
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Uptimed Daemon"
+ [ "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon uptimed # remove the 'state' dir
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community/uptimed/uptimed.install b/community/uptimed/uptimed.install
new file mode 100644
index 000000000..178061706
--- /dev/null
+++ b/community/uptimed/uptimed.install
@@ -0,0 +1,7 @@
+# arg 1: the old package version
+pre_remove() {
+ # clean up after ourselves
+ #
+ /bin/rm -rf /var/log/uptimed
+}
+