--- /dev/null
+This package uses quilt for its patch management, see
+/usr/share/doc/quilt/README.source if you are unfamiliar with it.
+netris (0.52-8) unstable; urgency=low
+
+ * The "once every two years" release.
+ * Applied patch from Mats Erik Andersson for supporting ipv6
+ (closes: #561977)
+ * Added at least Description header into all patches.
+ * Fix spelling error noticed by lintian in changelog.
+ * Add debian/README.source referencing quilt's file.
+ * Update Standards-Version to 3.8.4.
+ * Update DEB_BUILD_OPTIONS handling according to policy.
+ * Switched packaging licensing to BSD style.
+ * set -e in post{rm,inst} instead of passing -e on hashbang line.
+
+ -- Gerfried Fuchs <rhonda@debian.at> Thu, 04 Mar 2010 21:36:09 +0100
+
netris (0.52-7) unstable; urgency=low
* The "once every release" release.
* New patches:
- various-fixes: various small changes to fix compile warnings
* Linked to GPL-2 in copyright file directly, added hint for later versions.
- * Added copyright informations into the debianization scripts.
+ * Added copyright information into the debianization scripts.
* Added Homepage: control field.
* Updated package to Standards-Version 3.7.3, updating menu section for that.
* Don't ignore make clean errors anymore.
Priority: optional
Maintainer: Gerfried Fuchs <rhonda@debian.at>
Build-Depends: libncurses5-dev, quilt
-Standards-Version: 3.7.3
+Standards-Version: 3.8.4
Homepage: http://netris.org/
Package: netris
-This package was first debianized by Gergely Madarasz <gorgo@caesar.elte.hu> on
-Wed, 6 Aug 1997 22:10:42 +0200.
-It is maintained since 2002 by Gerfried Fuchs <rhonda@debian.at>.
+This package was first debianized by Gergely Madarasz <gorgo@caesar.elte.hu>
+on Wed, 6 Aug 1997 22:10:42 +0200. It is maintained since 2002 by
+Gerfried Fuchs <rhonda@debian.at>. The packaging is licensed under BSD style,
+see /usr/share/common-licenses/BSD for the complete text.
It was downloaded from ftp://ftp.netris.org/pub/netris/
On Debian GNU/Linux systems, the complete text of the GNU General
Public License version 2 can be found in `/usr/share/common-licenses/GPL-2',
later versions can be found in the same directory.
-
-The Debian packaging is (C) 2002-2008 Gerfried Fuchs <rhonda@debian.at>,
-licensed the same way as netris itself.
.SH "NAME"
netris\-sample\-robot \- sample robot for netris
.SH "SYNOPSIS"
-.B netris-sample-robot
+.B netris\-sample\-robot
.RB [\| \-l \|]
.SH "DESCRIPTION"
The netris\-sample\-robot is a sample implementation of the robot protocol. It
+Author: Tomas Berndtsson <tomas@nocrew.org> vim:ft=diff:
+Description: Add multi game support with scoring
+
Index: netris-0.52/curses.c
===================================================================
--- netris-0.52.orig/curses.c
move(boardYPos[scr] - y, boardXPos[scr] + 2 * boardWidth[scr]);
addch('|');
}
-@@ -256,6 +258,23 @@ ExtFunc void PlotUnderline(int scr, int
+@@ -256,6 +258,23 @@ ExtFunc void PlotUnderline(int scr, int
ExtFunc void ShowDisplayInfo(void)
{
===================================================================
--- netris-0.52.orig/curses.c
+++ netris-0.52/curses.c
-@@ -258,6 +258,12 @@ ExtFunc void PlotUnderline(int scr, int
+@@ -258,6 +258,12 @@ ExtFunc void PlotUnderline(int scr, int
ExtFunc void ShowDisplayInfo(void)
{
+Description: Small fix for CloseRobot function to close only if a robot is used
+
Index: netris-0.52/robot.c
===================================================================
--- netris-0.52.orig/robot.c
+Description: Initialize lostConn and gotEndConn static var in InitNet function
+
Index: netris-0.52/inet.c
===================================================================
--- netris-0.52.orig/inet.c
+Author: Gerfried Fuchs <rhonda@debian.at> vim:ft=diff:
+Description: various small changes to fix compile warnings
+
Index: netris-0.52/game.c
===================================================================
--- netris-0.52.orig/game.c
--- /dev/null
+Description: Implement capability for IPv6.
+ Migration to 'getaddrinfo()' and 'struct sockaddr_storage'
+ make both address families AF_INET and AF_INET6 viable.
+ .
+ The preferred form of a port is as a string value in getaddrinfo(),
+ so named ports are no possible, alongside numerical ports.
+ .
+ The goto statement is left because the previous code enforced
+ a similar construct. It should really be removed.
+Author: Mats Erik Andersson <debian@gisladisker.se>
+Forwarded: no
+Last-Updated: 2010-03-03
+
+Index: netris-0.52/inet.c
+===================================================================
+--- netris-0.52.orig/inet.c
++++ netris-0.52/inet.c
+@@ -49,32 +49,60 @@ ExtFunc void InitNet(void)
+
+ ExtFunc int WaitForConnection(char *portStr)
+ {
+- struct sockaddr_in addr;
+- struct hostent *host;
+- int sockListen;
++ struct sockaddr_storage addr;
++ struct sockaddr_in *sa4 = (struct sockaddr_in *) &addr;
++ struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &addr;
++ struct hostent *host = NULL;
++ struct addrinfo hints, *ai, *aiptr;
++ char portStrDef[12];
++ int sockListen, status;
+ socklen_t addrLen;
+- short port;
+ int val1;
+ struct linger val2;
+
+- if (portStr)
+- port = atoi(portStr); /* XXX Error checking */
+- else
+- port = DEFAULT_PORT;
+- memset(&addr, 0, sizeof(addr));
+- addr.sin_family = AF_INET;
+- addr.sin_addr.s_addr = htonl(INADDR_ANY);
+- addr.sin_port = htons(port);
+- sockListen = socket(AF_INET, SOCK_STREAM, 0);
+- if (sockListen < 0)
++ if (!portStr || !strlen(portStr)) {
++ snprintf(portStrDef, sizeof(portStrDef), "%u", DEFAULT_PORT);
++ portStr = portStrDef;
++ }
++ /* XXX Error checking of port string. */
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE;
++
++ if ( (status = getaddrinfo(NULL, portStr, &hints, &ai)) ) {
++ fprintf(stderr, "getaddrinfo() failed: %s\n",
++ gai_strerror(status));
++ die("getaddrinfo");
++ }
++
++ for (aiptr = ai; aiptr; aiptr = aiptr->ai_next) {
++ if ( (sockListen = socket(aiptr->ai_family,
++ aiptr->ai_socktype,
++ aiptr->ai_protocol))
++ < 0 )
++ continue;
++
++ val1 = 1;
++ setsockopt(sockListen, SOL_SOCKET, SO_REUSEADDR,
++ (void *)&val1, sizeof(val1));
++ val1 = 0;
++ setsockopt(sockListen, IPPROTO_IPV6, IPV6_V6ONLY,
++ (void *)&val1, sizeof(val1));
++
++ if ( bind(sockListen, aiptr->ai_addr, aiptr->ai_addrlen)
++ == 0 )
++ if ( listen(sockListen, 1) >= 0 )
++ break;
++
++ close(sockListen);
++ }
++
++ freeaddrinfo(ai);
++ if (aiptr == NULL)
+ die("socket");
+- val1 = 1;
+- setsockopt(sockListen, SOL_SOCKET, SO_REUSEADDR,
+- (void *)&val1, sizeof(val1));
+- if (bind(sockListen, (struct sockaddr *)&addr, sizeof(addr)) < 0)
+- die("bind");
+- if (listen(sockListen, 1) < 0)
+- die("listen");
++
+ addrLen = sizeof(addr);
+ sock = accept(sockListen, (struct sockaddr *)&addr, &addrLen);
+ if (sock < 0)
+@@ -86,13 +114,18 @@ ExtFunc int WaitForConnection(char *port
+ (void *)&val2, sizeof(val2));
+ netGen.fd = sock;
+ strcpy(opponentHost, "???");
+- if (addr.sin_family == AF_INET) {
+- host = gethostbyaddr((void *)&addr.sin_addr,
+- sizeof(struct in_addr), AF_INET);
+- if (host) {
+- strncpy(opponentHost, host->h_name, sizeof(opponentHost)-1);
+- opponentHost[sizeof(opponentHost)-1] = 0;
+- }
++ switch (addr.ss_family) {
++ case AF_INET6:
++ host = gethostbyaddr((void *)&sa6->sin6_addr,
++ sizeof(struct in6_addr), addr.ss_family);
++ break;
++ case AF_INET:
++ host = gethostbyaddr((void *)&sa4->sin_addr,
++ sizeof(struct in_addr), addr.ss_family);
++ }
++ if (host) {
++ strncpy(opponentHost, host->h_name, sizeof(opponentHost)-1);
++ opponentHost[sizeof(opponentHost)-1] = 0;
+ }
+ AddEventGen(&netGen);
+ isServer = 1;
+@@ -101,36 +134,54 @@ ExtFunc int WaitForConnection(char *port
+
+ ExtFunc int InitiateConnection(char *hostStr, char *portStr)
+ {
+- struct sockaddr_in addr;
+- struct hostent *host;
+- short port;
+- int mySock;
+-
+- if (portStr)
+- port = atoi(portStr); /* XXX Error checking */
+- else
+- port = DEFAULT_PORT;
+- host = gethostbyname(hostStr);
+- if (!host)
+- die("gethostbyname");
+- assert(host->h_addrtype == AF_INET);
+- strncpy(opponentHost, host->h_name, sizeof(opponentHost)-1);
+- opponentHost[sizeof(opponentHost)-1] = 0;
+- again:
+- memset(&addr, 0, sizeof(addr));
+- addr.sin_family = host->h_addrtype;
+- memcpy(&addr.sin_addr, host->h_addr, host->h_length);
+- addr.sin_port = htons(port);
+- mySock = socket(AF_INET, SOCK_STREAM, 0);
+- if (mySock < 0)
+- die("socket");
+- if (connect(mySock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+- if (errno != ECONNREFUSED)
+- die("connect");
++ struct addrinfo hints, *ai, *aiptr;
++ char portStrDef[12];
++ int mySock, status;
++
++ if (!portStr || !strlen(portStr)) {
++ snprintf(portStrDef, sizeof(portStrDef), "%u", DEFAULT_PORT);
++ portStr = portStrDef;
++ }
++ /* XXX Error checking of port string. */
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_ADDRCONFIG | AI_CANONNAME;
++
++ if ( (status = getaddrinfo(hostStr, portStr, &hints, &ai)) ) {
++ fprintf(stderr, "getaddrinfo() failed: %s\n",
++ gai_strerror(status));
++ die("getaddrinfo");
++ }
++
++ for (aiptr = ai; aiptr; aiptr = aiptr->ai_next) {
++again:
++ if ( (mySock = socket(aiptr->ai_family, aiptr->ai_socktype,
++ aiptr->ai_protocol))
++ < 0 )
++ continue;
++ while ( (status = connect(mySock, aiptr->ai_addr,
++ aiptr->ai_addrlen)) < 0
++ && errno == ECONNREFUSED ) {
++ close(mySock);
++ sleep(1);
++ goto again;
++ }
++ if (status >= 0)
++ break;
++ /* Failure to connect. */
+ close(mySock);
+- sleep(1);
+- goto again;
+ }
++
++ if (aiptr == NULL) {
++ freeaddrinfo(ai);
++ die("socket/connect");
++ }
++
++ strncpy(opponentHost, aiptr->ai_canonname, sizeof(opponentHost)-1);
++ opponentHost[sizeof(opponentHost)-1] = 0;
++ freeaddrinfo(ai);
+ netGen.fd = sock = mySock;
+ AddEventGen(&netGen);
+ return 0;
06_curses.c-include-term.h
07_curses.c-include-time.h
08_various-fixes
+09_ipv6
-#!/bin/sh -e
+#!/bin/sh
# postinst script for netris
-# copyright 2002++ by Gerfried Fuchs <rhonda@debian.at>
-# Licenced the same way as netris itself
+# copyright 2002-2010 by Gerfried Fuchs <rhonda@debian.at>
+# Licenced under BSD style
+
+set -e
if [ "$1" != configure ]; then
exit 0
-#!/bin/sh -e
+#!/bin/sh
# postrm script for netris
-# copyright 2002++ by Gerfried Fuchs <rhonda@debian.at>
-# Licenced the same way as netris itself
+# copyright 2002-2010 by Gerfried Fuchs <rhonda@debian.at>
+# Licenced under BSD style
+
+set -e
if [ -x /usr/bin/update-menus ]; then
update-menus
#!/usr/bin/make -f
# rules file for netris
-# copyright 2002++ by Gerfried Fuchs <rhonda@debian.at>
-# Licenced the same way as netris itself
+# copyright 2002-2010 by Gerfried Fuchs <rhonda@debian.at>
+# Licenced under BSD style
+
+PKG = netris
+TMP = $(CURDIR)/debian/$(PKG)
COPT = -g
INSTALL = install
INSTALL_SCRIPT = $(INSTALL) -p -oroot -groot -m755
INSTALL_DIR = $(INSTALL) -p -d -oroot -groot -m755
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
COPT += -O0
else
COPT += -O2
endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
+ STRIP = true
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
endif
+
include /usr/share/quilt/quilt.make
clean: unpatch
$(checkdir)
$(checkroot)
- -rm -rf debian/netris debian/substvars debian/files \
+ -rm -rf $(TMP) debian/substvars debian/files \
build-stamp install-stamp config.h .depend
[ ! -f Makefile ] || $(MAKE) clean
-rm -rf Makefile
install-stamp: build
$(checkdir)
$(checkroot)
- -rm -rf debian/netris
- $(INSTALL_DIR) debian/netris
- cd debian/netris && $(INSTALL_DIR) usr/games usr/share/man/man6 \
- usr/share/doc/netris/examples
- $(INSTALL_PROGRAM) netris debian/netris/usr/games
- $(INSTALL_PROGRAM) sr debian/netris/usr/games/netris-sample-robot
- $(INSTALL_FILE) debian/netris*.6 debian/netris/usr/share/man/man6
- $(INSTALL_FILE) FAQ robot_desc debian/netris/usr/share/doc/netris
- $(INSTALL_FILE) sr.c debian/netris/usr/share/doc/netris/examples
- gzip -9 debian/netris/usr/share/man/man6/netris*.6 \
- debian/netris/usr/share/doc/netris/FAQ \
- debian/netris/usr/share/doc/netris/robot_desc \
- debian/netris/usr/share/doc/netris/examples/sr.c
+ -rm -rf $(TMP)
+ $(INSTALL_DIR) $(TMP)
+ cd $(TMP) && $(INSTALL_DIR) usr/games usr/share/man/man6 \
+ usr/share/doc/$(PKG)/examples
+ $(INSTALL_PROGRAM) netris $(TMP)/usr/games
+ $(INSTALL_PROGRAM) sr $(TMP)/usr/games/netris-sample-robot
+ test "$(STRIP)" != true || strip \
+ --remove-section=.comment --remove-section=.note \
+ $(TMP)/usr/games/*
+ $(INSTALL_FILE) debian/netris*.6 $(TMP)/usr/share/man/man6
+ $(INSTALL_FILE) FAQ robot_desc $(TMP)/usr/share/doc/$(PKG)
+ $(INSTALL_FILE) sr.c $(TMP)/usr/share/doc/$(PKG)/examples
+ gzip -9 $(TMP)/usr/share/man/man6/netris*.6 \
+ $(TMP)/usr/share/doc/$(PKG)/FAQ \
+ $(TMP)/usr/share/doc/$(PKG)/robot_desc \
+ $(TMP)/usr/share/doc/$(PKG)/examples/sr.c
touch install-stamp
binary-arch: build install
$(checkdir)
$(checkroot)
- $(INSTALL_DIR) debian/netris/DEBIAN debian/netris/usr/share/menu
- $(INSTALL_FILE) debian/menu debian/netris/usr/share/menu/netris
+ $(INSTALL_DIR) $(TMP)/DEBIAN $(TMP)/usr/share/menu
+ $(INSTALL_FILE) debian/menu $(TMP)/usr/share/menu/$(PKG)
$(INSTALL_FILE) debian/copyright debian/README.Debian \
- debian/netris/usr/share/doc/netris
+ $(TMP)/usr/share/doc/$(PKG)
$(INSTALL_FILE) debian/changelog \
- debian/netris/usr/share/doc/netris/changelog.Debian
- gzip -9 debian/netris/usr/share/doc/netris/changelog.Debian
+ $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
+ gzip -9 $(TMP)/usr/share/doc/$(PKG)/changelog.Debian
$(INSTALL_SCRIPT) debian/postinst debian/postrm \
- debian/netris/DEBIAN
+ $(TMP)/DEBIAN
dpkg-shlibdeps -Tdebian/substvars -dDepends \
- debian/netris/usr/games/netris*
+ $(TMP)/usr/games/netris*
dpkg-gencontrol -ldebian/changelog -isp -Tdebian/substvars -pnetris \
- -Pdebian/netris
- cd debian/netris && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
+ -P$(TMP)
+ cd $(TMP) && find * -type f ! -regex '^DEBIAN/.*' -print0 | \
xargs -r0 md5sum > DEBIAN/md5sums
- dpkg --build debian/netris ..
+ dpkg --build $(TMP) ..
binary: binary-indep binary-arch