summaryrefslogtreecommitdiffstats
path: root/testing/uptimed
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <bpiotrowski@alpinelinux.org>2013-05-29 20:27:51 +0200
committerBartłomiej Piotrowski <bpiotrowski@alpinelinux.org>2013-05-29 20:27:51 +0200
commit7f70bc3131f0c16a55fa63e156bfd7cd0b446c75 (patch)
tree3fe2fcf5db71b1f9b04ee623426b89f45b73320c /testing/uptimed
parent54a26d3e26ad47888bc4bf7f0dc52e9d0c42414e (diff)
downloadaports-7f70bc3131f0c16a55fa63e156bfd7cd0b446c75.tar.bz2
aports-7f70bc3131f0c16a55fa63e156bfd7cd0b446c75.tar.xz
testing/uptimed: new aport
Diffstat (limited to 'testing/uptimed')
-rw-r--r--testing/uptimed/APKBUILD46
-rw-r--r--testing/uptimed/uptimed.init26
2 files changed, 72 insertions, 0 deletions
diff --git a/testing/uptimed/APKBUILD b/testing/uptimed/APKBUILD
new file mode 100644
index 000000000..a53a2d639
--- /dev/null
+++ b/testing/uptimed/APKBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>
+
+pkgname=uptimed
+pkgver=0.3.17
+pkgrel=0
+pkgdesc='System uptime record daemon'
+arch="all"
+url='http://podgorny.cz/uptimed/'
+license='GPL'
+makedepends='autoconf libtool'
+source="http://podgorny.cz/$pkgname/releases/$pkgname-$pkgver.tar.bz2
+ uptimed.init"
+
+prepare() {
+ cd "$srcdir"/$pkgname-$pkgver
+
+ for M in M*; do
+ sed -i "s|/var/spool/uptimed|/var/log/uptimed|" $M
+ done
+ sed -i 's|spool|log|' libuptimed/urec.h
+ sed -i 's|AM_CONFIG_HEADER|AC_CONFIG_HEADER|g' configure.ac
+
+ autoreconf
+ libtoolize --force
+}
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make install DESTDIR="$pkgdir"
+ rm "$pkgdir"/usr/lib/libuptimed.la
+
+ mv "$pkgdir"/etc/uptimed.conf-dist "$pkgdir"/etc/uptimed.conf
+ install -Dm755 "$srcdir"/uptimed.init "$pkgdir"/etc/init.d/uptimed
+}
+md5sums="528b62c33454b33537c3bf2366977bdb uptimed-0.3.17.tar.bz2
+c79ad78e6a20b35a62d5ee019a39bce4 uptimed.init"
+sha256sums="524ce8984c0d0a780a32025ba3ffb980e5eec3d78e65cf68c91edec7fe833a06 uptimed-0.3.17.tar.bz2
+687589dbae26e42af4d0693baad6ac86270b5eb2d2f5fcbacf3554a6cbd24f85 uptimed.init"
+sha512sums="d462fa435b07bc335738dfccddd374aaa94fe2671a652afb8cb85d5e69e2148c296dec2a575ef074675e64e5453cb2d0807f80b191d9aeb5233168a617e842c5 uptimed-0.3.17.tar.bz2
+513cffb666c821d60a2a1d5bbb36b854bff84c4249d8ac27779e82b5ca9e9824aa432c0812d247c469e9a9ab4dadf104cddaa8224b891e39d0a2c0ebc409134e uptimed.init"
diff --git a/testing/uptimed/uptimed.init b/testing/uptimed/uptimed.init
new file mode 100644
index 000000000..1a9307c5a
--- /dev/null
+++ b/testing/uptimed/uptimed.init
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/uptimed/files/uptimed.init,v 1.8 2013/01/14 18:08:59 polynomial-c Exp $
+
+description="uptimed - a daemon to record uptime records"
+pidfile="/var/run/uptimed/uptimed.pid"
+command="/usr/sbin/uptimed"
+command_args="-p ${pidfile}"
+start_stop_daemon_args="-u uptimed"
+
+start_pre() {
+ checkpath -d -o uptimed ${pidfile%/*}
+
+ # Initialize bootid for uptimed < 0.3.17
+ local udver=$(${command} -v | head -n 1 | sed 's@.*[[:space:]]\([[:digit:]\.]\+\)[[:space:]].*@\1@;s@\.@@g')
+ local bootid="/var/spool/uptimed/bootid"
+ if [ "${udver}" -lt "0317" ] ; then
+ ${command} -b || eend $?
+ checkpath -f -o uptimed ${bootid}
+ else
+ if [ -f "${bootid}" ] ; then
+ rm ${bootid}
+ fi
+ fi
+}