summaryrefslogtreecommitdiff
path: root/irc/tr-ircd/files
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2007-02-08 22:32:06 +0000
committerMartin Wilke <miwi@FreeBSD.org>2007-02-08 22:32:06 +0000
commit2ad1ee7e800292f4894cdbb8b9d37510f8653fc9 (patch)
tree93f9920ddbf0ed2f5f76512a6903ed750835f33b /irc/tr-ircd/files
parent- Update to 2.11 (diff)
- Update to 5.7.3
- Pass maintainership to submitter Changelog: - no more run as root, uses own user and group by default - RCng startup script (trircd) - fixed build for amd64 - installs bin/tr-ircd instead of bin/ircd (conflict with irc/ircd-hybrid, irc/ptlink-ircd & co.) - does not install bin/md5sum (we have our md5) (conflict with archivers/dpkg and not necessary) - run and log directories can be defined via TRIRCD_RUNDIR and TRIRCD_LOGDIR - configuration directory via TRIRCD_CONFDIR (can be specified on runtime as well) - user and group definable via TRIRCD_USER TRIRCD_GROUP PR: 108835 Submitted by: Martin Matuska <martin@matuska.org>
Notes
Notes: svn path=/head/; revision=184607
Diffstat (limited to 'irc/tr-ircd/files')
-rw-r--r--irc/tr-ircd/files/patch-Makefile.in21
-rw-r--r--irc/tr-ircd/files/patch-autoconf-ircpathgen7
-rw-r--r--irc/tr-ircd/files/patch-configure38
-rw-r--r--irc/tr-ircd/files/patch-doc-Makefile.in24
-rw-r--r--irc/tr-ircd/files/patch-doc::Makefile.in15
-rw-r--r--irc/tr-ircd/files/patch-help::Makefile.in13
-rw-r--r--irc/tr-ircd/files/patch-include-config.h26
-rw-r--r--irc/tr-ircd/files/patch-include-logtype.h25
-rw-r--r--irc/tr-ircd/files/patch-include::config.h18
-rw-r--r--irc/tr-ircd/files/patch-lib-md5-Makefile.in11
-rw-r--r--irc/tr-ircd/files/patch-newconf-Makefile.in11
-rw-r--r--irc/tr-ircd/files/patch-src-Makefile.in48
-rw-r--r--irc/tr-ircd/files/patch-src-ircsprintf.c (renamed from irc/tr-ircd/files/patch-ircsprintf.c)6
-rw-r--r--irc/tr-ircd/files/patch-wordfilter-Makefile.in11
-rw-r--r--irc/tr-ircd/files/pkg-deinstall.in22
-rw-r--r--irc/tr-ircd/files/pkg-install.in35
-rw-r--r--irc/tr-ircd/files/pkg-message.in22
-rw-r--r--irc/tr-ircd/files/tr-ircd.sh20
-rw-r--r--irc/tr-ircd/files/trircd.in51
19 files changed, 334 insertions, 90 deletions
diff --git a/irc/tr-ircd/files/patch-Makefile.in b/irc/tr-ircd/files/patch-Makefile.in
new file mode 100644
index 000000000000..f497a7c2d113
--- /dev/null
+++ b/irc/tr-ircd/files/patch-Makefile.in
@@ -0,0 +1,21 @@
+--- Makefile.in.orig Tue Feb 6 13:56:27 2007
++++ Makefile.in Tue Feb 6 13:57:25 2007
+@@ -126,18 +126,6 @@
+ echo "install ==> $$i";\
+ ${MAKE} -C $$i install ;\
+ done
+- @${bindir}/irandom.sh
+- @echo "***********************************************"
+- @echo "Please do not forget to check your example.conf"
+- @echo "When creating ircd.conf configuration file"
+- @echo "***********************************************"
+- @echo "If you have enabled the SSL option, you would"
+- @echo "Need creating an SSL Certificate. Please check"
+- @echo "out the ircdssl.conf for this."
+- @echo "The certificate can be created with the"
+- @echo "isslconfig.sh utility provided"
+- @echo "***********************************************"
+- @echo "Finished Installation"
+
+ uninstall_begin:
+ @echo "Removing binaries"
diff --git a/irc/tr-ircd/files/patch-autoconf-ircpathgen b/irc/tr-ircd/files/patch-autoconf-ircpathgen
new file mode 100644
index 000000000000..91509ba1bd05
--- /dev/null
+++ b/irc/tr-ircd/files/patch-autoconf-ircpathgen
@@ -0,0 +1,7 @@
+--- autoconf/ircpathgen.orig Tue Apr 29 15:52:16 2003
++++ autoconf/ircpathgen Tue Feb 6 15:09:50 2007
+@@ -87,3 +87,4 @@
+ echo "#define IRCD_PREFIX_VAR \"$localstatedir\"" >> $1/include/ircpath.h
+ echo "#define IRCD_PREFIX_LIB \"$libdir\"" >> $1/include/ircpath.h
+ echo "#define IRCD_PREFIX_DOC \"$datadir\"" >> $1/include/ircpath.h
++echo "#define IRCD_PREFIX_LOG \"/var/log/tr-ircd\"" >> $1/include/ircpath.h
diff --git a/irc/tr-ircd/files/patch-configure b/irc/tr-ircd/files/patch-configure
index 157de53458da..19982744e625 100644
--- a/irc/tr-ircd/files/patch-configure
+++ b/irc/tr-ircd/files/patch-configure
@@ -1,11 +1,29 @@
---- configure.orig Sat Oct 26 10:25:29 2002
-+++ configure Sat Oct 26 10:26:46 2002
-@@ -3129,7 +3129,7 @@
- ;;
- esac
- fi
--MD5SUMS=$ac_cv_path_MD5SUMS
-+MD5SUMS=../md5/$ac_cv_path_MD5SUMS
+--- configure.orig Tue Jan 18 17:06:36 2005
++++ configure Wed Feb 7 12:27:41 2007
+@@ -2688,7 +2688,7 @@
+ echo "$as_me:$LINENO: result: Detected FreeBSD: -pthread" >&5
+ echo "${ECHO_T}Detected FreeBSD: -pthread" >&6
+ IRC_CFLAGS="$IRC_CFLAGS -pthread"
+- PROG_IRCD="ircd"
++ PROG_IRCD="tr-ircd"
+ PROG_MD5SUM="md5sum"
+ PROG_TOOLS="ircpasswd"
+ ;;
+@@ -3665,7 +3665,7 @@
- if test -n "$MD5SUMS"; then
- echo "$as_me:$LINENO: result: $MD5SUMS" >&5
+
+ INSTALL="$PWD/autoconf/install-sh -c"
+-INSTALL_PROGRAM="$INSTALL -m 4755"
++INSTALL_PROGRAM="$INSTALL -m 0755"
+ INSTALL_DATA="$INSTALL -m 0644"
+
+ make_is_gmake=0
+@@ -9865,7 +9865,7 @@
+ #include <openssl/opensslv.h>
+ #include <stdlib.h>
+ int main(void) {
+- if ( (OPENSSL_VERSION_NUMBER & 0x00906000) == 0x00906000)
++ if ( OPENSSL_VERSION_NUMBER >= 0x00906000 )
+ {
+ exit(0);
+ }
diff --git a/irc/tr-ircd/files/patch-doc-Makefile.in b/irc/tr-ircd/files/patch-doc-Makefile.in
new file mode 100644
index 000000000000..8148827122e9
--- /dev/null
+++ b/irc/tr-ircd/files/patch-doc-Makefile.in
@@ -0,0 +1,24 @@
+--- doc/Makefile.in.orig Tue Feb 6 12:59:57 2007
++++ doc/Makefile.in Tue Feb 6 13:00:29 2007
+@@ -56,15 +56,21 @@
+ clean:
+
+ install: build
++
++install-conf: build
+ @echo "Installing config files"
+ $(INSTALL) -d ${sysconfdir}
+ ${INSTALL} $(DEFAULTCONFS) ${sysconfdir}
+ @touch ${sysconfdir}/kline.conf
++
++install-man: build
+ @echo "Installing manpages"
+ $(INSTALL) -d ${mandir}
+ $(INSTALL) -d ${md5mandir}
+ $(INSTALL_DATA) man/$(MANPAGE) ${mandir}
+ $(INSTALL_DATA) man/$(MD5MANPAGE) ${md5mandir}
++
++install-doc: build
+ @echo "Installing documentation"
+ $(INSTALL) -d ${datadir}/doc
+ $(INSTALL_DATA) $(DOCUMENTATION) ${datadir}/doc/
diff --git a/irc/tr-ircd/files/patch-doc::Makefile.in b/irc/tr-ircd/files/patch-doc::Makefile.in
deleted file mode 100644
index 022f172d2ae0..000000000000
--- a/irc/tr-ircd/files/patch-doc::Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
---- doc/Makefile.in.orig Sat Oct 26 10:10:17 2002
-+++ doc/Makefile.in Sat Oct 26 10:11:51 2002
-@@ -77,9 +77,9 @@
- $(INSTALL_DATA) $(CONFMANPAGE) ${confmandir}
- $(INSTALL_DATA) $(MD5MANPAGE) ${md5mandir}
- @echo "Installing documentation"
-- $(INSTALL) -d ${datadir}
-- $(INSTALL_DATA) $(DOCUMENTATION) ${datadir}
-- $(INSTALL_DATA) $(CONFS) ${datadir}
-+ $(INSTALL) -d ${datadir}/doc/tr-ircd
-+ $(INSTALL_DATA) $(DOCUMENTATION) ${datadir}/doc/tr-ircd
-+ $(INSTALL_DATA) $(CONFS) ${datadir}/doc/tr-ircd
-
- uninstall:
- @echo "Removing manpages"
diff --git a/irc/tr-ircd/files/patch-help::Makefile.in b/irc/tr-ircd/files/patch-help::Makefile.in
deleted file mode 100644
index 6870aa2b7c7e..000000000000
--- a/irc/tr-ircd/files/patch-help::Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
---- help/Makefile.in.orig Sat Oct 26 10:12:16 2002
-+++ help/Makefile.in Sat Oct 26 10:13:01 2002
-@@ -53,8 +53,8 @@
-
- install:
- @echo "Installing help files"
-- $(INSTALL) -d ${datadir}/help
-- ${CP} -R en_us ${datadir}/help/
-+ $(INSTALL) -d ${datadir}/tr-ircd/help
-+ ${CP} -R en_us ${datadir}/tr-ircd/help/
-
- uninstall:
- @echo "Removing help files"
diff --git a/irc/tr-ircd/files/patch-include-config.h b/irc/tr-ircd/files/patch-include-config.h
new file mode 100644
index 000000000000..cc3f6287546c
--- /dev/null
+++ b/irc/tr-ircd/files/patch-include-config.h
@@ -0,0 +1,26 @@
+--- include/config.h.orig Tue Jul 1 11:01:18 2003
++++ include/config.h Tue Feb 6 15:08:49 2007
+@@ -36,10 +36,10 @@
+ #define SSL_CERTIFICATE IRCD_PREFIX_ETC "/ircd.cert"
+ #define SSL_KEY IRCD_PREFIX_ETC "/ircd.key"
+
+-#define RANDFILE IRCD_PREFIX_VAR "/lib/" BASENAME "/ircd.rand" /* used to make openssl keygen faster */
+-#define ENTROPYFILE IRCD_PREFIX_VAR "/lib/" BASENAME "/ircd.entropy"
+-#define LINKSFILE IRCD_PREFIX_VAR "/lib/" BASENAME "/ircd.links"
+-#define IRCD_PIDFILE IRCD_PREFIX_VAR "/run/" BASENAME "/ircd.pid"
++#define RANDFILE IRCD_PREFIX_VAR "/ircd.rand" /* used to make openssl keygen faster */
++#define ENTROPYFILE IRCD_PREFIX_VAR "/ircd.entropy"
++#define LINKSFILE IRCD_PREFIX_VAR "/ircd.links"
++#define IRCD_PIDFILE IRCD_PREFIX_VAR "/ircd.pid"
+
+ #define MODPATH IRCD_PREFIX_LIB "/modules"
+ #define LANGPATH IRCD_PREFIX_LIB "/languages"
+@@ -47,7 +47,7 @@
+ #define CONTRIBPATH IRCD_PREFIC_LIB "/contrib"
+ #define TOOLMODPATH IRCD_PREFIX_LIB "/tools"
+
+-#define HELPPATH IRCD_PREFIX_DOC "/help"
++#define HELPPATH IRCD_PREFIX_DOC "/" BASENAME "/help"
+
+ #define CLIENTS_PREALLOCATE 2048
+ #define CHANNELS_PREALLOCATE 2048
diff --git a/irc/tr-ircd/files/patch-include-logtype.h b/irc/tr-ircd/files/patch-include-logtype.h
new file mode 100644
index 000000000000..fc387d216802
--- /dev/null
+++ b/irc/tr-ircd/files/patch-include-logtype.h
@@ -0,0 +1,25 @@
+--- include/logtype.h.orig Tue Feb 6 14:48:29 2007
++++ include/logtype.h Tue Feb 6 14:49:21 2007
+@@ -34,14 +34,14 @@
+ #define LOG_PROXYLOG 0x40 /* Element is logged to the proxy logfile */
+ #define LOG_HTTPLOG 0x80 /* Element is logged to the http logfile */
+
+-#define LOG_FN_LOGFILE IRCD_PREFIX_VAR "/log/" BASENAME "/events.log"
+-#define LOG_FN_IRCLOG IRCD_PREFIX_VAR "/log/" BASENAME "/ircd.log"
+-#define LOG_FN_DEBUGLOG IRCD_PREFIX_VAR "/log/" BASENAME "/debug.log"
+-#define LOG_FN_ERRORLOG IRCD_PREFIX_VAR "/log/" BASENAME "/error.log"
+-#define LOG_FN_STDERR IRCD_PREFIX_VAR "/log/" BASENAME "/stderr.log"
+-#define LOG_FN_STDOUT IRCD_PREFIX_VAR "/log/" BASENAME "/stdout.log"
+-#define LOG_FN_PROXY IRCD_PREFIX_VAR "/log/" BASENAME "/proxy.log"
+-#define LOG_FN_HTTPD IRCD_PREFIX_VAR "/log/" BASENAME "/httpd.log"
++#define LOG_FN_LOGFILE IRCD_PREFIX_LOG "/events.log"
++#define LOG_FN_IRCLOG IRCD_PREFIX_LOG "/ircd.log"
++#define LOG_FN_DEBUGLOG IRCD_PREFIX_LOG "/debug.log"
++#define LOG_FN_ERRORLOG IRCD_PREFIX_LOG "/error.log"
++#define LOG_FN_STDERR IRCD_PREFIX_LOG "/stderr.log"
++#define LOG_FN_STDOUT IRCD_PREFIX_LOG "/stdout.log"
++#define LOG_FN_PROXY IRCD_PREFIX_LOG "/proxy.log"
++#define LOG_FN_HTTPD IRCD_PREFIX_LOG "/httpd.log"
+
+ #define LOG_FATAL -2 /* Element is to be logged always */
+ #define LOG_ERROR -1 /* Element has error level logging */
diff --git a/irc/tr-ircd/files/patch-include::config.h b/irc/tr-ircd/files/patch-include::config.h
deleted file mode 100644
index 796e61e06c3e..000000000000
--- a/irc/tr-ircd/files/patch-include::config.h
+++ /dev/null
@@ -1,18 +0,0 @@
---- include/config.h.orig Sat Oct 26 10:03:41 2002
-+++ include/config.h Sat Oct 26 10:13:43 2002
-@@ -38,11 +38,11 @@
- #define LANGPATH IRCD_PREFIX_LIB "/languages"
- #define CHANMODEPATH IRCD_PREFIX_LIB "/chanmodes"
-
--#define LOGFILE IRCD_PREFIX_VAR "/logfiles/ircd.log"
--#define IRCD_PIDFILE IRCD_PREFIX_VAR "/ircd.pid"
--#define LINKSFILE IRCD_PREFIX_VAR "/ircd.links"
-+#define LOGFILE IRCD_PREFIX_VAR "/log/ircd.log"
-+#define IRCD_PIDFILE IRCD_PREFIX_VAR "/run/ircd.pid"
-+#define LINKSFILE IRCD_PREFIX_VAR "/run/ircd.links"
-
--#define HELPPATH IRCD_PREFIX_DOC "/help/en_us"
-+#define HELPPATH IRCD_PREFIX_DOC "/tr-ircd/help/en_us"
-
- #define USE_FAKEHOST 1
-
diff --git a/irc/tr-ircd/files/patch-lib-md5-Makefile.in b/irc/tr-ircd/files/patch-lib-md5-Makefile.in
new file mode 100644
index 000000000000..d14f22d8f1af
--- /dev/null
+++ b/irc/tr-ircd/files/patch-lib-md5-Makefile.in
@@ -0,0 +1,11 @@
+--- lib/md5/Makefile.in.orig Tue Feb 6 13:07:31 2007
++++ lib/md5/Makefile.in Tue Feb 6 13:07:47 2007
+@@ -53,6 +53,8 @@
+ depend:
+
+ install:
++
++install-md5:
+ @echo "Installing md5 utilities"
+ $(INSTALL) -d ${libexecdir}
+ $(INSTALL) $(PROGS) ${libexecdir}
diff --git a/irc/tr-ircd/files/patch-newconf-Makefile.in b/irc/tr-ircd/files/patch-newconf-Makefile.in
new file mode 100644
index 000000000000..51ac44063d53
--- /dev/null
+++ b/irc/tr-ircd/files/patch-newconf-Makefile.in
@@ -0,0 +1,11 @@
+--- newconf/Makefile.in.orig Tue Feb 6 12:54:59 2007
++++ newconf/Makefile.in Tue Feb 6 12:55:16 2007
+@@ -71,7 +71,7 @@
+ .l.c:
+ ${LEX} -i -o$@ -P`echo "$@" | awk -F_ {'print $$1'}` $<
+ .y.c:
+- ${YACC} -d $< -o $@ -p `echo "$@" | awk -F_ {'print $$1'}`
++ ${YACC} -d -o $@ -p `echo "$@" | awk -F_ {'print $$1'}` $<
+
+ .c.o:
+ ${CC} ${CFLAGS} $(INCLUDES) -I. -c $< -o $@
diff --git a/irc/tr-ircd/files/patch-src-Makefile.in b/irc/tr-ircd/files/patch-src-Makefile.in
new file mode 100644
index 000000000000..a1d01abae990
--- /dev/null
+++ b/irc/tr-ircd/files/patch-src-Makefile.in
@@ -0,0 +1,48 @@
+--- src/Makefile.in.orig Mon Jun 2 14:42:19 2003
++++ src/Makefile.in Tue Feb 6 15:10:58 2007
+@@ -61,7 +61,7 @@
+
+ OBJECTS = $(SOURCES:.c=.o) version.o
+
+-all: ircd
++all: $(IRCD_EXE)
+
+ build: all
+
+@@ -117,7 +117,7 @@
+ fi
+ $(CC) $(CFLAGS) $(INCLUDES) -c static.c -o static.o
+
+-ircd: $(OBJECTS)
++$(IRCD_EXE): $(OBJECTS)
+ ${MAKE} static-objects
+ ${MAKE} -C ../lib/zlib -f Makefile.tr-ircd build
+ ${MAKE} -C interproc build
+@@ -127,24 +127,21 @@
+ if test -n "`grep "STATIC_MODULES\ 1" ../include/setup.h`" ; then \
+ if test -n "`grep "USE_OPM\ 1" ../include/setup.h`" ; then \
+ ${MAKE} -C proxymon build ; \
+- $(CC) ${LDFLAGS} ${BITFLAGS} -o ircd $(OBJECTS) static.o httpd/httpd.so proxymon/proxymon.so $(IRCDLIBS) ; \
++ $(CC) ${LDFLAGS} ${BITFLAGS} -o $(IRCD_EXE) $(OBJECTS) static.o httpd/httpd.so proxymon/proxymon.so $(IRCDLIBS) ; \
+ else \
+- $(CC) ${LDFLAGS} ${BITFLAGS} -o ircd $(OBJECTS) static.o httpd/httpd.so $(IRCDLIBS) ; \
++ $(CC) ${LDFLAGS} ${BITFLAGS} -o $(IRCD_EXE) $(OBJECTS) static.o httpd/httpd.so $(IRCDLIBS) ; \
+ fi \
+ else \
+ if test -n "`grep "USE_OPM\ 1" ../include/setup.h`" ; then \
+ ${MAKE} -C proxymon build ; \
+ fi ; \
+- $(CC) ${LDFLAGS} ${BITFLAGS} -o ircd $(OBJECTS) static.o $(IRCDLIBS) ; \
++ $(CC) ${LDFLAGS} ${BITFLAGS} -o $(IRCD_EXE) $(OBJECTS) static.o $(IRCDLIBS) ; \
+ fi
+ $(MV) version.c version.c.last
+
+ install:
+ @echo "Installing ircd"
+ $(INSTALL) -d ${bindir}
+- $(INSTALL) -d ${localstatedir}/log/$(BN1)$(BN2)$(BN3)
+- $(INSTALL) -d ${localstatedir}/run/$(BN1)$(BN2)$(BN3)
+- $(INSTALL) -d ${localstatedir}/lib/$(BN1)$(BN2)$(BN3)
+ $(INSTALL_BIN) $(PROGS) ${bindir}
+ if test -z "`grep "STATIC_MODULES\ 1" ../include/setup.h`" ; then \
+ if test -n "`grep "USE_OPM\ 1" ../include/setup.h`" ; then \
diff --git a/irc/tr-ircd/files/patch-ircsprintf.c b/irc/tr-ircd/files/patch-src-ircsprintf.c
index b988c2d2df40..0e1010ce38ef 100644
--- a/irc/tr-ircd/files/patch-ircsprintf.c
+++ b/irc/tr-ircd/files/patch-src-ircsprintf.c
@@ -1,6 +1,6 @@
---- src/ircsprintf.c.orig Sat Aug 21 13:36:50 2004
-+++ src/ircsprintf.c Sat Aug 21 13:37:15 2004
-@@ -316,7 +316,8 @@
+--- src/ircsprintf.c.orig Tue Feb 6 12:54:02 2007
++++ src/ircsprintf.c Tue Feb 6 12:54:20 2007
+@@ -336,7 +336,8 @@
const char *format = pattern;
char *buf = str;
int len = 0;
diff --git a/irc/tr-ircd/files/patch-wordfilter-Makefile.in b/irc/tr-ircd/files/patch-wordfilter-Makefile.in
deleted file mode 100644
index 3b727453d226..000000000000
--- a/irc/tr-ircd/files/patch-wordfilter-Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- contrib/wordfilter/Makefile.in.orig Sat Aug 21 13:34:23 2004
-+++ contrib/wordfilter/Makefile.in Sat Aug 21 13:34:39 2004
-@@ -16,7 +16,7 @@
- RANLIB = @RANLIB@
- MD5SUMS = @MD5SUMS@
- LEXLIB = @LEXLIB@
--CFLAGS = @IRC_CFLAGS@ -DBASENAME=\"$(BN1)$(BN2)$(BN3)\" -DIRCD_PREFIX=\"@prefix@\"
-+CFLAGS = @IRC_CFLAGS@ -DBASENAME=\"$(BN1)$(BN2)$(BN3)\" -DIRCD_PREFIX=\"@prefix@\" -fPIC
- LDFLAGS = @LDFLAGS@
- MKDEP = @MKDEP@ -DBASENAME=\"$(BN1)$(BN2)$(BN3)\" -DIRCD_PREFIX=\"@prefix@\"
- MV = @MV@
diff --git a/irc/tr-ircd/files/pkg-deinstall.in b/irc/tr-ircd/files/pkg-deinstall.in
new file mode 100644
index 000000000000..e78a33e049fe
--- /dev/null
+++ b/irc/tr-ircd/files/pkg-deinstall.in
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+ exit 0
+fi
+
+TRIRCD_USER="%%TRIRCD_USER%%"
+TRIRCD_GROUP="%%TRIRCD_GROUP%%"
+TRIRCD_RUNDIR="%%TRIRCD_RUNDIR%%"
+TRIRCD_LOGDIR="%%TRIRCD_LOGDIR%%"
+PW="%%PW%%"
+
+if pw usershow "${TRIRCD_USER}" 2>/dev/null 1>&2; then
+ echo "This port may have created the user: ${TRIRCD_USER}"
+ echo "To delete this user, use '${PW} userdel \"${TRIRCD_USER}\"'"
+fi
+if pw usershow "${TRIRCD_GROUP}" 2>/dev/null 1>&2; then
+ echo "This port may have created the group: ${TRIRCD_GROUP}"
+ echo "To delete this group, use '${PW} groupdel \"${TRIRCD_GROUP}\"'"
+fi
+ echo "You may need to remove ${TRIRCD_RUNDIR} and ${TRIRCD_LOGDIR} manually."
+exit 0
diff --git a/irc/tr-ircd/files/pkg-install.in b/irc/tr-ircd/files/pkg-install.in
new file mode 100644
index 000000000000..47c0593fd172
--- /dev/null
+++ b/irc/tr-ircd/files/pkg-install.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+TRIRCD_USER="%%TRIRCD_USER%%"
+TRIRCD_GROUP="%%TRIRCD_GROUP%%"
+TRIRCD_RUNDIR="%%TRIRCD_RUNDIR%%"
+TRIRCD_LOGDIR="%%TRIRCD_LOGDIR%%"
+TRIRCD_CONFDIR="%%TRIRCD_CONFDIR%%"
+
+MKDIR="%%MKDIR%%"
+PW="%%PW%%"
+
+if ! ${PW} groupshow "${TRIRCD_GROUP}" 2>/dev/null 1>&2; then
+ if pw groupadd ${TRIRCD_GROUP}; then
+ echo "Added group \"${TRIRCD_GROUP}\"."
+ else
+ echo "Adding group \"${TRIRCD_GROUP}\" failed..."
+ exit 1
+ fi
+else
+ echo "You already have a group \"${TRIRCD_GROUP}\"."
+fi
+
+if ! ${PW} usershow "${TRIRCD_USER}" 2>/dev/null 1>&2; then
+ if pw useradd ${TRIRCD_USER} -g ${TRIRCD_GROUP} -h - \
+ -s "/usr/sbin/nologin" -d "%%TRIRCD_CONFDIR%%" \
+ -c "TR-IRCD pseudo-user"; \
+ then
+ echo "Added user \"${TRIRCD_USER}\"."
+ else
+ echo "Adding user \"${TRIRCD_USER}\" failed..."
+ exit 1
+ fi
+else
+ echo "You already have a user \"${TRIRCD_USER}\"."
+fi
diff --git a/irc/tr-ircd/files/pkg-message.in b/irc/tr-ircd/files/pkg-message.in
new file mode 100644
index 000000000000..9a9f74257a10
--- /dev/null
+++ b/irc/tr-ircd/files/pkg-message.in
@@ -0,0 +1,22 @@
+************************************************************************
+
+Congratulations,
+you have installed the tr-ircd irc server.
+
+You can find example configuration files in the configuration directory:
+%%TRIRCD_CONFDIR%%
+
+Please copy ircd.conf.sample to ircd.conf and edit to suit your needs.
+
+You might need to create the following additional files in the
+configuration directory: kline.conf gline.conf
+
+Tool for generating IRC password hashes:
+%%DATADIR%%/tools/ircpasswd
+
+If you want SSL enabled, you might need to create a SSL Certificate.
+Please check out "ircdssl.conf.sample" in the configuration directory.
+The certificate can be created with the following script:
+%%DATADIR%%/tools/isslconfig.sh
+
+************************************************************************
diff --git a/irc/tr-ircd/files/tr-ircd.sh b/irc/tr-ircd/files/tr-ircd.sh
deleted file mode 100644
index 9fc9fcf027d0..000000000000
--- a/irc/tr-ircd/files/tr-ircd.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/bin/ircd ] && ${PREFIX}/bin/ircd > /dev/null && echo -n ' tr-ircd'
- ;;
-stop)
- [ -r /var/run/ircd.pid ] && kill `cat /var/run/ircd.pid` && rm /var/run/ircd.pid && echo -n ' tr-ircd'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/irc/tr-ircd/files/trircd.in b/irc/tr-ircd/files/trircd.in
new file mode 100644
index 000000000000..165a2ec11818
--- /dev/null
+++ b/irc/tr-ircd/files/trircd.in
@@ -0,0 +1,51 @@
+#! /bin/sh
+#
+# PROVIDE: trircd
+# REQUIRE: DAEMON NETWORKING SERVERS
+#
+# Add the following line to /etc/rc.conf to enable trircd:
+#
+# trircd_enable="YES"
+#
+# Tweakable parameters for users to override in rc.conf
+
+. "%%RC_SUBR%%"
+
+name=trircd
+
+load_rc_config ${name}
+: ${trircd_enable="NO"}
+: ${trircd_user="%%TRIRCD_USER%%"}
+: ${trircd_group="%%TRIRCD_GROUP%%"}
+: ${trircd_confdir=%%TRIRCD_CONFDIR%%}
+: ${trircd_conf=${trircd_confdir}/ircd.conf}
+: ${trircd_pidfile=%%TRIRCD_RUNDIR%%/ircd.pid}
+: ${trircd_flags="-d ${trircd_confdir} -c ${trircd_conf} >/dev/null 2>&1"}
+
+rcvar=`set_rcvar`
+command=%%PREFIX%%/bin/tr-ircd
+pidfile=${trircd_pidfile}
+required_files="${trircd_conf}"
+start_precmd="start_precmd"
+
+irandom=%%DATADIR%%/tools/irandom.sh
+trircd_rundir=%%TRIRCD_RUNDIR%%
+trircd_logdir=%%TRIRCD_LOGDIR%%
+trircd_randfile=${trircd_rundir}/ircd.rand
+
+start_precmd()
+{
+ [ -d "${trircd_logdir}" ] || {
+ %%MKDIR%% ${trircd_logdir}
+ %%CHOWN%% ${trircd_user}:${trircd_group} ${trircd_logdir}
+ %%CHMOD%% 770 ${trircd_logdir}
+ }
+ [ -d "${trircd_rundir}" ] || {
+ %%MKDIR%% ${trircd_rundir}
+ %%CHOWN%% ${trircd_user}:${trircd_group} ${trircd_rundir}
+ %%CHMOD%% 770 ${trircd_rundir}
+ }
+ [ -f "${trircd_randfile}" ] || ${irandom}
+}
+
+run_rc_command "$1"