From 415856bdd4f48ab4f2732996f0bae58595092bbe Mon Sep 17 00:00:00 2001 From: Parabola Date: Tue, 5 Apr 2011 14:26:38 +0000 Subject: Tue Apr 5 14:26:38 UTC 2011 --- community/uptimed/PKGBUILD | 42 +++++++++++++++++++++++++++++++++++++++ community/uptimed/uptimed | 39 ++++++++++++++++++++++++++++++++++++ community/uptimed/uptimed.install | 7 +++++++ 3 files changed, 88 insertions(+) create mode 100644 community/uptimed/PKGBUILD create mode 100755 community/uptimed/uptimed create mode 100644 community/uptimed/uptimed.install (limited to 'community/uptimed') 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 +# Maintainer: Tom Killian +# Contributor: Tom Newsom + +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 +} + -- cgit v1.2.3-54-g00ecf