Anonymous avatar Anonymous committed 9634200

change Makefile to install pcw_win.sh and correctly create dist tarball

Comments (0)

Files changed (2)

 	@echo CC -o $@
 	@${CC} -o $@ $< ${LDFLAGS}
 
-${OBJ}: config.h config.mk
-
-config.h:
-	@echo creating $@ from config.def.h
-	@cp config.def.h $@
+${OBJ}: config.mk
 
 clean:
 	@echo cleaning
 	@echo creating dist tarball
 	@mkdir -p pcw-${VERSION}
 	@cp -R LICENSE Makefile README config.mk pcw.1 \
-		ii*.diff config.def.h cw_color.sh ${SRC} pcw-${VERSION}
+		pcw_win.sh patches extras ${SRC} pcw-${VERSION}
 	@tar -cf pcw-${VERSION}.tar pcw-${VERSION}
 	@gzip pcw-${VERSION}.tar
 	@rm -rf pcw-${VERSION}
 	@mkdir -p ${DESTDIR}${PREFIX}/bin
 	@for bin in ${BIN}; do cp -f $$bin ${DESTDIR}${PREFIX}/bin/$$bin; done
 	@for bin in ${BIN}; do chmod 755   ${DESTDIR}${PREFIX}/bin/$$bin; done
+	@cp -f pcw_win.sh ${DESTDIR}${PREFIX}/bin/pcw_win.sh
+	@chmod 755  ${DESTDIR}${PREFIX}/bin/pcw_win.sh
 	@echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
 	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
 	@sed "s/VERSION/${VERSION}/g" < pcw.1 > ${DESTDIR}${MANPREFIX}/man1/pcw.1
 uninstall:
 	@echo removing executables from ${DESTDIR}${PREFIX}/bin
 	@for bin in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$bin; done
+	@rm -f ${DESTDIR}${PREFIX}/bin/pcw_win.sh
 	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
 	@rm -f ${DESTDIR}${MANPREFIX}/man1/pcw.1
 

patches/ii-1.4-emg.diff

 diff -r d93eaacde742 config.mk
 --- a/config.mk	Fri Jun 25 10:55:05 2010 +0200
-+++ b/config.mk	Sat Jul 24 11:07:10 2010 -0700
++++ b/config.mk	Fri Jul 30 01:45:19 2010 -0700
 @@ -12,7 +12,7 @@
  
  INCDIR      = ${PREFIX}/include
  INCLUDES    = -I. -I${INCDIR} -I/usr/include
 diff -r d93eaacde742 ii.1
 --- a/ii.1	Fri Jun 25 10:55:05 2010 +0200
-+++ b/ii.1	Sat Jul 24 11:07:10 2010 -0700
-@@ -33,6 +33,8 @@
- .IR nickname ]
- .RB [ \-f
- .IR realname ]
-+.RB [ \-m
-+.IR padding ]
- 
- .SH OPTIONS
- .TP
-@@ -55,6 +57,9 @@
- .TP
- .BI \-f " realname"
- lets you specify your real name associated with your nick
-+.TP
-+.BI \-m " padding"
-+lets you specify to what length ii should pad nicks (default 10)
- 
- .SH DIRECTORIES
- .TP
-@@ -70,12 +75,18 @@
++++ b/ii.1	Fri Jul 30 01:45:19 2010 -0700
+@@ -70,12 +70,18 @@
  .FN /a " [<message>]"
  mark yourself as away
  .TP
  .TP
 diff -r d93eaacde742 ii.c
 --- a/ii.c	Fri Jun 25 10:55:05 2010 +0200
-+++ b/ii.c	Sat Jul 24 11:07:10 2010 -0700
++++ b/ii.c	Fri Jul 30 01:45:19 2010 -0700
 @@ -33,6 +33,9 @@
  	Channel *next;
  };
  #define PING_TIMEOUT 300
  #define SERVER_PORT 6667
  static int irc;
