From 545dff604b5d9c10e17fc89b4041b1688741cbed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 14 Nov 2012 17:17:30 -0300 Subject: InspIRCd --- social/inspircd/PKGBUILD | 62 ++++++++++++++++++++++++++++++++++++++++ social/inspircd/gnutls.patch | 12 ++++++++ social/inspircd/inspircd.install | 15 ++++++++++ social/inspircd/inspircd.rcd | 50 ++++++++++++++++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 social/inspircd/PKGBUILD create mode 100644 social/inspircd/gnutls.patch create mode 100644 social/inspircd/inspircd.install create mode 100644 social/inspircd/inspircd.rcd (limited to 'social/inspircd') diff --git a/social/inspircd/PKGBUILD b/social/inspircd/PKGBUILD new file mode 100644 index 000000000..6165f7c31 --- /dev/null +++ b/social/inspircd/PKGBUILD @@ -0,0 +1,62 @@ +pkgname=inspircd +pkgver=2.0.5 +pkgrel=2 +pkgdesc='A lightweight IRC daemon' +arch=('x86_64' 'i686') +url='http://www.inspircd.org/' +license=('GPL2') +depends=('perl' 'gnutls' 'openssl' 'libgcrypt') +makedepends=('pkg-config' 'mysql' 'postgresql' 'sqlite3' 'libldap' 'geoip' 'tre') +optdepends=('mysql: m_mysql' + 'pcre: m_regex_pcre' + 'postgresql: m_pgsql' + 'sqlite3: m_sqlite3' + 'libldap: m_ldapoper and m_ldapauth' + 'geoip: m_geoip' + 'tre: m_regex_tre') +install=inspircd.install +backup=('etc/inspircd/inspircd.conf') + +source=(http://www.inspircd.org/downloads/InspIRCd-$pkgver.tar.bz2 inspircd.rcd gnutls.patch) +md5sums=('60dec04bdc8f8c473f3c7bd774a1f153' + 'f4f32d944401b1602ab6716476892afd' + '6312154e759e5d71b85c7dca71b7a4fd') + +build() { + cd "${srcdir}/inspircd" + patch -Np1 -i "${srcdir}/gnutls.patch" + + ./configure \ + --enable-extras=m_geoip.cpp \ + --enable-extras=m_ldapauth.cpp \ + --enable-extras=m_ldapoper.cpp \ + --enable-extras=m_mysql.cpp \ + --enable-extras=m_pgsql.cpp \ + --enable-extras=m_regex_pcre.cpp \ + --enable-extras=m_regex_posix.cpp \ + --enable-extras=m_regex_tre.cpp \ + --enable-extras=m_sqlite3.cpp + + ./configure \ + --prefix=/usr/lib/inspircd \ + --binary-dir=/usr/sbin \ + --module-dir=/usr/lib/inspircd/modules \ + --config-dir=/etc/inspircd \ + --enable-gnutls \ + --enable-openssl \ + --enable-epoll + + make +} + +package() { + install -Dm755 "${srcdir}"/inspircd.rcd "${pkgdir}"/etc/rc.d/inspircd + install -o141 -g141 -dm750 "${pkgdir}/var/log/inspircd" + install -o141 -g141 -dm750 "${pkgdir}/var/run/inspircd" + + cd "${srcdir}/inspircd" + make DESTDIR="$pkgdir" INSTUID=141 install + + rm -rf "${pkgdir}"/usr/lib/inspircd/logs + rm -rf "${pkgdir}"/usr/lib/inspircd/data +} diff --git a/social/inspircd/gnutls.patch b/social/inspircd/gnutls.patch new file mode 100644 index 000000000..3975c418c --- /dev/null +++ b/social/inspircd/gnutls.patch @@ -0,0 +1,12 @@ +ff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp +index b8c4815..d58caa8 100644 +--- a/src/modules/extra/m_ssl_gnutls.cpp ++++ b/src/modules/extra/m_ssl_gnutls.cpp +@@ -20,7 +20,7 @@ + + /* $ModDesc: Provides SSL support for clients */ + /* $CompileFlags: pkgconfincludes("gnutls","/gnutls/gnutls.h","") */ +-/* $LinkerFlags: rpath("pkg-config --libs gnutls") pkgconflibs("gnutls","/libgnutls.so","-lgnutls") */ ++/* $LinkerFlags: rpath("pkg-config --libs gnutls") pkgconflibs("gnutls","/libgnutls.so","-lgnutls") -lgcrypt */ + + enum issl_status { ISSL_NONE, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, ISSL_HANDSHAKEN, ISSL_CLOSING, ISSL_CLOSED }; diff --git a/social/inspircd/inspircd.install b/social/inspircd/inspircd.install new file mode 100644 index 000000000..ec97113f5 --- /dev/null +++ b/social/inspircd/inspircd.install @@ -0,0 +1,15 @@ +post_install() { + getent group inspircd &>/dev/null || groupadd -r -g 141 inspircd >/dev/null + getent passwd inspircd &>/dev/null || useradd -r -u 141 -g inspircd -d /var/lib/inspircd -s /bin/false -c inspircd inspircd >/dev/null + + echo '==> You will need to create a config file for inspircd' + echo '==> cp /etc/inspircd/inspircd.conf.example /etc/inspircd/inspircd.conf' + echo '==> You will need to change the pidfile. To do this you can insert the following into your config.' + echo '==> ' + echo '==> Remember to use absolute paths in your config directory and not relative paths like you would do with a user-based inspircd install.' +} + +post_remove() { + getent passwd inspircd &>/dev/null && userdel inspircd >/dev/null + getent group inspircd &>/dev/null && groupdel inspircd >/dev/null +} diff --git a/social/inspircd/inspircd.rcd b/social/inspircd/inspircd.rcd new file mode 100644 index 000000000..a041b9be4 --- /dev/null +++ b/social/inspircd/inspircd.rcd @@ -0,0 +1,50 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +get_pid() { + pidof /usr/sbin/inspircd +} + +case "$1" in + start) + stat_busy "Starting inspircd" + PID=$(get_pid) + if [ -z "$PID" ]; then + su -s /bin/sh -c '/usr/sbin/inspircd --logfile /var/log/inspircd/startup.log --config /etc/inspircd/inspircd.conf' 'inspircd' > /dev/null + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + add_daemon inspircd + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping inspircd" + PID=$(get_pid) + [ ! -z "$PID" ] && kill $PID + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm_daemon inspircd + stat_done + fi + ;; + + restart) + $0 stop + $0 start + ;; + + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 -- cgit v1.2.3-2-g168b