aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-04-06 09:28:30 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-04-06 09:29:41 +0000
commit771e4132de7aef9451791db64086cc04bcaf4814 (patch)
treeb2b8eef5f93b0d711f280ca3948a445fa9d31cbe /testing
parent16de0c956036ea6df4884b85495b00cce31261e6 (diff)
downloadaports-771e4132de7aef9451791db64086cc04bcaf4814.tar.bz2
aports-771e4132de7aef9451791db64086cc04bcaf4814.tar.xz
testing/sircbot: new aport
Minimalistic IRC bot http://git.alpinelinux.org/cgit/sircbot/
Diffstat (limited to 'testing')
-rw-r--r--testing/sircbot/APKBUILD40
-rw-r--r--testing/sircbot/sircbot.confd5
-rw-r--r--testing/sircbot/sircbot.initd35
-rw-r--r--testing/sircbot/sircbot.pre-install5
4 files changed, 85 insertions, 0 deletions
diff --git a/testing/sircbot/APKBUILD b/testing/sircbot/APKBUILD
new file mode 100644
index 0000000000..136c2b7e9c
--- /dev/null
+++ b/testing/sircbot/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor:
+# Maintainer:
+pkgname=sircbot
+pkgver=0.1
+pkgrel=0
+pkgdesc="Minimalistic IRC bot"
+url="http://git.alpinelinux.org/cgit/sircbot/"
+license="GPL-2"
+pkgusers="sircbot"
+pkggroups="sircbot"
+depends=
+makedepends=
+install="$pkgname.pre-install"
+subpackages=
+source="http://git.alpinelinux.org/cgit/sircbot/snapshot/sircbot-$pkgver.tar.bz2
+ sircbot.initd
+ sircbot.confd
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+ cd "$_builddir"
+}
+
+build() {
+ cd "$_builddir"
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ install -m755 -D sircbot "$pkgdir"/usr/bin/sircbot
+ install -o sircbot -g sircbot -d "$pkgdir"/var/run/sircbot
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+}
+
+md5sums="82e4cb6c7207761301e63c24d73afd2c sircbot-0.1.tar.bz2
+16790493e7ce465fd776dcfadc002a7c sircbot.initd
+8443ac189030c7b8beb8e579dc16ebc7 sircbot.confd"
diff --git a/testing/sircbot/sircbot.confd b/testing/sircbot/sircbot.confd
new file mode 100644
index 0000000000..63f8590a72
--- /dev/null
+++ b/testing/sircbot/sircbot.confd
@@ -0,0 +1,5 @@
+# example:
+# sircbot_opts="-n sircbot -s irc.freenode.net"
+
+sircbot_channels="#sircbot"
+sircbot_opts=""
diff --git a/testing/sircbot/sircbot.initd b/testing/sircbot/sircbot.initd
new file mode 100644
index 0000000000..2e0a9c3302
--- /dev/null
+++ b/testing/sircbot/sircbot.initd
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+
+daemon=/usr/bin/sircbot
+sircbot_user=${sircbot_user:-sircbot}
+sircbot_group=${sircbot_group:-sircbot}
+pidfile=/var/run/sircbot/sircbot.pid
+
+depends() {
+ need net
+ after firewall
+}
+
+checkonfig() {
+ if [ -z "$sircbot_channels" ]; then
+ eerror "Please specify sircbot_channels in /etc/conf.d/sircbot"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting sircbot"
+ start-stop-daemon --start --user $sircbot_user --group $sircbot_group \
+ --umask 0002 --pidfile "$pidfile" \
+ --exec $daemon -- $sircbot_opts $sircbot_channels
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping sircbot"
+ start-stop-daemon --stop --pidfile "$pidfile" --exec $daemon
+ eend $?
+}
+
diff --git a/testing/sircbot/sircbot.pre-install b/testing/sircbot/sircbot.pre-install
new file mode 100644
index 0000000000..99c5a83027
--- /dev/null
+++ b/testing/sircbot/sircbot.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+addgroup sircbot 2>/dev/null
+adduser -h /var/run/sircbot -G sircbot -S -D 2>/dev/null
+exit 0