From: nynex Date: Wed, 22 Apr 2015 03:59:52 +0000 (+0000) Subject: Added bsd-games and abook X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d5dc10e8c4f364d4334bb594ac1cab3f683aed4b;p=librecmc%2Flibrecmc-fossil.git Added bsd-games and abook --- diff --git a/trunk/package/games/bsd-games/Makefile b/trunk/package/games/bsd-games/Makefile new file mode 100644 index 00000000..6e22fd99 --- /dev/null +++ b/trunk/package/games/bsd-games/Makefile @@ -0,0 +1,126 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bsd-games +PKG_VERSION:=2.17 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://metalab.unc.edu/pub/Linux/games/ +PKG_MD5SUM:=238a38a3a017ca9b216fc42bde405639 + +include $(INCLUDE_DIR)/package.mk + +define Package/bsd-games + SUBMENU:=bsd-games + SECTION:=games + CATEGORY:=Games + URL:=ftp://metalab.unc.edu/pub/Linux/games/ +endef + +define Build/Configure +endef +CFLAGS:= +define Build/Compile +#Building tetris + cd $(PKG_BUILD_DIR)/tetris; \ + cp pathnames.h.in pathnames.h; \ + $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include input.c screen.c shapes.c scores.c tetris.c; \ + $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o tetris input.o screen.o shapes.o scores.o tetris.o + +#Building primes + cd $(PKG_BUILD_DIR)/primes; \ + $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings pattern.c pr_tbl.c primes.c; \ + $(TARGET_CC) -lm -o primes pattern.o pr_tbl.o primes.o + +#Building worm + cd $(PKG_BUILD_DIR)/worm; \ + $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -I$(STAGING_DIR)/usr/include -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -o worm worm.c + +#Building backgammon + cd $(PKG_BUILD_DIR)/backgammon; \ + cd common_source; \ + $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include -DEXEC_PATH=\"/usr/bin/backgammon\" -DTEACH_PATH=\"/usr/bin/teachgammon\" allow.c board.c check.c fancy.c init.c odds.c one.c save.c subs.c table.c; \ + cd ../backgammon; \ + $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include -I$(PKG_BUILD_DIR)/backgammon/common_source extra.c main.c move.c text.c version.c; \ + $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o backgammon $(ECHO) ../common_source/*.o ../backgammon/*.o; \ + cd ../teachgammon; \ + $(TARGET_CC) -c -O2 -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -I$(STAGING_DIR)/usr/include -I$(PKG_BUILD_DIR)/backgammon/common_source data.c teach.c ttext1.c ttext2.c tutor.c; \ + $(TARGET_CC) -lncurses -L$(STAGING_DIR)/usr/lib -o teachgammon $(ECHO) ../common_source/*.o ../teachgammon/*.o +endef + +define Package/tetris +$(call Package/bsd-games) + TITLE:=the game of tetris + DEPENDS:=+libncurses +endef + +define Package/tetris/install + $(INSTALL_DIR) \ + $(1)/usr/bin \ + $(1)/usr/share/games + + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/tetris/tetris \ + $(1)/usr/bin/tetris +endef + +define Package/primes +$(call Package/bsd-games) + TITLE:=generate primes +endef + +define Package/primes/install + $(INSTALL_DIR) \ + $(1)/usr/bin + + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/primes/primes \ + $(1)/usr/bin/primes +endef + +define Package/worm +$(call Package/bsd-games) + TITLE:=The growing worm game + DEPENDS:=+libncurses +endef + +define Package/worm/install + $(INSTALL_DIR) \ + $(1)/usr/bin + + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/worm/worm \ + $(1)/usr/bin/worm +endef + +define Package/backgammon +$(call Package/bsd-games) + TITLE:=the game of backgammon + DEPENDS:=+libncurses +endef + +define Package/backgammon/install + $(INSTALL_DIR) \ + $(1)/usr/bin + + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/backgammon/backgammon/backgammon \ + $(1)/usr/bin/backgammon + + $(INSTALL_BIN) \ + $(PKG_BUILD_DIR)/backgammon/teachgammon/teachgammon \ + $(1)/usr/bin/teachgammon + + $(INSTALL_BIN) \ + $(FILES_DIR)/backgammon.sh \ + $(1)/usr/bin/backgammon.sh +endef + +$(eval $(call BuildPackage,tetris)) +$(eval $(call BuildPackage,primes)) +$(eval $(call BuildPackage,worm)) +$(eval $(call BuildPackage,backgammon)) diff --git a/trunk/package/games/bsd-games/files/backgammon.sh b/trunk/package/games/bsd-games/files/backgammon.sh new file mode 100644 index 00000000..652de131 --- /dev/null +++ b/trunk/package/games/bsd-games/files/backgammon.sh @@ -0,0 +1,3 @@ +#!/bin/sh +/usr/sbin/setfont2 /usr/share/setfont2/un-fuzzy-4x8-font.pnm +exec /usr/bin/backgammon diff --git a/trunk/package/games/bsd-games/patches/001-tetris.patch b/trunk/package/games/bsd-games/patches/001-tetris.patch new file mode 100644 index 00000000..b193d8a6 --- /dev/null +++ b/trunk/package/games/bsd-games/patches/001-tetris.patch @@ -0,0 +1,96 @@ +diff -ur bsd-games-2.17-p/tetris/input.c bsd-games-2.17/tetris/input.c +--- bsd-games-2.17-p/tetris/input.c 2010-11-14 21:46:54.909025861 +0300 ++++ bsd-games-2.17/tetris/input.c 2010-11-14 21:48:17.830025444 +0300 +@@ -85,7 +85,7 @@ + endtv = *tvp; + timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000; + } else +- timeout = INFTIM; ++ timeout = -1; + again: + set[0].fd = STDIN_FILENO; + set[0].events = POLLIN; +diff -ur bsd-games-2.17-p/tetris/pathnames.h.in bsd-games-2.17/tetris/pathnames.h.in +--- bsd-games-2.17-p/tetris/pathnames.h.in 2010-11-14 21:46:54.908027310 +0300 ++++ bsd-games-2.17/tetris/pathnames.h.in 2010-11-14 21:48:17.830025444 +0300 +@@ -34,4 +34,4 @@ + * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 + */ + +-#define _PATH_SCOREFILE "@tetris_scorefile@" ++#define _PATH_SCOREFILE "/usr/share/games/tetris-bsd.scores" +diff -ur bsd-games-2.17-p/tetris/screen.c bsd-games-2.17/tetris/screen.c +--- bsd-games-2.17-p/tetris/screen.c 2010-11-14 21:46:54.908027310 +0300 ++++ bsd-games-2.17/tetris/screen.c 2010-11-14 22:09:58.510150197 +0300 +@@ -73,7 +73,7 @@ + extern char PC, *BC, *UP; /* tgoto requires globals: ugh! */ + static char BCdefault[] = "\b"; + #ifndef NCURSES_VERSION +-short ospeed; ++speed_t ospeed; + #endif + + static char +@@ -287,6 +287,7 @@ + stop("tcgetattr() fails"); + newtt = oldtt; + newtt.c_lflag &= ~(ICANON|ECHO); ++#define OXTABS XTABS + newtt.c_oflag &= ~OXTABS; + newtt.c_cc[VMIN] = 1; + newtt.c_cc[VTIME] = 0; +diff -ur bsd-games-2.17-p/tetris/shapes.c bsd-games-2.17/tetris/shapes.c +--- bsd-games-2.17-p/tetris/shapes.c 2010-11-14 21:46:54.908027310 +0300 ++++ bsd-games-2.17/tetris/shapes.c 2010-11-14 21:48:17.831024977 +0300 +@@ -83,7 +83,7 @@ + const struct shape *shape; + int pos; + { +- int *o = shape->off; ++ const int *o = shape->off; + + if (board[pos] || board[pos + *o++] || board[pos + *o++] || + board[pos + *o]) +@@ -100,7 +100,7 @@ + const struct shape *shape; + int pos, onoff; + { +- int *o = shape->off; ++ const int *o = shape->off; + + board[pos] = onoff; + board[pos + *o++] = onoff; +diff -ur bsd-games-2.17-p/tetris/tetris.c bsd-games-2.17/tetris/tetris.c +--- bsd-games-2.17-p/tetris/tetris.c 2010-11-14 21:46:54.909025861 +0300 ++++ bsd-games-2.17/tetris/tetris.c 2010-11-14 22:15:43.958150419 +0300 +@@ -35,10 +35,10 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +-#endif /* not lint */ ++#endif*/ /* not lint */ + + /* + * Tetris (or however it is spelled). +@@ -145,7 +145,7 @@ + exit(1); + close(fd); + +- keys = "jkl pq"; ++ keys = "aks pq"; + + while ((ch = getopt(argc, argv, "k:l:ps")) != -1) + switch(ch) { +@@ -194,7 +194,7 @@ + } + + sprintf(key_msg, +-"%s - left %s - rotate %s - right %s - drop %s - pause %s - quit", ++"%s:<- %s:rotate %s:-> %s:drop %s:pause %s:quit", + key_write[0], key_write[1], key_write[2], key_write[3], + key_write[4], key_write[5]); + diff --git a/trunk/package/games/bsd-games/patches/002-primes.patch b/trunk/package/games/bsd-games/patches/002-primes.patch new file mode 100644 index 00000000..2ad32c66 --- /dev/null +++ b/trunk/package/games/bsd-games/patches/002-primes.patch @@ -0,0 +1,64 @@ +diff -u bsd-games-2.17/primes/pattern.c bsd-games-2.17-p/primes/pattern.c +--- bsd-games-2.17/primes/pattern.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/primes/pattern.c 2010-07-27 09:07:23.122817978 +0400 +@@ -33,13 +33,13 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: pattern.c,v 1.6 2003/08/07 09:37:33 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + /* + * pattern - the Eratosthenes sieve on odd numbers for 3,5,7,11 and 13 +diff -u bsd-games-2.17/primes/primes.c bsd-games-2.17-p/primes/primes.c +--- bsd-games-2.17/primes/primes.c 2004-01-27 23:52:07.000000000 +0300 ++++ bsd-games-2.17-p/primes/primes.c 2010-07-27 09:07:52.303319233 +0400 +@@ -33,18 +33,18 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +-#endif /* not lint */ ++#endif */ /* not lint */ + +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)primes.c 8.5 (Berkeley) 5/10/95"; + #else + __RCSID("$NetBSD: primes.c,v 1.12 2004/01/27 20:30:30 jsm Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + /* + * primes - generate a table of primes between two values +diff -u bsd-games-2.17/primes/pr_tbl.c bsd-games-2.17-p/primes/pr_tbl.c +--- bsd-games-2.17/primes/pr_tbl.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/primes/pr_tbl.c 2010-07-27 09:08:15.198301714 +0400 +@@ -33,13 +33,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: pr_tbl.c,v 1.7 2003/08/07 09:37:33 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + /* + * prime - prime table diff --git a/trunk/package/games/bsd-games/patches/003-worm.patch b/trunk/package/games/bsd-games/patches/003-worm.patch new file mode 100644 index 00000000..9705c2ea --- /dev/null +++ b/trunk/package/games/bsd-games/patches/003-worm.patch @@ -0,0 +1,26 @@ +diff -u bsd-games-2.17/worm/worm.c bsd-games-2.17-p/worm/worm.c +--- bsd-games-2.17/worm/worm.c 2004-01-27 23:52:07.000000000 +0300 ++++ bsd-games-2.17-p/worm/worm.c 2010-07-31 21:36:08.313419076 +0400 +@@ -30,18 +30,18 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +-#endif /* not lint */ ++#endif */ /* not lint */ + +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)worm.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: worm.c,v 1.25 2004/01/27 20:30:31 jsm Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + /* + * Worm. Written by Michael Toy diff --git a/trunk/package/games/bsd-games/patches/004-backgammon.patch b/trunk/package/games/bsd-games/patches/004-backgammon.patch new file mode 100644 index 00000000..41f2e2b7 --- /dev/null +++ b/trunk/package/games/bsd-games/patches/004-backgammon.patch @@ -0,0 +1,438 @@ +diff -ur bsd-games-2.17/backgammon/backgammon/extra.c bsd-games-2.17-p/backgammon/backgammon/extra.c +--- bsd-games-2.17/backgammon/backgammon/extra.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/backgammon/extra.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)extra.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: extra.c,v 1.5 2003/08/07 09:36:55 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + #include "backlocal.h" +diff -ur bsd-games-2.17/backgammon/backgammon/main.c bsd-games-2.17-p/backgammon/backgammon/main.c +--- bsd-games-2.17/backgammon/backgammon/main.c 2005-02-16 09:24:50.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/backgammon/main.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,18 +30,18 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +-#endif /* not lint */ ++#endif */ /* not lint */ + +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: main.c,v 1.21 2005/02/15 12:56:20 jsm Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include + +@@ -49,6 +49,7 @@ + #include "backlocal.h" + + #define MVPAUSE 5 /* time to sleep when stuck */ ++#define OXTABS XTABS + + extern const char *const instr[]; /* text of instructions */ + extern const char *const message[]; /* update message */ +@@ -124,7 +125,7 @@ + #ifdef V7 + while (*++argv != 0) /* process arguments */ + #else +- while (*++argv != -1) /* process arguments */ ++ while (*++argv != 0) /* process arguments */ + #endif + getarg(&argv); + args[acnt] = '\0'; +diff -ur bsd-games-2.17/backgammon/backgammon/move.c bsd-games-2.17-p/backgammon/backgammon/move.c +--- bsd-games-2.17/backgammon/backgammon/move.c 2004-01-27 23:52:07.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/backgammon/move.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: move.c,v 1.8 2004/01/27 20:30:28 jsm Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + #include "backlocal.h" +diff -ur bsd-games-2.17/backgammon/backgammon/text.c bsd-games-2.17-p/backgammon/backgammon/text.c +--- bsd-games-2.17/backgammon/backgammon/text.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/backgammon/text.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)text.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: text.c,v 1.7 2003/08/07 09:36:56 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/backgammon/version.c bsd-games-2.17-p/backgammon/backgammon/version.c +--- bsd-games-2.17/backgammon/backgammon/version.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/backgammon/version.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)version.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: version.c,v 1.6 2003/08/07 09:36:56 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + const char *const message[] = { + "Last updated on Friday, October 10, 1997.", +diff -ur bsd-games-2.17/backgammon/common_source/allow.c bsd-games-2.17-p/backgammon/common_source/allow.c +--- bsd-games-2.17/backgammon/common_source/allow.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/allow.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)allow.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: allow.c,v 1.5 2003/08/07 09:36:56 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/common_source/board.c bsd-games-2.17-p/backgammon/common_source/board.c +--- bsd-games-2.17/backgammon/common_source/board.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/board.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: board.c,v 1.7 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/common_source/check.c bsd-games-2.17-p/backgammon/common_source/check.c +--- bsd-games-2.17/backgammon/common_source/check.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/check.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)check.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: check.c,v 1.5 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/common_source/fancy.c bsd-games-2.17-p/backgammon/common_source/fancy.c +--- bsd-games-2.17/backgammon/common_source/fancy.c 2004-04-24 20:13:09.000000000 +0400 ++++ bsd-games-2.17-p/backgammon/common_source/fancy.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: fancy.c,v 1.12 2004/04/23 02:58:27 simonb Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +@@ -726,7 +726,7 @@ + lUP = strlen(UP); + if (ND) + lND = strlen(ND); +- if (LI < 24 || CO < 72 || !(CL && UP && ND)) ++ if (LI < 20 || CO < 52 || !(CL && UP && ND)) + return (0); + linect = (int *) calloc(LI + 1, sizeof(int)); + if (linect == NULL) { +diff -ur bsd-games-2.17/backgammon/common_source/init.c bsd-games-2.17-p/backgammon/common_source/init.c +--- bsd-games-2.17/backgammon/common_source/init.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/init.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: init.c,v 1.8 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include + +diff -ur bsd-games-2.17/backgammon/common_source/odds.c bsd-games-2.17-p/backgammon/common_source/odds.c +--- bsd-games-2.17/backgammon/common_source/odds.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/odds.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)odds.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: odds.c,v 1.5 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/common_source/one.c bsd-games-2.17-p/backgammon/common_source/one.c +--- bsd-games-2.17/backgammon/common_source/one.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/one.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: one.c,v 1.5 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/common_source/save.c bsd-games-2.17-p/backgammon/common_source/save.c +--- bsd-games-2.17/backgammon/common_source/save.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/save.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: save.c,v 1.10 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include + +diff -ur bsd-games-2.17/backgammon/common_source/subs.c bsd-games-2.17-p/backgammon/common_source/subs.c +--- bsd-games-2.17/backgammon/common_source/subs.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/subs.c 2011-02-15 11:22:28.989059790 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: subs.c,v 1.14 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/common_source/table.c bsd-games-2.17-p/backgammon/common_source/table.c +--- bsd-games-2.17/backgammon/common_source/table.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/common_source/table.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/* #ifndef lint + #if 0 + static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: table.c,v 1.7 2003/08/07 09:36:57 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif */ /* not lint */ + + #include "back.h" + +diff -ur bsd-games-2.17/backgammon/teachgammon/data.c bsd-games-2.17-p/backgammon/teachgammon/data.c +--- bsd-games-2.17/backgammon/teachgammon/data.c 2004-01-02 21:04:51.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/teachgammon/data.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: data.c,v 1.7 2004/01/01 15:59:09 jsm Exp $"); + #endif +-#endif /* not lint */ ++#endif *//* not lint */ + + #include "tutor.h" + +diff -ur bsd-games-2.17/backgammon/teachgammon/teach.c bsd-games-2.17-p/backgammon/teachgammon/teach.c +--- bsd-games-2.17/backgammon/teachgammon/teach.c 2005-02-16 09:24:50.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/teachgammon/teach.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,18 +30,18 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +-#endif /* not lint */ ++#endif *//* not lint */ + +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: teach.c,v 1.16 2005/02/15 12:56:20 jsm Exp $"); + #endif +-#endif /* not lint */ ++#endif *//* not lint */ + + #include "back.h" + #include "tutor.h" +@@ -59,6 +59,8 @@ + 0 + }; + ++#define OXTABS XTABS ++ + int + main(argc, argv) + int argc __attribute__((__unused__)); +@@ -81,7 +83,7 @@ + #ifdef V7 + while (*++argv != 0) + #else +- while (*++argv != -1) ++ while (*++argv != 0) + #endif + getarg(&argv); + if (tflag) { +diff -ur bsd-games-2.17/backgammon/teachgammon/ttext1.c bsd-games-2.17-p/backgammon/teachgammon/ttext1.c +--- bsd-games-2.17/backgammon/teachgammon/ttext1.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/teachgammon/ttext1.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)ttext1.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: ttext1.c,v 1.7 2003/08/07 09:36:58 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif *//* not lint */ + + #include "back.h" + #include "tutor.h" +diff -ur bsd-games-2.17/backgammon/teachgammon/ttext2.c bsd-games-2.17-p/backgammon/teachgammon/ttext2.c +--- bsd-games-2.17/backgammon/teachgammon/ttext2.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/teachgammon/ttext2.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)ttext2.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: ttext2.c,v 1.7 2003/08/07 09:36:58 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif *//* not lint */ + + #include "back.h" + #include "tutor.h" +diff -ur bsd-games-2.17/backgammon/teachgammon/tutor.c bsd-games-2.17-p/backgammon/teachgammon/tutor.c +--- bsd-games-2.17/backgammon/teachgammon/tutor.c 2003-12-17 05:47:37.000000000 +0300 ++++ bsd-games-2.17-p/backgammon/teachgammon/tutor.c 2011-02-15 11:22:28.988058843 +0300 +@@ -30,13 +30,13 @@ + */ + + #include +-#ifndef lint ++/*#ifndef lint + #if 0 + static char sccsid[] = "@(#)tutor.c 8.1 (Berkeley) 5/31/93"; + #else + __RCSID("$NetBSD: tutor.c,v 1.6 2003/08/07 09:36:58 agc Exp $"); + #endif +-#endif /* not lint */ ++#endif *//* not lint */ + + #include "back.h" + #include "tutor.h" diff --git a/trunk/package/utils/abook/Makefile b/trunk/package/utils/abook/Makefile new file mode 100644 index 00000000..0d983d70 --- /dev/null +++ b/trunk/package/utils/abook/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=abook +PKG_VERSION:=0.5.6 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=87d25df96864a7c507a4965e6d1da49d + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/abook + SECTION:=utils + CATEGORY:=Utilities + TITLE:=abook + URL:=http://abook.sourceforge.net/ + DEPENDS:=+libreadline +libncursesw +endef + +define Package/abook/description + Simple address book program. +endef + +CONFIGURE_ARGS+="--with-curses=$(STAGING_DIR)/lib" + +define Package/abook/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/abook $(1)/usr/bin +endef + +$(eval $(call BuildPackage,abook)) diff --git a/trunk/package/utils/abook/patches/001-term-size.patch b/trunk/package/utils/abook/patches/001-term-size.patch new file mode 100644 index 00000000..92e92aa4 --- /dev/null +++ b/trunk/package/utils/abook/patches/001-term-size.patch @@ -0,0 +1,247 @@ +diff -ur abook-0.5.6.orig/abook.h abook-0.5.6/abook.h +--- abook-0.5.6.orig/abook.h 2011-02-25 23:19:11.845185113 +0300 ++++ abook-0.5.6/abook.h 2011-02-25 23:19:46.911085068 +0300 +@@ -13,12 +13,12 @@ + int strncasecmp (const char *, const char *, size_t); + #endif + +-#define MAIN_HELPLINE N_("q:quit ?:help a:add r:remove") ++#define MAIN_HELPLINE N_("q:quit ?:help a:add r:remove") + + #define Y_STATUSLINE (LINES - 2) + + #define MIN_LINES 20 +-#define MIN_COLS 70 ++#define MIN_COLS 53 + + #define DEFAULT_UMASK 066 + #define DIR_IN_HOME ".abook" +diff -ur abook-0.5.6.orig/edit.c abook-0.5.6/edit.c +--- abook-0.5.6.orig/edit.c 2011-02-25 23:19:11.842184004 +0300 ++++ abook-0.5.6/edit.c 2011-02-25 23:19:28.277058807 +0300 +@@ -39,40 +39,39 @@ + editor_tab(const int tab) + { + int i, j; +- int x_pos = 2; /* current x pos */ ++ int x_pos = 0; /* current x pos */ + static char *tab_names[] = { + N_("CONTACT"), + N_("ADDRESS"), +- N_(" PHONE "), +- N_(" OTHER "), +- N_("CUSTOM ") ++ N_("PHONE"), ++ N_("OTHER"), ++ N_("CUSTOM") + }; + + mvwhline(editw, TABLINE + 1, 0, UI_HLINE_CHAR, EDITW_COLS); + + for(i = 0; i < TABS; i++) { +- int width = strwidth(gettext(tab_names[i])) + 5; ++ int width = strwidth(gettext(tab_names[i])) + 4; + + if(x_pos + width + 1 > EDITW_COLS) { + statusline_msg(_("Tab name too wide for screen")); + break; + } +- + mvwaddch(editw, TABLINE + 1, x_pos, UI_TEE_CHAR); +- mvwaddch(editw, TABLINE + 1, x_pos + width - 2, UI_TEE_CHAR); ++ mvwaddch(editw, TABLINE + 1, x_pos + width - 1, UI_TEE_CHAR); + + mvwaddch(editw, TABLINE, x_pos, UI_ULCORNER_CHAR); + mvwaddch(editw, TABLINE, x_pos + 1, UI_LBOXLINE_CHAR); + mvwaddstr(editw, TABLINE, x_pos + 2, gettext(tab_names[i])); +- mvwaddch(editw, TABLINE, x_pos + width - 3, UI_RBOXLINE_CHAR); +- mvwaddch(editw, TABLINE, x_pos + width - 2, UI_URCORNER_CHAR); ++ mvwaddch(editw, TABLINE, x_pos + width - 2, UI_RBOXLINE_CHAR); ++ mvwaddch(editw, TABLINE, x_pos + width - 1, UI_URCORNER_CHAR); + + if(i == tab) { + mvwaddch(editw, TABLINE + 1, x_pos, UI_LRCORNER_CHAR); +- for(j = 0; j < width - 3; j++) ++ for(j = 0; j < width - 2; j++) + mvwaddstr(editw, + TABLINE + 1, x_pos + j + 1, " "); +- mvwaddch(editw, TABLINE + 1, x_pos + width - 2, ++ mvwaddch(editw, TABLINE + 1, x_pos + width - 1, + UI_LLCORNER_CHAR); + } + x_pos += width; +diff -ur abook-0.5.6.orig/edit.h abook-0.5.6/edit.h +--- abook-0.5.6.orig/edit.h 2011-02-25 23:19:11.844183690 +0300 ++++ abook-0.5.6/edit.h 2011-02-25 23:19:28.277058807 +0300 +@@ -5,20 +5,20 @@ + void get_first_email(char *str, int item); + void add_item(); + +-#define EDITW_COLS (COLS - 6) ++#define EDITW_COLS COLS + #define EDITW_LINES (LINES - 5) + #define EDITW_TOP 2 +-#define EDITW_X 3 ++#define EDITW_X 0 + +-#define EDITOR_HELPLINE N_("?:help c:contact a:address p:phone o:other") ++#define EDITOR_HELPLINE N_("?:help c:cont. a:addr. p:phone o:other") + + #define TABLINE 1 + + #define MAX_TAB_FIELDS 7 + +-#define TAB_COLON_POS 28 ++#define TAB_COLON_POS 19 + #define FIELDS_START_Y 4 +-#define FIELDS_START_X 4 ++#define FIELDS_START_X 0 + + enum { + TAB_CONTACT, +diff -ur abook-0.5.6.orig/help.h abook-0.5.6/help.h +--- abook-0.5.6.orig/help.h 2011-02-25 23:19:11.844183690 +0300 ++++ abook-0.5.6/help.h 2011-02-25 23:19:28.277058807 +0300 +@@ -8,43 +8,43 @@ + /* TODO gettext: handle key and description separately? */ + static char *mainhelp[] = { + +-N_(" ? help\n"), +-N_(" q quit\n"), +-N_(" Q quit without saving\n"), +-N_(" P quit and output selected item(s) to stderr\n"), +-N_(" ^L refresh screen\n"), +-"\n", +-N_(" arrows / j,k scroll list\n"), +-N_(" enter view/edit item\n"), +-N_(" a add item\n"), +-N_(" r / del remove selected items\n"), +-N_(" D duplicate item\n"), +-"\n", +-N_(" space select item\n"), +-N_(" + select all\n"), +-N_(" - unselect all\n"), +-N_(" * invert selection\n"), +-"\n", +-N_(" w write database to disk\n"), +-N_(" l read database from disk\n"), +-N_(" C clear whole database\n"), +-N_(" i import database\n"), +-N_(" e export database\n"), +-N_(" p print database\n"), +-N_(" o open database\n"), +-"\n", +-N_(" s sort database\n"), +-N_(" S \"surname sort\"\n"), +-N_(" F sort by field (defined in configuration file)\n"), ++N_(" ? help\n"), ++N_(" q quit\n"), ++N_(" Q quit without saving\n"), ++N_(" P quit and output selected item(s) to stderr\n"), ++N_(" ^L refresh screen\n"), ++"\n", ++N_(" arrows / j,k scroll list\n"), ++N_(" enter view/edit item\n"), ++N_(" a add item\n"), ++N_(" r / del remove selected items\n"), ++N_(" D duplicate item\n"), ++"\n", ++N_(" space select item\n"), ++N_(" + select all\n"), ++N_(" - unselect all\n"), ++N_(" * invert selection\n"), ++"\n", ++N_(" w write database to disk\n"), ++N_(" l read database from disk\n"), ++N_(" C clear whole database\n"), ++N_(" i import database\n"), ++N_(" e export database\n"), ++N_(" p print database\n"), ++N_(" o open database\n"), ++"\n", ++N_(" s sort database\n"), ++N_(" S \"surname sort\"\n"), ++N_(" F sort by field (defined in configuration file)\n"), + "\n", +-N_(" / search\n"), +-N_(" \\ search next occurrence\n"), ++N_(" / search\n"), ++N_(" \\ search next occurrence\n"), + "\n", +-N_(" A move current item up\n"), +-N_(" Z move current item down\n"), ++N_(" A move current item up\n"), ++N_(" Z move current item down\n"), + "\n", +-N_(" m send mail with mutt\n"), +-N_(" v view URL with web browser\n"), ++N_(" m send mail with mutt\n"), ++N_(" v view URL with web browser\n"), + NULL + + }; +@@ -52,19 +52,19 @@ + static char *editorhelp[] = { + + "\n", +-N_(" a,c,p,o,C/arrows/h,l change tab\n"), ++N_(" a,c,p,o,C/arrows/h,l change tab\n"), + "\n", +-N_(" 1 - 5 edit fields\n"), ++N_(" 1 - 5 edit fields\n"), + "\n", +-N_(" k or < previous item\n"), +-N_(" j or > next item\n"), ++N_(" k or < previous item\n"), ++N_(" j or > next item\n"), + "\n", +-N_(" r roll e-mail addresses\n"), ++N_(" r roll e-mail addresses\n"), + "\n", +-N_(" u undo\n"), ++N_(" u undo\n"), + "\n", +-N_(" m send mail with mutt\n"), +-N_(" v view url with web browser\n"), ++N_(" m send mail with mutt\n"), ++N_(" v view url with web browser\n"), + "\n", + NULL + +diff -ur abook-0.5.6.orig/options.c abook-0.5.6/options.c +--- abook-0.5.6.orig/options.c 2011-02-25 23:19:11.845185113 +0300 ++++ abook-0.5.6/options.c 2011-02-25 23:19:28.278059364 +0300 +@@ -49,10 +49,10 @@ + { "autosave", OT_BOOL, BOOL_AUTOSAVE, TRUE }, + + { "show_all_emails", OT_BOOL, BOOL_SHOW_ALL_EMAILS, TRUE }, +- { "emailpos", OT_INT, INT_EMAILPOS, 25 }, ++ { "emailpos", OT_INT, INT_EMAILPOS, 16 }, + { "extra_column", OT_STR, STR_EXTRA_COLUMN, UL "phone" }, + { "extra_alternative", OT_STR, STR_EXTRA_ALTERNATIVE, UL "-1" }, +- { "extrapos", OT_INT, INT_EXTRAPOS, 65 }, ++ { "extrapos", OT_INT, INT_EXTRAPOS, 40 }, + + { "mutt_command", OT_STR, STR_MUTT_COMMAND, UL "mutt" }, + { "mutt_return_all_emails", OT_BOOL, BOOL_MUTT_RETURN_ALL_EMAILS, +diff -ur abook-0.5.6.orig/ui.c abook-0.5.6/ui.c +--- abook-0.5.6.orig/ui.c 2011-02-25 23:19:11.841184150 +0300 ++++ abook-0.5.6/ui.c 2011-02-25 23:19:28.278059364 +0300 +@@ -406,7 +406,7 @@ + default:return; + } + +- helpw = newwin(LINES - 5, COLS - 6, 2, 3); ++ helpw = newwin(LINES - 5, COLS, 2, 0); + erase(); + headerline(_("help")); + +@@ -588,7 +588,7 @@ + void + ui_print_number_of_items() + { +- char *str = strdup_printf(" " "|%3d/%3d", selected_items(), items); ++ char *str = strdup_printf(" " "|%3d/%3d", selected_items(), items); + + mvaddstr(0, COLS-strlen(str), str); +