-@@ -42,6 +45,7 @@
- static char nick[32];			/* might change while running */
- static char path[_POSIX_PATH_MAX];
- static char message[PIPE_BUF]; /* message buf used for communication */
-+static int pad = 10; /* for nick alignment */
- 
- static void usage() {
- 	fprintf(stderr, "%s",
-@@ -105,6 +109,7 @@
+@@ -105,6 +108,7 @@
  	return open(infile, O_RDONLY | O_NONBLOCK, 0);
  }
  
  static void add_channel(char *name) {
  	Channel *c;
  	int fd;
-@@ -123,13 +128,16 @@
+@@ -123,13 +127,16 @@
  		perror("ii: cannot allocate memory");
  		exit(EXIT_FAILURE);
  	}
 +
 +	if(name[0] && !IS_CHANNEL(name)) {
 +		char msg[128];
-+		snprintf(msg, sizeof(msg), "%*s-!- %s has joined %s", pad, "", nick, name);
++		snprintf(msg, sizeof(msg), "-!- %s has joined %s", nick, name);
 +		print_out(name, msg);
 +	}
  }
  
  static void rm_channel(Channel *c) {
-@@ -207,9 +215,10 @@
- 	FILE *out = NULL;
- 	time_t t = time(0);
- 
--	if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
-+	if(channel) snprintf(server, sizeof(server), "%*s-!- %s", pad, "", channel);
+@@ -210,6 +217,7 @@
+ 	if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
  	if(strstr(buf, server)) channel="";
  	create_filepath(outfile, sizeof(outfile), channel, "out");
 +	if(channel && channel[0]) add_channel(channel);
  	if(!(out = fopen(outfile, "a"))) return;
  
  	strftime(buft, sizeof(buft), "%F %R", localtime(&t));
-@@ -218,7 +227,7 @@
- }
- 
- static void proc_channels_privmsg(char *channel, char *buf) {
--	snprintf(message, PIPE_BUF, "<%s> %s", nick, buf);
-+	snprintf(message, PIPE_BUF, "%*s | %s", pad, nick, buf);
- 	print_out(channel, message);
- 	snprintf(message, PIPE_BUF, "PRIVMSG %s :%s\r\n", channel, buf);
- 	write(irc, message, strlen(message));
-@@ -228,7 +237,9 @@
+@@ -228,7 +236,9 @@
  	static char infile[256];
  	char *p = NULL;
  
  		proc_channels_privmsg(c->name, buf);
  		return;
  	}
-@@ -237,17 +248,14 @@
+@@ -237,17 +247,14 @@
  		case 'j':
  			p = strchr(&buf[3], ' ');
  			if(p) *p = 0;
  			}
  			break;
  		case 't':
-@@ -255,7 +263,7 @@
- 			break;
- 		case 'a':
- 			if(strlen(buf)>=3){
--				snprintf(message, PIPE_BUF, "-!- %s is away \"%s\"", nick, &buf[3]);
-+				snprintf(message, PIPE_BUF, "%*s-!- %s is away \"%s\"", pad, "", nick, &buf[3]);
- 				print_out(c->name, message);
- 			}
- 			if(buf[2] == 0 || strlen(buf)<3) /* or used to make else part safe */
-@@ -277,13 +285,42 @@
+@@ -277,13 +284,42 @@
  			else
  				snprintf(message, PIPE_BUF,
  						"PART %s :ii - 500 SLOC are too much\r\n", c->name);
  		default:
  			snprintf(message, PIPE_BUF, "%s\r\n", &buf[1]);
  			break;
