aboutsummaryrefslogtreecommitdiffstats
path: root/main/sircbot
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-08-01 18:18:34 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2018-08-01 18:19:56 +0200
commit304d76ab2d7c844dfc7ff2ae81c3651a8a6570a9 (patch)
tree1ba72a59086ee0f777af1d5611b021e83c8069ec /main/sircbot
parent0884190918f47872a45bcf231b9b04db18a96bd6 (diff)
downloadaports-304d76ab2d7c844dfc7ff2ae81c3651a8a6570a9.tar.gz
aports-304d76ab2d7c844dfc7ff2ae81c3651a8a6570a9.tar.bz2
aports-304d76ab2d7c844dfc7ff2ae81c3651a8a6570a9.tar.xz
main/sircbot: add simple hack to allow nickserv identification
Diffstat (limited to 'main/sircbot')
-rw-r--r--main/sircbot/0001-add-simple-hack-to-allow-nickserv-identification.patch44
-rw-r--r--main/sircbot/APKBUILD30
-rw-r--r--main/sircbot/sircbot.initd5
3 files changed, 59 insertions, 20 deletions
diff --git a/main/sircbot/0001-add-simple-hack-to-allow-nickserv-identification.patch b/main/sircbot/0001-add-simple-hack-to-allow-nickserv-identification.patch
new file mode 100644
index 0000000000..6aeae2698b
--- /dev/null
+++ b/main/sircbot/0001-add-simple-hack-to-allow-nickserv-identification.patch
@@ -0,0 +1,44 @@
+From b158567d16bbc82ce289d96456d66e45c8a7154c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 1 Aug 2018 17:44:16 +0200
+Subject: [PATCH] add simple hack to allow nickserv identification
+
+pass -c "nickserv :identify <password>!
+---
+ sircbot.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/sircbot.c b/sircbot.c
+index 5a40695..51572c0 100644
+--- a/sircbot.c
++++ b/sircbot.c
+@@ -608,12 +608,16 @@ int main(int argc, char *argv[])
+ const char *username = "sircbot";
+ const char *pass = NULL;
+ const char *logfile = "/dev/null";
++ const char *connmsg = NULL;
+ struct sircbot_session sb;
+ int i, c, port = 6667, multimode = 0;
+
+ sb.runhooks = 1;
+- while ((c = getopt(argc, argv, "fl:mn:Np:P:r:s:u:")) != -1) {
++ while ((c = getopt(argc, argv, "c:fl:mn:Np:P:r:s:u:")) != -1) {
+ switch (c) {
++ case 'c':
++ connmsg = optarg;
++ break;
+ case 'f':
+ foreground = 1;
+ break;
+@@ -698,6 +702,8 @@ int main(int argc, char *argv[])
+ sleep(10);
+ continue;
+ }
++ if (connmsg)
++ irc_send(sb.sess, "PRIVMSG", connmsg);
+
+ irc_loop(&sb);
+ irc_close(sb.sess, "bye");
+--
+2.18.0
+
diff --git a/main/sircbot/APKBUILD b/main/sircbot/APKBUILD
index cd7102a7f3..a17cc42c28 100644
--- a/main/sircbot/APKBUILD
+++ b/main/sircbot/APKBUILD
@@ -2,7 +2,7 @@
_luaversions="5.1 5.2 5.3"
pkgname=sircbot
pkgver=0.4
-pkgrel=1
+pkgrel=2
pkgdesc="Minimalistic IRC bot"
url="https://git.alpinelinux.org/cgit/sircbot/"
arch="all"
@@ -18,29 +18,26 @@ for _i in $_luaversions; do
done
install="$pkgname.pre-install"
source="http://dev.alpinelinux.org/archive/sircbot/sircbot-$pkgver.tar.xz
+ 0001-add-simple-hack-to-allow-nickserv-identification.patch
sircbot.initd
sircbot.confd
"
-_builddir="$srcdir"/$pkgname-$pkgver
-prepare() {
- cd "$_builddir"
-}
+builddir="$srcdir"/$pkgname-$pkgver
build() {
- cd "$_builddir"
- make || return 1
+ cd "$builddir"
+ make
for i in $_luaversions; do
- make LUA_VERSION=$i || return 1
+ make LUA_VERSION=$i
done
}
package() {
- cd "$_builddir"
+ cd "$builddir"
make install DESTDIR="$pkgdir" prefix=/usr
for i in $_luaversions; do
- make install-lua DESTDIR="$pkgdir" prefix=/usr LUA_VERSION=$i \
- || return 1
+ make install-lua DESTDIR="$pkgdir" prefix=/usr LUA_VERSION=$i
done
install -o sircbot -g sircbot -d "$pkgdir"/var/run/sircbot
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
@@ -61,7 +58,7 @@ _split() {
for d in usr/lib/lua usr/share/lua; do
if [ -d "$pkgdir"/$d/$_ver ]; then
mkdir -p "$subpkgdir"/$d
- mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
+ mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/
fi
done
}
@@ -71,12 +68,7 @@ for _v in $_luaversions; do
eval "split_${_v/./_}() { _split $_v; }"
done
-md5sums="e9b10d19ed30521e1950cab0b66c79a2 sircbot-0.4.tar.xz
-c89aa17a632d2338daefa1fd99b82f5d sircbot.initd
-8443ac189030c7b8beb8e579dc16ebc7 sircbot.confd"
-sha256sums="3f32fe97131402f827a6acba8507c372e53ce19690e732d226bb9a4d89313ce0 sircbot-0.4.tar.xz
-f49ebfc6717fd34f946b8afbe7df50ddde59f0347b4300610cc6d6997710d1e7 sircbot.initd
-b0bf9767150e486815aada1761b6fca7b7838df3045082ff8083167dbce613e6 sircbot.confd"
sha512sums="1f91581548dcc2d3f6d0da31591027792271994b86ffce73141de828eff27595a1df8a364988e0c5349996e36ae8879b166c84d6024a194626e61c9dc9e96816 sircbot-0.4.tar.xz
-501bcf92aed2819dd902eab31470282b5951916f3d52bab6d8eb3a14e01690f10b5a9b52488bfdcf1aa5ada44840e918dbe93ba23d891389e5d8dbe4b9a40efb sircbot.initd
+45cbf2b16374f0fb7746d80ce09a9f65c293e08fd641c174821caf78f27e0614882500e0ced08a611679f26e5b2f8acded9869af6be81bd0966820588612b1e6 0001-add-simple-hack-to-allow-nickserv-identification.patch
+5a8ce80e8d43aa7737bd210812c8a99f1f5d5e7af78996b09ebef0c492d7df6303d63dbe3eb037fd5f750c955173e85fd87c75dfeb6dda7c731740d065ffa3d9 sircbot.initd
315167ec664ce859908fcd230f6e0c604a0b02e56286156ba6ec76c32d6d514726acb493fe7a13b44d9255ec2e34fe4b2a6f02edf039b06e487cea6528d4d6a7 sircbot.confd"
diff --git a/main/sircbot/sircbot.initd b/main/sircbot/sircbot.initd
index f8923ba27a..502ac09433 100644
--- a/main/sircbot/sircbot.initd
+++ b/main/sircbot/sircbot.initd
@@ -24,7 +24,10 @@ start() {
ebegin "Starting sircbot"
start-stop-daemon --start --user $sircbot_user --group $sircbot_group \
--umask 0002 --pidfile "$pidfile" \
- --exec $daemon -- $sircbot_opts $sircbot_channels
+ --exec $daemon -- \
+ $sircbot_opts \
+ "${nickserv_pass:+-c "nickserv :identify $nickserv_pass"}" \
+ $sircbot_channels
eend $?
}