diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2013-02-18 17:31:52 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2013-02-18 17:31:52 -0500 |
commit | 0be78807ac1a050c88f847ef0e36f5cd4d9b5725 (patch) | |
tree | ba2266308391192112ed3a843f144a2d33d59d97 /pcr/inspircd | |
parent | 4d8ea59baa9963ebbca29b35c9a7ceb914119376 (diff) | |
download | abslibre-0be78807ac1a050c88f847ef0e36f5cd4d9b5725.tar.gz abslibre-0be78807ac1a050c88f847ef0e36f5cd4d9b5725.tar.bz2 abslibre-0be78807ac1a050c88f847ef0e36f5cd4d9b5725.zip |
Adding packages to pcr
Diffstat (limited to 'pcr/inspircd')
-rw-r--r-- | pcr/inspircd/PKGBUILD | 68 | ||||
-rw-r--r-- | pcr/inspircd/inspircd.install | 15 | ||||
-rw-r--r-- | pcr/inspircd/inspircd.rcd | 54 | ||||
-rw-r--r-- | pcr/inspircd/inspircd.service | 17 |
4 files changed, 154 insertions, 0 deletions
diff --git a/pcr/inspircd/PKGBUILD b/pcr/inspircd/PKGBUILD new file mode 100644 index 000000000..3de3d5e57 --- /dev/null +++ b/pcr/inspircd/PKGBUILD @@ -0,0 +1,68 @@ +pkgname=inspircd +pkgver=2.0.8 +pkgrel=2 +pkgdesc='A lightweight IRC daemon' +arch=('x86_64' 'i686' 'mips64el') +url='http://www.inspircd.org/' +license=('GPL2') +depends=('perl') +makedepends=('pkg-config' 'libmysqlclient' 'postgresql' 'sqlite3' 'libldap' 'geoip' + 'tre' 'gnutls' 'openssl' 'libgcrypt') +optdepends=('gnutls: m_ssl_gnutls' + 'libgcrypt: m_ssl_gnutls' + 'openssl: m_ssl_openssl' + 'libmysqlclient: 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 + +source=(https://github.com/downloads/inspircd/inspircd/InspIRCd-$pkgver.tar.bz2 + inspircd.rcd inspircd.service) +sha1sums=('c8bcbc222df40bc8110cefdb4a1fee91ad7c73d1' + '59c4aa6929732fb076ca2be96a01385cae9e8484' + '667b28d0d086be6daad7a0c2f110c68e6526264e') + +build() { + cd "${srcdir}/inspircd" + + ./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 -Dm644 "${srcdir}"/inspircd.service "${pkgdir}"/usr/lib/systemd/system/inspircd.service + install -o141 -g141 -dm750 "${pkgdir}/var/log/inspircd" + + cd "${srcdir}/inspircd" + make DESTDIR="$pkgdir" INSTUID=141 install + + mkdir -p "${pkgdir}"/usr/share/inspircd + mv "${pkgdir}"/etc/inspircd/examples "${pkgdir}"/usr/share/inspircd/examples + + rm -rf "${pkgdir}"/usr/lib/inspircd/logs + rm -rf "${pkgdir}"/usr/lib/inspircd/data +} diff --git a/pcr/inspircd/inspircd.install b/pcr/inspircd/inspircd.install new file mode 100644 index 000000000..ec97113f5 --- /dev/null +++ b/pcr/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 '==> <pid file="/var/run/inspircd/inspircd.pid">' + 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/pcr/inspircd/inspircd.rcd b/pcr/inspircd/inspircd.rcd new file mode 100644 index 000000000..5dbd8198e --- /dev/null +++ b/pcr/inspircd/inspircd.rcd @@ -0,0 +1,54 @@ +#!/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 + ;; + + rehash|reload) + kill -HUP $(get_pid) + ;; + + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/pcr/inspircd/inspircd.service b/pcr/inspircd/inspircd.service new file mode 100644 index 000000000..83230b65c --- /dev/null +++ b/pcr/inspircd/inspircd.service @@ -0,0 +1,17 @@ +[Unit] +Description=InspIRCd IRC daemon +Requires=network.target +After=network.target + +[Service] +Type=forking +PIDFile=/var/lib/inspircd/inspircd.pid +ExecStart=/usr/lib/inspircd/inspircd start +ExecReload=/usr/lib/inspircd/inspircd rehash +ExecStop=/usr/lib/inspircd/inspircd stop +Restart=on-failure +User=inspircd +Group=inspircd + +[Install] +Alias=ircd.service |