--- coolmail-1.3.orig/Makefile +++ coolmail-1.3/Makefile @@ -24,7 +24,7 @@ # files for coolmail when you type `make install'. CFLAGS = LINK = $(CC) -INCLUDES = -I/usr/X11R5/include +INCLUDES = -I/usr/X11R6/include LIB_DIRS = -L/usr/X11R6/lib BINDIR = /usr/local/bin MANDIR = /usr/local/man/man1 @@ -34,10 +34,17 @@ AUDIO = -DAUDIO AUDIO_MODULE = audio.o +# Comment these out if you don't want Maildir support +MAILDIR = -DSUPPORT_MAILDIR +# for debugging: +#MAILDIR = $(MAILDIR) -DSUPPORT_MAILDIR_DEBUG +# normally ignores non-regular files in the Maildir; uncomment to change +#MAILDIR = $(MAILDIR) -DSUPPORT_MAILDIR_STRICTER + #### You really don't need to read past this point. #### LIBS = $(LIB_DIRS) -lXt -lX11 -lm -lXext -COPTS = $(CFLAGS) $(AUDIO) +COPTS = $(CFLAGS) $(AUDIO) $(MAILDIR) all: coolmail # Done. --- coolmail-1.3.orig/audio.c +++ coolmail-1.3/audio.c @@ -63,8 +63,13 @@ u_32 channels; /* number of interleaved channels */ } Audio_filehdr; -#ifdef linux +#if defined(linux) || defined(__FreeBSD_kernel__) + +#if defined(linux) #include +#else +#include +#endif #define DEV_MIXER "/dev/mixer" #define MAX_VOLUME 100 @@ -101,7 +106,7 @@ #define CLOSE_FD(afd) { if (afd > -1) close(afd); afd = -1; } -#ifdef linux +#if defined(linux) || defined(__FreeBSD_kernel__) #define INIT_FD { audiofd = filefd = mixer_fd = -1; } #define END_FD { CLOSE_FD(audiofd); CLOSE_FD(filefd); CLOSE_FD(mixer_fd); return; } #else @@ -117,7 +122,7 @@ unsigned char buf[256]; Audio_filehdr *au_hdr; -#ifdef linux +#if defined(linux) || defined(__FreeBSD_kernel__) StereoVolume origVol, volume; int mixer_fd; #else @@ -125,14 +130,18 @@ int origVol; #endif + /* NOP if requested volume is zero. */ + if (cool_vol <= 0) return; + INIT_FD; audiofd = open( "/dev/audio", O_WRONLY | O_NDELAY ); if (audiofd < 0) { + perror("/dev/audio"); fprintf(stderr, "%s: Problem opening /dev/audio.\n", "Coolmail"); END_FD; } -#ifdef linux +#if defined(linux) || defined(__FreeBSD_kernel__) if ( (mixer_fd=open(DEV_MIXER, O_RDWR, 0)) < 0 ) { fprintf(stderr, "Can't open %s: ", DEV_MIXER); END_FD; @@ -185,7 +194,7 @@ /* Strip the header */ au_hdr = (Audio_filehdr *)buf; -#ifdef linux +#if defined(linux) || defined(__FreeBSD_kernel__) rn = ntohl(au_hdr->hdr_size) - sizeof(Audio_filehdr); #else rn = au_hdr->hdr_size - sizeof(Audio_filehdr); @@ -217,7 +226,7 @@ usleep(1000); } } -#ifdef linux +#if defined(linux) || defined(__FreeBSD_kernel__) CLOSE_FD(audiofd); if ( ioctl(mixer_fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &origVol) < 0 ) { --- coolmail-1.3.orig/coolmail.c +++ coolmail-1.3/coolmail.c @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef AUDIO #include @@ -96,7 +97,7 @@ int main(int argc, char *argv[]) { int reason; - char username[L_cuserid]; + struct passwd *uid; /* Quickly scan for the -h option -- if it is present don't do anything * but print out some help and exit. */ @@ -104,7 +105,11 @@ return(0); /* Get the username and use it to create a default mailfile name */ - strcat(mailfile_str, cuserid(username)); + if (!(uid = getpwuid(geteuid()))) { + printf("Couldn't determine your username. Exiting.\n"); + return 1; + } + strcat(mailfile_str, uid->pw_name); /* Initialize the renderer */ rend_init(&argc, argv, (float)150.0); --- coolmail-1.3.orig/debian/dirs +++ coolmail-1.3/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/man/man1/ + --- coolmail-1.3.orig/debian/control +++ coolmail-1.3/debian/control @@ -0,0 +1,15 @@ +Source: coolmail +Section: mail +Priority: optional +Maintainer: Fredrik Hallenberg +Standards-Version: 3.8.0 +Build-Depends: libx11-dev, libxext-dev, libxmu-dev, libxt-dev, debhelper (>= 4) + +Package: coolmail +Architecture: any +Depends: ${shlibs:Depends} +Description: Mail notifier with 3d graphics + Coolmail is like xbiff -- it watches your inbox mail file + and lets you know when you have mail. But unlike xbiff, it can launch + your favorite mail utility when you click on it, and it has cool + animated 3D graphics. --- coolmail-1.3.orig/debian/rules +++ coolmail-1.3/debian/rules @@ -0,0 +1,55 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp +build-stamp: + dh_testdir + + $(MAKE) CFLAGS="-O2 -g" + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + -$(MAKE) new + + dh_clean + +# Build architecture-independent files here. +binary-indep: build +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) BINDIR=`pwd`/debian/coolmail/usr/bin MANDIR=`pwd`/debian/coolmail/usr/share/man/man1 install + rm -rf debian/coolmail/usr/X11R6/lib + mkdir -p debian/coolmail/etc/X11/app-defaults + install -m644 Coolmail.ad debian/coolmail/etc/X11/app-defaults/Coolmail + + dh_installdocs README + dh_installchangelogs README.changes + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- coolmail-1.3.orig/debian/changelog +++ coolmail-1.3/debian/changelog @@ -0,0 +1,75 @@ +coolmail (1.3-11) unstable; urgency=low + + * Fixed lintian warnings. + + -- Fredrik Hallenberg Sun, 28 Dec 2008 14:53:00 +0100 + +coolmail (1.3-10) unstable; urgency=low + + * Applied patch from Cyril Brulebois + to fix compile problem on GNU/kFreeBSD (closes: #414328) + + -- Fredrik Hallenberg Wed, 11 Apr 2007 18:50:29 +0200 + +coolmail (1.3-9) unstable; urgency=low + + * Added patch from Ubuntu bug #57632 by + Michael Bienia to fix crash on amd64 + by using getpwuid(geteuid()) instead of cuserid() (closes: #402973) + + -- Fredrik Hallenberg Fri, 15 Dec 2006 21:55:59 +0100 + +coolmail (1.3-8) unstable; urgency=low + + * Fixed build-depends (closes: #346647) + + -- Fredrik Hallenberg Sat, 14 Jan 2006 18:33:25 +0100 + +coolmail (1.3-7) unstable; urgency=low + + * Fixed lintian warning, duplicate-conffile + + -- Fredrik Hallenberg Sun, 5 Dec 2004 16:08:59 +0100 + +coolmail (1.3-6) unstable; urgency=low + + * Applied maildir patch. + * Use debhelper level 4. + + -- Fredrik Hallenberg Fri, 30 Jul 2004 18:33:22 +0200 + +coolmail (1.3-5) unstable; urgency=low + + * Applied patch from Matto Marjanovic + (closes: #169162) to fix some minor sound volume problems. + * Bumped standards revision. + + -- Fredrik Hallenberg Mon, 26 Jan 2004 21:27:00 +0100 + +coolmail (1.3-4) unstable; urgency=low + + * Make /etc/app-defaults/Coolmail a conffile (closes: #132156) + * Fixed X11 include path + * Install in /usr/bin instead of /usr/X11R6/bin + * Bump standards revision + + -- Fredrik Hallenberg Sat, 9 Feb 2002 11:54:49 +0100 + +coolmail (1.3-3) unstable; urgency=low + + * Move app-defaults (closes: #86264) + * Update to standards revision 3.1.1 + + -- Fredrik Hallenberg Sat, 17 Feb 2001 10:53:05 +0100 + +coolmail (1.3-2) unstable; urgency=low + + * Make sure coolmail.orig.tar.gz is uploaded (closes: #44228) + + -- Fredrik Hallenberg Sun, 5 Sep 1999 16:56:38 +0200 + +coolmail (1.3-1) unstable; urgency=low + + * Initial Release. + + -- Fredrik Hallenberg Sat, 11 Apr 1998 02:33:26 +0200 --- coolmail-1.3.orig/debian/compat +++ coolmail-1.3/debian/compat @@ -0,0 +1 @@ +4 --- coolmail-1.3.orig/debian/copyright +++ coolmail-1.3/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by Fredrik Hallenberg hallon@debian.org on +Sat, 11 Apr 1998 02:33:26 +0200. + +It was downloaded from +ftp://ftp.csupomona.edu/pub/unix/X11/coolmail-1.3.tar.gz + +Copyright: + + Byron C. Darrah + Email: + US Postal Mail: 546 Prospectors Rd, Diamond Bar, CA 91765, USA. + + coolmail, v 1.0 30-Dec-1994 + coolmail, v 1.1 06-Jan-1995 + coolmail, v 1.2 09-Feb-1995 + coolmail, v 1.3 19-Sep-1995 + + Copyright (C) 1994 Byron C. Darrah + Copyright (C) 1995 Byron C. Darrah + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + On Debian GNU/Linux systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL'. + --- coolmail-1.3.orig/system/X11/display_list.c +++ coolmail-1.3/system/X11/display_list.c @@ -306,9 +306,9 @@ /* play the soundfile */ audio_beep(); else /* no sound file chosen then use system bell */ - XBell(XtDisplay(main_gfx_w), cool_vol); + XBell(XtDisplay(main_gfx_w), (2*cool_vol)-100); #else - XBell(XtDisplay(main_gfx_w), 50); + XBell(XtDisplay(main_gfx_w), 0); #endif }