Import ngircd 19.2, a lightweight irc server

input and ok sthen@ gonzalo@
This commit is contained in:
fgsch 2012-09-29 12:32:01 +00:00
parent a8528bb4c9
commit 057dc33e3f
9 changed files with 183 additions and 0 deletions

29
net/ngircd/Makefile Normal file
View File

@ -0,0 +1,29 @@
# $OpenBSD: Makefile,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
COMMENT = lightweight irc server
DISTNAME = ngircd-19.2
CATEGORIES = net
HOMEPAGE = http://ngircd.barton.de/
# GPLv2
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB = c crypto ssl z
MASTER_SITES = ftp://ftp.berlios.de/pub/ngircd/ \
http://ngircd.barton.de/pub/ngircd/
REGRESS_DEPENDS = lang/expect \
${BASE_PKGPATH}
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS += --with-openssl \
--enable-ipv6
.include <bsd.port.mk>

2
net/ngircd/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (ngircd-19.2.tar.gz) = vx1bx1VIY+KV0xdUg/W7AcywrPBqZLqbsiIVC4CM800=
SIZE (ngircd-19.2.tar.gz) = 490590

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-doc_Makefile_in,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
--- doc/Makefile.in.orig Tue Jun 19 11:36:41 2012
+++ doc/Makefile.in Sat Sep 15 23:23:24 2012
@@ -588,16 +588,13 @@ maintainer-clean-local:
all: $(generated_docs)
install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
- if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
- $(INSTALL) -m 600 -c sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
- fi
$(mkinstalldirs) $(DESTDIR)$(docdir)
for f in $(static_docs) $(toplevel_docs); do \
$(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \
done
+ $(mkinstalldirs) $(DESTDIR)${datarootdir}/examples/${PACKAGE_TARNAME}
for f in $(generated_docs); do \
- $(INSTALL) -m 644 -c $$f $(DESTDIR)$(docdir)/; \
+ $(INSTALL) -m 644 -c $$f $(DESTDIR)${datarootdir}/examples/${PACKAGE_TARNAME}; \
done
uninstall-hook:

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-doc_sample-ngircd_conf_tmpl,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
--- doc/sample-ngircd.conf.tmpl.orig Wed Sep 26 12:53:36 2012
+++ doc/sample-ngircd.conf.tmpl Wed Sep 26 12:54:00 2012
@@ -67,14 +67,14 @@
# Group ID under which the ngIRCd should run; you can use the name
# of the group or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges!
- ;ServerGID = 65534
+ ;ServerGID = _ngircd
# User ID under which the server should run; you can use the name
# of the user or the numerical ID. ATTENTION: For this to work the
# server must have been started with root privileges! In addition,
# the configuration and MOTD files must be readable by this user,
# otherwise RESTART and REHASH won't work!
- ;ServerUID = 65534
+ ;ServerUID = _ngircd
[Limits]
# Define some limits and timeouts for this ngIRCd instance. Default
@@ -122,7 +122,7 @@
# binary. By default ngIRCd won't use the chroot() feature.
# ATTENTION: For this to work the server must have been started
# with root privileges!
- ;ChrootDir = /var/empty
+ ;ChrootDir = /var/ngircd
# Set this hostname for every client instead of the real one.
# Please note: don't use the percentage sign ("%"), it is reserved for

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_ngircd_conf_c,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
--- src/ngircd/conf.c.orig Sat Sep 15 17:56:34 2012
+++ src/ngircd/conf.c Sat Sep 15 17:56:46 2012
@@ -667,7 +667,7 @@ Set_Defaults(bool InitServers)
strlcat(Conf_MotdFile, MOTD_FILE, sizeof(Conf_MotdFile));
strcpy(Conf_ServerPwd, "");
strlcpy(Conf_PidFile, PID_FILE, sizeof(Conf_PidFile));
- Conf_UID = Conf_GID = 0;
+ Conf_UID = Conf_GID = 703; /* _ngircd */
/* Limits */
Conf_ConnectRetry = 60;

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-src_ngircd_ngircd_c,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
--- src/ngircd/ngircd.c.orig Sun Sep 16 02:40:43 2012
+++ src/ngircd/ngircd.c Sun Sep 16 02:40:49 2012
@@ -531,7 +531,7 @@ Setup_FDStreams(int fd)
/**
- * Get user and group ID of unprivileged "nobody" user.
+ * Get user and group ID of unprivileged "_ngircd" user.
*
* @param uid User ID
* @param gid Group ID
@@ -555,7 +555,7 @@ NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
}
#endif
- pwd = getpwnam("nobody");
+ pwd = getpwnam("_ngircd");
if (!pwd)
return false;
@@ -659,11 +659,11 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
if (Conf_UID == 0) {
pwd = getpwuid(0);
Log(LOG_INFO,
- "ServerUID must not be %s(0), using \"nobody\" instead.",
+ "ServerUID must not be %s(0), using \"_ngircd\" instead.",
pwd ? pwd->pw_name : "?");
if (!NGIRCd_getNobodyID(&Conf_UID, &Conf_GID)) {
Log(LOG_WARNING,
- "Could not get user/group ID of user \"nobody\": %s",
+ "Could not get user/group ID of user \"_ngircd\": %s",
errno ? strerror(errno) : "not found" );
goto out;
}

5
net/ngircd/pkg/DESCR Normal file
View File

@ -0,0 +1,5 @@
ngIRCd is a free, portable and lightweight Internet Relay Chat
server for small or private networks, developed under the GNU General
Public License (GPL). It is simple to configure, can cope with
dynamic IP addresses, and supports IPv6 as well as SSL. It is written
from scratch and not based on the original IRCd.

40
net/ngircd/pkg/PLIST Normal file
View File

@ -0,0 +1,40 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
@newgroup _ngircd:703
@newuser _ngircd:703:703:daemon:ngircd account:/var/ngircd:/sbin/nologin
@man man/man5/ngircd.conf.5
@man man/man8/ngircd.8
@bin sbin/ngircd
share/doc/ngircd/
share/doc/ngircd/AUTHORS
share/doc/ngircd/Bopm.txt
share/doc/ngircd/COPYING
share/doc/ngircd/Capabilities.txt
share/doc/ngircd/ChangeLog
share/doc/ngircd/FAQ.txt
share/doc/ngircd/GIT.txt
share/doc/ngircd/HowToRelease.txt
share/doc/ngircd/INSTALL
share/doc/ngircd/Modes.txt
share/doc/ngircd/NEWS
share/doc/ngircd/PAM.txt
share/doc/ngircd/Platforms.txt
share/doc/ngircd/Protocol.txt
share/doc/ngircd/README
share/doc/ngircd/README-AUX.txt
share/doc/ngircd/README-BeOS.txt
share/doc/ngircd/README-Interix.txt
share/doc/ngircd/RFC.txt
share/doc/ngircd/SSL.txt
share/doc/ngircd/Services.txt
share/examples/ngircd/
share/examples/ngircd/sample-ngircd.conf
@mode 600
@owner _ngircd
@group _ngircd
@sample ${SYSCONFDIR}/ngircd.conf
@mode 700
@sample /var/ngircd/
@mode
@owner
@group
@rcscript ${RCDIR}/ngircd

9
net/ngircd/pkg/ngircd.rc Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# $OpenBSD: ngircd.rc,v 1.1.1.1 2012/09/29 12:32:01 fgsch Exp $
daemon="${TRUEPREFIX}/sbin/ngircd"
. /etc/rc.d/rc.subr
rc_cmd $1