Date: Wed, 8 Oct 1997 11:13:30 -0700 (PDT) From: i.vaudrey@cableinet.co.uk To: freebsd-gnats-submit@FreeBSD.ORG Subject: ports/4729: Fix for Cyrus port Message-ID: <199710081813.LAA04906@hub.freebsd.org> Resent-Message-ID: <199710081820.LAA05397@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 4729 >Category: ports >Synopsis: Fix for Cyrus port >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Oct 8 11:20:00 PDT 1997 >Last-Modified: >Originator: Ian Vaudrey >Organization: >Release: 2.2-STABLE >Environment: >Description: The Cyrus port was broken by the removal of Tcl from the base system. This patch fixs it. Also, the port now honours NOPORTDOCS and installs a local startup script for the pwcheck daemon that respects start and stop arguments. >How-To-Repeat: >Fix: Apply the following patch: (Note: There are 7 new files: files/cyrus.sh.pt1, files/cyrus.sh.pt2, and patches/patch-ba through patches/patch-be.) diff -ruN cyrus.orig/Makefile cyrus/Makefile --- cyrus.orig/Makefile Tue Sep 2 11:56:37 1997 +++ cyrus/Makefile Wed Oct 8 17:00:12 1997 @@ -13,11 +13,15 @@ MAINTAINER= jfitz@FreeBSD.ORG +LIB_DEPENDS= tcl80\\.1\\.:${PORTSDIR}/lang/tcl80 BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend HAS_CONFIGURE= YES CONFIGURE_ARGS= --with-cyrus-prefix=${PREFIX}/cyrus \ - --with-cyrus-group=cyrus + --with-cyrus-group=cyrus \ + --with-tcl=${PREFIX} \ + --with-login=unix_pwcheck \ + --with-auth=unix MAN1= cyradm.1 MAN3= imclient.3 @@ -33,12 +37,14 @@ @ ${CP} ${WRKSRC}/man/quota.8 ${WRKSRC}/man/cyrquota.8 post-install: - ${MKDIR} ${PREFIX}/share/doc/cyrus/html @ ${MV} ${PREFIX}/cyrus/bin/quota ${PREFIX}/cyrus/bin/cyrquota +.if !defined(NOPORTDOCS) + ${MKDIR} ${PREFIX}/share/doc/cyrus/html .for file in acl-extension bugs changes copyrights install overview quota-extension server-design ${INSTALL_DATA} ${WRKSRC}/doc/${file} ${PREFIX}/share/doc/cyrus .endfor ${INSTALL_DATA} ${WRKSRC}/doc/html/* ${PREFIX}/share/doc/cyrus/html +.endif ${INSTALL_DATA} ${FILESDIR}/imapd.conf ${PREFIX}/etc ${MKDIR} -p -m 750 /var/spool/imap /usr/sbin/chown cyrus.cyrus /var/spool/imap @@ -56,13 +62,9 @@ ${PREFIX}/etc/imap/msg /usr/sbin/chown cyrus.cyrus ${PREFIX}/etc/imap/* echo "Installing ${PREFIX}/etc/rc.d/cyrus.sh startup file."; \ - echo "#!/bin/sh" > ${PREFIX}/etc/rc.d/cyrus.sh - echo "#" >> ${PREFIX}/etc/rc.d/cyrus.sh - echo "" >> ${PREFIX}/etc/rc.d/cyrus.sh - echo "if [ -x ${PREFIX}/cyrus/bin/pwcheck ]" >> ${PREFIX}/etc/rc.d/cyrus.sh - echo "then" >> ${PREFIX}/etc/rc.d/cyrus.sh - echo " ${PREFIX}/cyrus/bin/pwcheck & && echo -n ' pwcheck'" >> ${PREFIX}/etc/rc.d/cyrus.sh - echo "fi" >> ${PREFIX}/etc/rc.d/cyrus.sh + cat ${FILESDIR}/cyrus.sh.pt1 > ${PREFIX}/etc/rc.d/cyrus.sh + echo PREFIX=${PREFIX} >> ${PREFIX}/etc/rc.d/cyrus.sh + cat ${FILESDIR}/cyrus.sh.pt2 >> ${PREFIX}/etc/rc.d/cyrus.sh /bin/chmod 751 ${PREFIX}/etc/rc.d/cyrus.sh .include <bsd.port.mk> diff -ruN cyrus.orig/files/cyrus.sh.pt1 cyrus/files/cyrus.sh.pt1 --- cyrus.orig/files/cyrus.sh.pt1 Thu Jan 1 01:00:00 1970 +++ cyrus/files/cyrus.sh.pt1 Wed Oct 8 15:06:44 1997 @@ -0,0 +1,3 @@ +#!/bin/sh +# + diff -ruN cyrus.orig/files/cyrus.sh.pt2 cyrus/files/cyrus.sh.pt2 --- cyrus.orig/files/cyrus.sh.pt2 Thu Jan 1 01:00:00 1970 +++ cyrus/files/cyrus.sh.pt2 Wed Oct 8 15:06:44 1997 @@ -0,0 +1,24 @@ + +case "$1" in + +start) + if [ -x ${PREFIX}/cyrus/bin/pwcheck ] + then + ${PREFIX}/cyrus/bin/pwcheck & && echo -n " pwcheck" + fi + ;; + +stop) + if [ -r /var/run/pwcheck.pid ] + then + kill `cat /var/run/pwcheck.pid` && echo -n " pwcheck" + fi + ;; + +*) + echo "usage: $0 {start|stop}" 1>&2 + exit 64 + ;; + +esac + diff -ruN cyrus.orig/patches/patch-ba cyrus/patches/patch-ba --- cyrus.orig/patches/patch-ba Thu Jan 1 01:00:00 1970 +++ cyrus/patches/patch-ba Wed Oct 8 15:06:44 1997 @@ -0,0 +1,46 @@ +--- pwcheck/pwcheck.c.orig Sat Dec 21 02:09:01 1996 ++++ pwcheck/pwcheck.c Wed Oct 8 15:00:36 1997 +@@ -18,9 +18,16 @@ + #include <sys/socket.h> + #include <sys/un.h> + #include <sys/uio.h> ++#include <paths.h> ++#include <unistd.h> ++#include <syslog.h> + + extern int errno; + ++#if !defined(_PATH_PWCHECKPID) ++ #define _PATH_PWCHECKPID _PATH_VARRUN "pwcheck.pid" ++#endif ++ + /* + * Unix pwcheck daemon-authenticated login (shadow password) + */ +@@ -35,6 +42,26 @@ + struct sockaddr_un clientaddr; + int r; + int len; ++ char *pid_file = _PATH_PWCHECKPID; ++ FILE *fp; ++ pid_t pid; ++ ++ /* ++ * Record process ID - shamelessly stolen from inetd (I.V.) ++ */ ++ pid = getpid(); ++ fp = fopen(pid_file, "w"); ++ if (fp) { ++ fprintf(fp, "%ld\n", (long)pid); ++ fclose(fp); ++ } else { ++ syslog(LOG_WARNING, "%s: %m", pid_file); ++ } ++ ++ /* ++ * Make sure socket is rw for everyone (T.S.) ++ */ ++ umask(0); + + s = socket(AF_UNIX, SOCK_STREAM, 0); + if (s == -1) { diff -ruN cyrus.orig/patches/patch-bb cyrus/patches/patch-bb --- cyrus.orig/patches/patch-bb Thu Jan 1 01:00:00 1970 +++ cyrus/patches/patch-bb Wed Oct 8 15:06:44 1997 @@ -0,0 +1,13 @@ +--- cyradm/Makefile.in.orig Sat Dec 21 02:07:57 1996 ++++ cyradm/Makefile.in Wed Oct 8 13:56:57 1997 +@@ -21,8 +21,8 @@ + RANLIB = @RANLIB@ + + DEFS = @DEFS@ +-CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../et @CPPFLAGS@ +-LIBS = @LIBS@ @TCLLIBS@ ++CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../et -I$(prefix)/include/tcl8.0 @CPPFLAGS@ ++LIBS = @LIBS@ -L/usr/local/lib -ltcl80 -lm + DEPLIBS = ../lib/libcyrus.a @DEPLIBS@ + + CFLAGS = @CFLAGS@ diff -ruN cyrus.orig/patches/patch-bc cyrus/patches/patch-bc --- cyrus.orig/patches/patch-bc Thu Jan 1 01:00:00 1970 +++ cyrus/patches/patch-bc Wed Oct 8 15:06:44 1997 @@ -0,0 +1,11 @@ +--- imap/Makefile.in.orig Thu Mar 13 10:23:01 1997 ++++ imap/Makefile.in Wed Oct 8 13:56:57 1997 +@@ -34,7 +34,7 @@ + CYRUS_USER=@cyrus_user@ + CYRUS_GROUP=@cyrus_group@ + +-DEFS = @DEFS@ ++DEFS = @DEFS@ -DCONFIG_FILENAME=\"$(prefix)/etc/imapd.conf\" + CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../et @CPPFLAGS@ + LIBS = @LIBS@ + DEPLIBS = ../et/libcom_err.a ../lib/libcyrus.a @DEPLIBS@ diff -ruN cyrus.orig/patches/patch-bd cyrus/patches/patch-bd --- cyrus.orig/patches/patch-bd Thu Jan 1 01:00:00 1970 +++ cyrus/patches/patch-bd Wed Oct 8 15:06:44 1997 @@ -0,0 +1,13 @@ +--- imap/config.c.orig Sat Dec 21 02:08:11 1996 ++++ imap/config.c Wed Oct 8 13:56:58 1997 +@@ -23,7 +23,9 @@ + + extern int errno; + +-#define CONFIG_FILENAME "/etc/imapd.conf" ++#if !defined(CONFIG_FILENAME) ++ #define CONFIG_FILENAME "/etc/imapd.conf" ++#endif + + struct configlist { + char *key; diff -ruN cyrus.orig/patches/patch-be cyrus/patches/patch-be --- cyrus.orig/patches/patch-be Thu Jan 1 01:00:00 1970 +++ cyrus/patches/patch-be Wed Oct 8 15:06:44 1997 @@ -0,0 +1,13 @@ +--- imap/krbck.c.orig Sat Dec 21 02:08:21 1996 ++++ imap/krbck.c Wed Oct 8 13:56:58 1997 +@@ -29,7 +29,9 @@ + + #define EXIT_CHOKE (int) 10 + +-#define CONFIG_FILENAME "/etc/imapd.conf" ++#if !defined(CONFIG_FILENAME) ++ #define CONFIG_FILENAME "/etc/imapd.conf" ++#endif + #define MAX_FILENAME_LEN 255 + + int errno; diff -ruN cyrus.orig/pkg/PLIST cyrus/pkg/PLIST --- cyrus.orig/pkg/PLIST Fri May 30 20:59:08 1997 +++ cyrus/pkg/PLIST Wed Oct 8 18:11:58 1997 @@ -62,12 +62,6 @@ share/doc/cyrus/overview share/doc/cyrus/quota-extension share/doc/cyrus/server-design -@dirrm etc/imap/user -@dirrm etc/imap/quota -@dirrm etc/imap/proc -@dirrm etc/imap/log -@dirrm etc/imap/msg -@dirrm etc/imap @dirrm include/cyrus @dirrm cyrus/bin @dirrm cyrus >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710081813.LAA04906>