-@@ -343,11 +380,11 @@
+@@ -343,7 +379,7 @@
  		write(irc, message, strlen(message));
  		return;
  	} else if(!argv[TOK_NICKSRV] || !argv[TOK_USER]) {	/* server command */
 -		snprintf(message, PIPE_BUF, "%s%s", argv[TOK_ARG] ? argv[TOK_ARG] : "", argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
-+		snprintf(message, PIPE_BUF, "%*s | %s%s", pad, host, argv[TOK_ARG] ? argv[TOK_ARG] : "", argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
++		snprintf(message, PIPE_BUF, "<%s> %s%s", host, argv[TOK_ARG] ? argv[TOK_ARG] : "", argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
  		print_out(0, message);
  		return;
  	} else if(!strncmp("ERROR", argv[TOK_CMD], 6))
--		snprintf(message, PIPE_BUF, "-!- error %s", argv[TOK_TEXT] ? argv[TOK_TEXT] : "unknown");
-+		snprintf(message, PIPE_BUF, "%*s-!- error %s", pad, "", argv[TOK_TEXT] ? argv[TOK_TEXT] : "unknown");
- 	else if(!strncmp("JOIN", argv[TOK_CMD], 5)) {
- 		if(argv[TOK_TEXT] != NULL){
- 			p = strchr(argv[TOK_TEXT], ' ');
-@@ -355,23 +392,25 @@
- 				*p = 0;
- 		}
+@@ -357,6 +393,8 @@
  		argv[TOK_CHAN] = argv[TOK_TEXT];
--		snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT]);
-+		snprintf(message, PIPE_BUF, "%*s-!- %s(%s) has joined %s", pad, "", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT]);
+ 		snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT]);
  	} else if(!strncmp("PART", argv[TOK_CMD], 5)) {
--		snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
 +		if (!strcmp(nick, argv[TOK_NICKSRV]))
 +			return;
-+		snprintf(message, PIPE_BUF, "%*s-!- %s(%s) has left %s", pad, "", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
+ 		snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
  	} else if(!strncmp("MODE", argv[TOK_CMD], 5))
--		snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> %s %s", argv[TOK_NICKSRV], argv[TOK_CMD + 1] ? argv[TOK_CMD + 1] : "" , argv[TOK_CMD + 2]? argv[TOK_CMD + 2] : "", argv[TOK_CMD + 3] ? argv[TOK_CMD + 3] : "");
-+		snprintf(message, PIPE_BUF, "%*s-!- %s changed mode/%s -> %s %s", pad, "", argv[TOK_NICKSRV], argv[TOK_CMD + 1] ? argv[TOK_CMD + 1] : "" , argv[TOK_CMD + 2]? argv[TOK_CMD + 2] : "", argv[TOK_CMD + 3] ? argv[TOK_CMD + 3] : "");
- 	else if(!strncmp("QUIT", argv[TOK_CMD], 5))
--		snprintf(message, PIPE_BUF, "-!- %s(%s) has quit \"%s\"", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
-+		snprintf(message, PIPE_BUF, "%*s-!- %s(%s) has quit \"%s\"", pad, "", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
- 	else if(!strncmp("NICK", argv[TOK_CMD], 5))
--		snprintf(message, PIPE_BUF, "-!- %s changed nick to %s", argv[TOK_NICKSRV], argv[TOK_TEXT]);
-+		snprintf(message, PIPE_BUF, "%*s-!- %s changed nick to %s", pad, "", argv[TOK_NICKSRV], argv[TOK_TEXT]);
- 	else if(!strncmp("TOPIC", argv[TOK_CMD], 6))
--		snprintf(message, PIPE_BUF, "-!- %s changed topic to \"%s\"", argv[TOK_NICKSRV], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
-+		snprintf(message, PIPE_BUF, "%*s-!- %s changed topic to \"%s\"", pad, "", argv[TOK_NICKSRV], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
- 	else if(!strncmp("KICK", argv[TOK_CMD], 5))
--		snprintf(message, PIPE_BUF, "-!- %s kicked %s (\"%s\")", argv[TOK_NICKSRV], argv[TOK_ARG], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
-+		snprintf(message, PIPE_BUF, "%*s-!- %s kicked %s (\"%s\")", pad, "", argv[TOK_NICKSRV], argv[TOK_ARG], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
- 	else if(!strncmp("NOTICE", argv[TOK_CMD], 7))
--		snprintf(message, PIPE_BUF, "-!- \"%s\")", argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
-+		snprintf(message, PIPE_BUF, "%*s-!- \"%s\")", pad, "", argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
- 	else if(!strncmp("PRIVMSG", argv[TOK_CMD], 8))
--		snprintf(message, PIPE_BUF, "<%s> %s", argv[TOK_NICKSRV], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
-+		snprintf(message, PIPE_BUF, "%*s | %s", pad, argv[TOK_NICKSRV], argv[TOK_TEXT] ? argv[TOK_TEXT] : "");
- 	if(!argv[TOK_CHAN] || !strncmp(argv[TOK_CHAN], nick, strlen(nick)))
- 		print_out(argv[TOK_NICKSRV], message);
- 	else
-@@ -442,8 +481,9 @@
- 			exit(EXIT_FAILURE);
+ 		snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> %s %s", argv[TOK_NICKSRV], argv[TOK_CMD + 1] ? argv[TOK_CMD + 1] : "" , argv[TOK_CMD + 2]? argv[TOK_CMD + 2] : "", argv[TOK_CMD + 3] ? argv[TOK_CMD + 3] : "");
+@@ -443,7 +481,7 @@
  		} else if(r == 0) {
  			if(time(NULL) - last_response >= PING_TIMEOUT) {
--				print_out(NULL, "-!- ii shutting down: ping timeout");
+ 				print_out(NULL, "-!- ii shutting down: ping timeout");
 -				exit(EXIT_FAILURE);
-+				snprintf(message, PIPE_BUF, "%*s-!- ii shutting down: ping timeout", pad, "");
-+				print_out(NULL, message);
 +				exit(EXIT_TIMEOUT);
  			}
  			write(irc, ping_msg, strlen(ping_msg));
  			continue;
-@@ -471,7 +511,6 @@
+@@ -471,7 +509,6 @@
  	}
  	snprintf(nick, sizeof(nick), "%s", spw->pw_name);
  	snprintf(prefix, sizeof(prefix),"%s/irc", spw->pw_dir);
  
  	for(i = 1; (i + 1 < argc) && (argv[i][0] == '-'); i++) {
  		switch (argv[i][1]) {
-@@ -481,9 +520,13 @@
- 			case 'n': snprintf(nick,sizeof(nick),"%s", argv[++i]); break;
- 			case 'k': key = argv[++i]; break;
- 			case 'f': fullname = argv[++i]; break;
-+			case 'm': pad = strtol(argv[++i], NULL, 10); break;
+@@ -484,6 +521,9 @@
  			default: usage(); break;
  		}
  	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.