File: debian.patch

package info (click to toggle)
coolmail 1.3-15
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 312 kB
  • sloc: ansic: 1,527; makefile: 69
file content (162 lines) | stat: -rw-r--r-- 4,791 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
--- coolmail-1.3.orig/Makefile
+++ coolmail-1.3/Makefile
@@ -22,9 +22,9 @@
 # your linker where to find the libraries it will need, and BINDIR and
 # MANDIR specify the places to install the binary executable and manpage
 # files for coolmail when you type `make install'.
-CFLAGS   = 
+#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 @@ MANDIR   = /usr/local/man/man1
 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)
+LIBS  = $(LIB_DIRS) -lXt -lX11 -lm
+COPTS = $(CFLAGS) $(AUDIO) $(MAILDIR)
 
 all: coolmail
 	# Done.
@@ -74,7 +81,7 @@ install:
 	fi;
 
 coolmail: coolmail.o display_list.o render1.o colors.o $(AUDIO_MODULE)
-	$(LINK) coolmail.o display_list.o render1.o  colors.o $(AUDIO_MODULE)\
+	$(LINK) $(LDFLAGS) coolmail.o display_list.o render1.o  colors.o $(AUDIO_MODULE)\
                 $(LIBS) -o coolmail 
 
 display_list.o: system/X11/display_list.c display_list.h render1.h \
--- coolmail-1.3.orig/audio.c
+++ coolmail-1.3/audio.c
@@ -63,8 +63,13 @@ typedef struct {
 	u_32		channels;	/* number of interleaved channels */
 } Audio_filehdr;
 
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD_kernel__)
+
+#if defined(linux)
 #include <linux/soundcard.h>
+#else
+#include <sys/soundcard.h>
+#endif
 
 #define DEV_MIXER		"/dev/mixer"
 #define MAX_VOLUME		100
@@ -101,7 +106,7 @@ void setvolume(int which, unsigned char
 
 #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 @@ void audio_beep (void)
 	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 @@ void audio_beep (void)
 	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 @@ void audio_beep (void)
 
 	/* 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 @@ void audio_beep (void)
 			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 <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <pwd.h>
 
 #ifdef AUDIO
 #include <string.h>
@@ -96,7 +97,7 @@ void cool_usage(void);
 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 @@ int main(int argc, char *argv[])
       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/system/X11/display_list.c
+++ coolmail-1.3/system/X11/display_list.c
@@ -306,9 +306,9 @@ void disp_bell(void)
       /* 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
 }