aboutsummaryrefslogtreecommitdiff
path: root/network/ircd-hybrid
diff options
context:
space:
mode:
authorEbben Aries <e@dscp.org>2018-12-31 14:11:28 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-01-05 07:49:17 +0700
commitf226d672557940eba6966bcea8c9f4a0203a4f6c (patch)
tree861bd4589f883c45afc6d9bda33a4b07e4a7e2dc /network/ircd-hybrid
parent01f09cbeec562d978f78f636e1eeed9c0d6e50c8 (diff)
network/ircd-hybrid: Added (IRC daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/ircd-hybrid')
-rw-r--r--network/ircd-hybrid/README17
-rw-r--r--network/ircd-hybrid/doinst.sh26
-rw-r--r--network/ircd-hybrid/ircd-hybrid.SlackBuild133
-rw-r--r--network/ircd-hybrid/ircd-hybrid.info10
-rw-r--r--network/ircd-hybrid/rc.ircd.new73
-rw-r--r--network/ircd-hybrid/slack-desc19
6 files changed, 278 insertions, 0 deletions
diff --git a/network/ircd-hybrid/README b/network/ircd-hybrid/README
new file mode 100644
index 000000000000..48668a59a7f6
--- /dev/null
+++ b/network/ircd-hybrid/README
@@ -0,0 +1,17 @@
+ircd-hybrid (A lightweight, high-performance IRC daemon)
+
+ircd is the server (daemon) program for the Internet Relay Chat Program. The
+ircd is a server in that its function is to "serve" the client program irc
+and other compatible programs with messages and commands. All commands and
+user messages are passed directly to the ircd for processing and relaying to
+other IRC servers.
+
+This is ircd-hybrid, the highly modified (and hopefully improved) variant of
+the original ircd program by Jarkko Oikarinen.
+
+Groupname and Username
+
+You must have the "ircd" group and user to run this script, for example:
+
+ groupadd -g 360 ircd
+ useradd -u 360 -s /bin/false -d /var/empty -g ircd ircd
diff --git a/network/ircd-hybrid/doinst.sh b/network/ircd-hybrid/doinst.sh
new file mode 100644
index 000000000000..98a9f66cdb53
--- /dev/null
+++ b/network/ircd-hybrid/doinst.sh
@@ -0,0 +1,26 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+config etc/ircd/ircd.conf.new
+preserve_perms etc/rc.d/rc.ircd.new
diff --git a/network/ircd-hybrid/ircd-hybrid.SlackBuild b/network/ircd-hybrid/ircd-hybrid.SlackBuild
new file mode 100644
index 000000000000..f21cfe42d7e1
--- /dev/null
+++ b/network/ircd-hybrid/ircd-hybrid.SlackBuild
@@ -0,0 +1,133 @@
+#!/bin/sh
+
+# Slackware build script for ircd-hybrid
+
+# Copyright 2018 Ebben Aries <e@dscp.org>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=ircd-hybrid
+BINNAM=ircd
+VERSION=${VERSION:-8.2.24}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+UIDGID=360
+if ! getent group $BINNAM; then
+ echo " You must have the \"$BINNAM\" group to run this script."
+ echo " # groupadd -g $UIDGID $BINNAM"
+ exit 1
+elif ! getent passwd $BINNAM; then
+ echo " You must have the \"$BINNAM\" user to run this script."
+ echo " # useradd -u $UIDGID -s /bin/false -d /var/empty -g $BINNAM $BINNAM"
+ exit 1
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc/ircd \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --enable-openssl \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+# Do not overwrite mkpasswd supplied via whois package
+mv $PKG/usr/bin/mkpasswd $PKG/usr/bin/mkpasswd.ircd
+
+mkdir -p $PKG/var/log/ircd
+chown ircd:ircd $PKG/var/log/ircd
+chmod 0755 $PKG/var/log/ircd
+
+mkdir -p $PKG/var/run/ircd
+chown ircd:ircd $PKG/var/run/ircd
+chmod 0750 $PKG/var/run/ircd
+
+mkdir -p $PKG/var/lib/ircd
+chown ircd:ircd $PKG/var/lib/ircd
+chmod 0750 $PKG/var/lib/ircd
+
+mkdir -p $PKG/etc/rc.d
+cat $CWD/rc.ircd.new > $PKG/etc/rc.d/rc.ircd.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COPYING INSTALL NEWS README \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/ircd-hybrid/ircd-hybrid.info b/network/ircd-hybrid/ircd-hybrid.info
new file mode 100644
index 000000000000..6d633ba27c5d
--- /dev/null
+++ b/network/ircd-hybrid/ircd-hybrid.info
@@ -0,0 +1,10 @@
+PRGNAM="ircd-hybrid"
+VERSION="8.2.24"
+HOMEPAGE="http://www.ircd-hybrid.org/"
+DOWNLOAD="https://github.com/ircd-hybrid/ircd-hybrid/archive/8.2.24/ircd-hybrid-8.2.24.tar.gz"
+MD5SUM="53e25b3358d3f39c79475edff515e726"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Ebben Aries"
+EMAIL="e@dscp.org"
diff --git a/network/ircd-hybrid/rc.ircd.new b/network/ircd-hybrid/rc.ircd.new
new file mode 100644
index 000000000000..9011ea85335c
--- /dev/null
+++ b/network/ircd-hybrid/rc.ircd.new
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# ircd-hybrid startup script for Slackware Linux
+
+NAME=ircd
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/$NAME/${NAME}.pid
+LOGFILE=/var/log/$NAME/${NAME}.log
+CONF=/etc/$NAME/${NAME}.conf
+DAEMON_ARGS="-pidfile $PIDFILE -logfile $LOGFILE"
+
+ircd_start() {
+ if [! -r $CONF ]; then
+ echo "$CONF does not appear to exist. Abort."
+ exit 1
+ fi
+
+ if [ -s $PIDFILE ]; then
+ echo "$NAME appears to already be running?"
+ exit 1
+ fi
+
+ echo "Starting IRC daemon ..."
+ sudo -u $NAME $DAEMON $DAEMON_ARGS
+}
+
+ircd_stop() {
+ if [ ! -s $PIDFILE ]; then
+ echo "$PIDFILE does not exist or is empty."
+ exit 1
+ fi
+
+ echo -n "Stopping IRC daemon..."
+ if [ -r $PIDFILE ]; then
+ kill $(cat $PIDFILE)
+ rm -f $PIDFILE
+ else
+ pkill ircd
+ fi
+ echo " done"
+}
+
+ircd_restart() {
+ ircd_stop
+ sleep 1
+ ircd_start
+}
+
+ircd_status() {
+ if [ -e $PIDFILE ]; then
+ echo "ircd is running."
+ else
+ echo "ircd is stopped."
+ exit 1
+ fi
+}
+
+case "$1" in
+'start')
+ ircd_start
+ ;;
+'stop')
+ ircd_stop
+ ;;
+'restart')
+ ircd_restart
+ ;;
+'status')
+ ircd_status
+ ;;
+*)
+ echo "usage $0 start|stop|restart|status"
+esac
diff --git a/network/ircd-hybrid/slack-desc b/network/ircd-hybrid/slack-desc
new file mode 100644
index 000000000000..1134d7c7de8a
--- /dev/null
+++ b/network/ircd-hybrid/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+ircd-hybrid: ircd-hybrid (A lightweight, high-performance IRC daemon)
+ircd-hybrid:
+ircd-hybrid: ircd is the server (daemon) program for the Internet Relay Chat
+ircd-hybrid: Program. The ircd is a server in that its function is to "serve" the
+ircd-hybrid: client program irc and other compatible programs with messages and
+ircd-hybrid: commands. All commands and user messages are passed directly to the
+ircd-hybrid: ircd for processing and relaying to other IRC servers.
+ircd-hybrid:
+ircd-hybrid: This is ircd-hybrid, the highly modified (and hopefully improved)
+ircd-hybrid: variant of the original ircd program by Jarkko Oikarinen.
+ircd-hybrid: Home-Page: http://www.ircd-hybrid.org/