diff --git a/net/ngircd/Makefile b/net/ngircd/Makefile new file mode 100644 index 00000000000..cec7a00e04f --- /dev/null +++ b/net/ngircd/Makefile @@ -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 diff --git a/net/ngircd/distinfo b/net/ngircd/distinfo new file mode 100644 index 00000000000..5022b7431c9 --- /dev/null +++ b/net/ngircd/distinfo @@ -0,0 +1,2 @@ +SHA256 (ngircd-19.2.tar.gz) = vx1bx1VIY+KV0xdUg/W7AcywrPBqZLqbsiIVC4CM800= +SIZE (ngircd-19.2.tar.gz) = 490590 diff --git a/net/ngircd/patches/patch-doc_Makefile_in b/net/ngircd/patches/patch-doc_Makefile_in new file mode 100644 index 00000000000..06fadd91b68 --- /dev/null +++ b/net/ngircd/patches/patch-doc_Makefile_in @@ -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: diff --git a/net/ngircd/patches/patch-doc_sample-ngircd_conf_tmpl b/net/ngircd/patches/patch-doc_sample-ngircd_conf_tmpl new file mode 100644 index 00000000000..078e1ced833 --- /dev/null +++ b/net/ngircd/patches/patch-doc_sample-ngircd_conf_tmpl @@ -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 diff --git a/net/ngircd/patches/patch-src_ngircd_conf_c b/net/ngircd/patches/patch-src_ngircd_conf_c new file mode 100644 index 00000000000..94375579353 --- /dev/null +++ b/net/ngircd/patches/patch-src_ngircd_conf_c @@ -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; diff --git a/net/ngircd/patches/patch-src_ngircd_ngircd_c b/net/ngircd/patches/patch-src_ngircd_ngircd_c new file mode 100644 index 00000000000..58403bbc325 --- /dev/null +++ b/net/ngircd/patches/patch-src_ngircd_ngircd_c @@ -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; + } diff --git a/net/ngircd/pkg/DESCR b/net/ngircd/pkg/DESCR new file mode 100644 index 00000000000..cb309a90bf4 --- /dev/null +++ b/net/ngircd/pkg/DESCR @@ -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. diff --git a/net/ngircd/pkg/PLIST b/net/ngircd/pkg/PLIST new file mode 100644 index 00000000000..a97b6c6fff2 --- /dev/null +++ b/net/ngircd/pkg/PLIST @@ -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 diff --git a/net/ngircd/pkg/ngircd.rc b/net/ngircd/pkg/ngircd.rc new file mode 100644 index 00000000000..0dbf23e402a --- /dev/null +++ b/net/ngircd/pkg/ngircd.rc @@ -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