FreeBSD Bugzilla – Attachment 2294 Details for
Bug 7186
New port: coolmail (xbiff clone)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
file.shar
file.shar (text/plain), 14.20 KB, created by
Udo Schweigert
on 1998-07-06 14:50:01 UTC
(
hide
)
Description:
file.shar
Filename:
MIME Type:
Creator:
Udo Schweigert
Created:
1998-07-06 14:50:01 UTC
Size:
14.20 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># coolmail ># coolmail/files ># coolmail/files/md5 ># coolmail/patches ># coolmail/patches/patch-aa ># coolmail/pkg ># coolmail/pkg/COMMENT ># coolmail/pkg/DESCR ># coolmail/pkg/PLIST ># coolmail/Makefile ># >echo c - coolmail >mkdir -p coolmail > /dev/null 2>&1 >echo c - coolmail/files >mkdir -p coolmail/files > /dev/null 2>&1 >echo x - coolmail/files/md5 >sed 's/^X//' >coolmail/files/md5 << 'END-of-coolmail/files/md5' >XMD5 (coolmail-1.3.tgz) = ee355b05b3ebdb9bcf8e83eda63199df >END-of-coolmail/files/md5 >echo c - coolmail/patches >mkdir -p coolmail/patches > /dev/null 2>&1 >echo x - coolmail/patches/patch-aa >sed 's/^X//' >coolmail/patches/patch-aa << 'END-of-coolmail/patches/patch-aa' >Xdiff -rc coolmail-1.3.org/Makefile coolmail-1.3/Makefile >X*** coolmail-1.3.org/Makefile Thu Jan 11 18:55:40 1996 >X--- coolmail-1.3/Makefile Fri Jul 3 09:02:25 1998 >X*************** >X*** 22,52 **** >X # your linker where to find the libraries it will need, and BINDIR and >X # MANDIR specify the places to install the binary executable and manpage >X # files for coolmail when you type `make install'. >X! CFLAGS = >X LINK = $(CC) >X! INCLUDES = -I/usr/X11R5/include >X! LIB_DIRS = -L/usr/X11R5/lib >X BINDIR = /usr/local/bin >X MANDIR = /usr/local/man/man1 >X >X # Comment these out if you can't or don't want to use the digitized audio >X # feature. >X! AUDIO = -DAUDIO >X! AUDIO_MODULE = audio.o >X >X #### You really don't need to read past this point. #### >X >X LIBS = $(LIB_DIRS) -lXt -lX11 -lm -lXext >X! COPTS = $(CFLAGS) $(AUDIO) >X >X all: coolmail >X # Done. >X >X! new: >X! rm -f *.o coolmail core >X >X clean: >X! rm -f *.o core >X >X install: >X @if [ -w $(BINDIR) ] ; then \ >X--- 22,58 ---- >X # your linker where to find the libraries it will need, and BINDIR and >X # MANDIR specify the places to install the binary executable and manpage >X # files for coolmail when you type `make install'. >X! CFLAGS = -DNO_CUSERID >X LINK = $(CC) >X! INCLUDES = -I/usr/X11R6/include >X! LIB_DIRS = -L/usr/X11R6/lib >X BINDIR = /usr/local/bin >X MANDIR = /usr/local/man/man1 >X >X # Comment these out if you can't or don't want to use the digitized audio >X # feature. >X! # AUDIO = -DAUDIO >X! # AUDIO_MODULE = audio.o >X! >X! # Comment these out if you don't want Maildir support >X! MAILDIR = -DSUPPORT_MAILDIR >X! # for debugging: >X! #MAILDIR = $(MAILDIR) -DSUPPORT_MAILDIR_DEBUG >X! # normally ignores non-regular files in the Maildir; uncomment to change >X! #MAILDIR = $(MAILDIR) -DSUPPORT_MAILDIR_STRICTER >X >X #### You really don't need to read past this point. #### >X >X LIBS = $(LIB_DIRS) -lXt -lX11 -lm -lXext >X! COPTS = $(CFLAGS) $(AUDIO) $(MAILDIR) >X >X all: coolmail >X # Done. >X >X! new: clean all >X >X clean: >X! rm -f *.o core coolmail >X >X install: >X @if [ -w $(BINDIR) ] ; then \ >Xdiff -rc coolmail-1.3.org/audio.c coolmail-1.3/audio.c >X*** coolmail-1.3.org/audio.c Thu Jan 11 18:56:40 1996 >X--- coolmail-1.3/audio.c Fri Jul 3 08:47:51 1998 >X*************** >X*** 128,133 **** >X--- 128,134 ---- >X INIT_FD; >X audiofd = open( "/dev/audio", O_WRONLY | O_NDELAY ); >X if (audiofd < 0) { >X+ perror("/dev/audio"); >X fprintf(stderr, "%s: Problem opening /dev/audio.\n", >X "Coolmail"); >X END_FD; >Xdiff -rc coolmail-1.3.org/coolmail.c coolmail-1.3/coolmail.c >X*** coolmail-1.3.org/coolmail.c Thu Jan 11 18:57:24 1996 >X--- coolmail-1.3/coolmail.c Fri Jul 3 09:01:05 1998 >X*************** >X*** 25,32 **** >X--- 25,34 ---- >X #include <sys/wait.h> >X #include <sys/types.h> >X #include <sys/stat.h> >X+ #include <dirent.h> >X #include <fcntl.h> >X >X+ >X #ifdef AUDIO >X #include <string.h> >X #endif >X*************** >X*** 34,41 **** >X #include "render1.h" >X #include "mailbox.h" >X >X! #define DEFAULT_MAIL_DIR "/var/spool/mail/" >X! #define DEFAULT_COMMAND "xterm -n Elm -e mail\0" >X #define DEFAULT_INTERVAL 30 >X #define DEFAULT_FRAMES 15 >X >X--- 36,44 ---- >X #include "render1.h" >X #include "mailbox.h" >X >X! #define DEFAULT_MAIL_DIR "/var/mail/" >X! >X! #define DEFAULT_COMMAND "xterm -n Elm -e elm\0" >X #define DEFAULT_INTERVAL 30 >X #define DEFAULT_FRAMES 15 >X >X*************** >X*** 96,102 **** >X--- 99,107 ---- >X int main(int argc, char *argv[]) >X { >X int reason; >X+ #ifndef NO_CUSERID >X char username[L_cuserid]; >X+ #endif >X >X /* Quickly scan for the -h option -- if it is present don't do anything >X * but print out some help and exit. */ >X*************** >X*** 104,110 **** >X return(0); >X >X /* Get the username and use it to create a default mailfile name */ >X! strcat(mailfile_str, cuserid(username)); >X >X /* Initialize the renderer */ >X rend_init(&argc, argv, (float)150.0); >X--- 109,126 ---- >X return(0); >X >X /* Get the username and use it to create a default mailfile name */ >X! #ifdef SUPPORT_MAILDIR >X! if (getenv("MAILDIR") && strlen(getenv("MAILDIR"))) { >X! strcpy(mailfile_str,getenv("MAILDIR")); >X! } else if (getenv("MAIL") && strlen(getenv("MAIL"))) { >X! strcpy(mailfile_str,getenv("MAIL")); >X! } else >X! #endif >X! #ifndef NO_CUSERID >X! strcat(mailfile_str, cuserid(username)); >X! #else >X! strcat(mailfile_str, getlogin()); >X! #endif >X >X /* Initialize the renderer */ >X rend_init(&argc, argv, (float)150.0); >X*************** >X*** 432,438 **** >X printf(" -e command Specifies a command (usually in quotes) which\n"); >X printf(" is used to invoke your favorite mail-reading\n"); >X printf(" program.\n\n"); >X! printf(" -f filename Watch filename, instead of the default mail\n"); >X printf(" file, %s<username>.\n\n", DEFAULT_MAIL_DIR); >X printf(" -fr n Number of frames to generate for each animation.\n"); >X printf(" Set to an appropriate value for your machine's.\n"); >X--- 448,454 ---- >X printf(" -e command Specifies a command (usually in quotes) which\n"); >X printf(" is used to invoke your favorite mail-reading\n"); >X printf(" program.\n\n"); >X! printf(" -f filename Watch filename/maildir, instead of the default mail\n"); >X printf(" file, %s<username>.\n\n", DEFAULT_MAIL_DIR); >X printf(" -fr n Number of frames to generate for each animation.\n"); >X printf(" Set to an appropriate value for your machine's.\n"); >X*************** >X*** 626,631 **** >X--- 642,680 ---- >X >X /* Get file modification time */ >X >X+ >X+ /* Maildir notes (aqua@sonoma.net, Sun Jan 18 19:42:27 PST 1998): >X+ * >X+ * The maildir mail-storage standard is a replacement for the traditional >X+ * 'mbox' format, intended to remove problems with file contention, locking, >X+ * reduce corruption in the case of a program or system crash, etc, etc. >X+ * Fairly detailed description of it can be had as part of the Qmail MTA >X+ * documentation, http://www.qmail.org/qmail-manual-html/man5/maildir.html. >X+ * >X+ * The general gist of the maildir approach is that mail is stored, one >X+ # message per file, in a subtree of ~/Maildir. New mail goes in /new, >X+ * the "spool" goes in /cur, and /tmp is available to MUAs &c. Mail is >X+ * theoretically supposed to be removed from /new immediately by the >X+ * MUA, but I've observed that with mutt 0.88, at least, it isn't if >X+ * the mailfile was generated by an import script (e.g. mbox2maildir) >X+ * rather than the normal delivery agent, presumably due to naming >X+ * differences. >X+ * >X+ * Checking for new mail mostly entails checking the mtime vs. atime of >X+ * every file in /new, and the number of messages in /new; if the latter >X+ * increases, new mail was delivered -- if not, but the files' atimes >X+ * are all later than their mtimes, the MUA read the /new spool. >X+ * >X+ * The specifications suggest skipping over every .file, but reading all >X+ * the others -- I've extended this to include skipping of all non-regular >X+ * files, which seemed to make sense -- define SUPPORT_MAILDIR_STRICTER to >X+ * override this behavior. >X+ * >X+ * This process is more resource-intensive than the old scheme of merely >X+ * calling stat() for a single file -- it's an O(n) rather than O(1) >X+ * operation. >X+ * >X+ */ >X void cool_get_inboxstatus(char *filename, int *anymail, int *unreadmail, >X int *newmail) >X { >X*************** >X*** 633,670 **** >X off_t newsize; >X struct stat st; >X int fd; >X >X- fd = open (filename, O_RDONLY, 0); >X- if (fd < 0) >X- { >X- *anymail = 0; >X- *newmail = 0; >X- *unreadmail = 0; >X- newsize = 0; >X- } >X- else >X- { >X- fstat(fd, &st); >X- close(fd); >X- newsize = st.st_size; >X- >X- if (newsize > 0) >X- *anymail = 1; >X- else >X- *anymail = 0; >X- >X- if (st.st_mtime >= st.st_atime && newsize > 0) >X- *unreadmail = 1; >X- else >X- *unreadmail = 0; >X >X! if (newsize > oldsize && *unreadmail) >X! *newmail = 1; >X! else >X! *newmail = 0; >X! } >X! >X! oldsize = newsize; >X } >X >X /*---------------------------------------------------------------------------*/ >X--- 682,800 ---- >X off_t newsize; >X struct stat st; >X int fd; >X+ #ifdef SUPPORT_MAILDIR >X+ DIR *d; >X+ struct dirent *de; >X+ char maildir[256],mfn[256]; >X+ #endif >X >X >X! #ifdef SUPPORT_MAILDIR_DEBUG >X! printf("B anymail=%d, newmail=%d, unreadmail=%d, oldsize=%d, newsize=%d\n", >X! *anymail,*newmail,*unreadmail,oldsize,newsize); >X! #endif >X! #ifdef SUPPORT_MAILDIR >X! if (stat(filename,&st)==-1) { >X! *anymail = *newmail = *unreadmail = 0; >X! newsize = oldsize = 0; >X! perror(filename); >X! return; >X! } >X! if (S_ISDIR(st.st_mode)) { >X! /* likely a maildir */ >X! strcpy(maildir,filename); >X! if (maildir[strlen(maildir)-1]!='/') >X! strcat(maildir,"/"); >X! strcat(maildir,"new"); >X! if (stat(maildir,&st)==-1) { >X! perror(maildir); >X! printf("%s is not a maildir (missing/inaccessible %s)\n",filename,maildir); >X! *anymail = *newmail = *unreadmail = 0; >X! newsize = oldsize = 0; >X! return; >X! } >X! if (!S_ISDIR(st.st_mode)) { >X! printf("%s is not a directory (mode %d)\n",maildir,st.st_mode); >X! *anymail = *newmail = *unreadmail = 0; >X! newsize = oldsize = 0; >X! return; >X! } >X! d=opendir(maildir); >X! newsize=0; >X! *unreadmail = 0; >X! while ((de=readdir(d))) { >X! if (de->d_name[0]=='.') /* dotfiles ignored per the maildir specs */ >X! continue; >X! strcpy(mfn,maildir); >X! if (mfn[strlen(mfn)-1]!='/') >X! strcat(mfn,"/"); >X! strcat(mfn,de->d_name); >X! if (stat(mfn,&st)==-1) { >X! perror(mfn); >X! continue; >X! } >X! #ifndef SUPPORT_MAILDIR_STRICTER >X! if (S_ISREG(st.st_mode)) >X! #endif >X! newsize++; >X! if (st.st_mtime>=st.st_atime) { >X! #ifdef SUPPORT_MAILDIR_DEBUG >X! printf("unread: %s mtime = %d, atime = %d\n",de->d_name,st.st_mtime,st.st_atime); >X! #endif >X! *unreadmail = 1; >X! } >X! } >X! closedir(d); >X! if (newsize) { >X! *anymail = 1; >X! if (newsize>oldsize && *unreadmail) >X! *newmail = 1; >X! else >X! *newmail = 0; >X! } else { >X! *anymail = *newmail = *unreadmail = 0; >X! newsize = 0; >X! } >X! #ifdef SUPPORT_MAILDIR_DEBUG >X! printf("A anymail=%d, newmail=%d, unreadmail=%d, oldsize=%d, newsize=%d\n", >X! *anymail,*newmail,*unreadmail,oldsize,newsize); >X! #endif >X! oldsize=newsize; >X! } else { >X! #endif /* SUPPORT_MAILDIR */ >X! fd = open (filename, O_RDONLY, 0); >X! if (fd < 0) >X! { >X! *anymail = 0; >X! *newmail = 0; >X! *unreadmail = 0; >X! newsize = 0; >X! } >X! else >X! { >X! fstat(fd, &st); >X! close(fd); >X! newsize = st.st_size; >X! >X! if (newsize > 0) >X! *anymail = 1; >X! else >X! *anymail = 0; >X! >X! if (st.st_mtime >= st.st_atime && newsize > 0) >X! *unreadmail = 1; >X! else >X! *unreadmail = 0; >X! >X! if (newsize > oldsize && *unreadmail) >X! *newmail = 1; >X! else >X! *newmail = 0; >X! } >X! #ifdef SUPPORT_MAILDIR >X! } >X! #endif >X! oldsize = newsize; >X } >X >X /*---------------------------------------------------------------------------*/ >END-of-coolmail/patches/patch-aa >echo c - coolmail/pkg >mkdir -p coolmail/pkg > /dev/null 2>&1 >echo x - coolmail/pkg/COMMENT >sed 's/^X//' >coolmail/pkg/COMMENT << 'END-of-coolmail/pkg/COMMENT' >XA Xbiff like mail tool with animated 3D graphics. >END-of-coolmail/pkg/COMMENT >echo x - coolmail/pkg/DESCR >sed 's/^X//' >coolmail/pkg/DESCR << 'END-of-coolmail/pkg/DESCR' >XCoolmail is like xbiff -- it watches your inbox mail file >Xand lets you know when you have mail. But unlike xbiff, it can launch >Xyour favorite mail utility when you click on it, and it has cool >Xanimated 3D graphics. >END-of-coolmail/pkg/DESCR >echo x - coolmail/pkg/PLIST >sed 's/^X//' >coolmail/pkg/PLIST << 'END-of-coolmail/pkg/PLIST' >Xbin/coolmail >Xman/man1/coolmail.1.gz >Xman/cat1/coolmail.1.gz >END-of-coolmail/pkg/PLIST >echo x - coolmail/Makefile >sed 's/^X//' >coolmail/Makefile << 'END-of-coolmail/Makefile' >X# New ports collection makefile for: coolmail >X# Version required: 1.3 >X# Date created: Mon 6 Jul 12:00:06 CEST 1998 >X# Whom: Udo Schweigert <Udo.Schweigert@mchp.siemens.de> >X# >X# $Id$ >X# >X# DISTNAME/PKGNAME/CATEGORIES/MASTER_SITES/MASTER_SITE_SUBDIR/EXTRACT_SUFX/DISTFILES. >X >XDISTNAME= coolmail-1.3 >XCATEGORIES= mail >XMASTER_SITES= ${MASTER_SITE_SUNSITE} >XMASTER_SITE_SUBDIR=system/mail/biffs >XEXTRACT_SUFX= .tgz >X >XMAINTAINER= Udo.Schweigert@mchp.siemens.de >X >XPATCH_STRIP= -p1 >X >XMAN1= coolmail.1 >X >X# NO_BUILD= yes >X# NO_PACKAGE= "Too many questions" >X# WRKSRC= ${WRKDIR} >X >Xdo-install: >X ${INSTALL_PROGRAM} ${WRKSRC}/coolmail ${PREFIX}/bin/coolmail >X ${INSTALL_MAN} ${WRKSRC}/coolmail.man ${PREFIX}/man/man1/coolmail.1; >X >Xpost-install: >X strip ${PREFIX}/bin/coolmail >X >X.include <bsd.port.mk> >END-of-coolmail/Makefile >exit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7186
: 2294