]> git.deb.at Git - pkg/netris.git/commitdiff
Imported Debian patch 0.52-8 debian/0.52-8
authorGerfried Fuchs <rhonda@debian.at>
Thu, 4 Mar 2010 20:36:09 +0000 (21:36 +0100)
committerGerfried Fuchs <rhonda@debian.at>
Wed, 14 Jul 2010 19:42:51 +0000 (21:42 +0200)
15 files changed:
debian/README.source [new file with mode: 0644]
debian/changelog
debian/control
debian/copyright
debian/netris-sample-robot.6
debian/patches/01_multi-games-with-scoring
debian/patches/02_line-count-patch
debian/patches/04_robot-close-fixup
debian/patches/05_init-static-vars
debian/patches/08_various-fixes
debian/patches/09_ipv6 [new file with mode: 0644]
debian/patches/series
debian/postinst
debian/postrm
debian/rules

diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..3556bbc
--- /dev/null
@@ -0,0 +1,2 @@
+This package uses quilt for its patch management, see
+/usr/share/doc/quilt/README.source if you are unfamiliar with it.
index 46ef7feca5788ba6e7da70b139dee41286ef155e..10bfeb68c274c22e63ea7a91b5d98c851d8c6bc7 100644 (file)
@@ -1,3 +1,18 @@
+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.
@@ -16,7 +31,7 @@ netris (0.52-7) unstable; urgency=low
   * 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.
index 11d13ab8885a8a78145728be7999cd75c31e4ba8..24a5b0861b531978116af2f03e58896f7553780a 100644 (file)
@@ -3,7 +3,7 @@ Section: games
 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
index 4f411d71769cfb2df65b7246d61b4fd2fc44810b..18e294781fcac3255e3b29ba0aabae41e64ca980 100644 (file)
@@ -1,6 +1,7 @@
-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/
 
@@ -24,6 +25,3 @@ 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.
index 552e0ee3489e4d0e099018c31fe3e09f6c24cf3c..9435317f4c294997cdbbd09487df15612928467c 100644 (file)
@@ -2,7 +2,7 @@
 .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
index 3d08e9c48f6d8333ff1a3c4b0a3b014515e3b7bc..8501b129222f2a293abf985bc3110861e9bc34fa 100644 (file)
@@ -1,3 +1,6 @@
+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
@@ -11,7 +14,7 @@ Index: netris-0.52/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)
  {
index eefc7b45da0a9a7402552f8f5a6653c1d888ce1a..fa3490b3563f9c814bbd87acf3ee2e0f2057e66d 100644 (file)
@@ -5,7 +5,7 @@ Index: netris-0.52/curses.c
 ===================================================================
 --- 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)
  {
index 74cfec4425f774c9563475d572672c1eae8057c9..a24062c1c21b297447bb8fdd4a22773b705c9310 100644 (file)
@@ -1,3 +1,5 @@
+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
index cf3bec37129ea90bebcc6db321a69109a03cdfae..2b4ebe3f2291c8095e685c5c49aa4abdf1de63d1 100644 (file)
@@ -1,3 +1,5 @@
+Description: Initialize lostConn and gotEndConn static var in InitNet function
+
 Index: netris-0.52/inet.c
 ===================================================================
 --- netris-0.52.orig/inet.c
index a145ee8db6cd00eb4ac7a39e2a2cfa2db51282bc..b55848aa2420794ef6a57730462d84dc4137b6a8 100644 (file)
@@ -1,3 +1,6 @@
+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
diff --git a/debian/patches/09_ipv6 b/debian/patches/09_ipv6
new file mode 100644 (file)
index 0000000..6870768
--- /dev/null
@@ -0,0 +1,208 @@
+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;
index 0ebda8e524a0284adf8e827db95822acdee2ba4f..885489d7dee47879bfd1ba4f675ca15ea47f9d56 100644 (file)
@@ -6,3 +6,4 @@
 06_curses.c-include-term.h
 07_curses.c-include-time.h
 08_various-fixes
+09_ipv6
index 2487d92d0d2010f2f6ede943d2908b8585b237cd..10af7f80c72b3b65c6da83deb19530183a84b224 100644 (file)
@@ -1,7 +1,9 @@
-#!/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
index ca83453f7979fd21c52b62ac872dd5624c4f7348..a2ec7df3a21cfd423f9df72a1b0bc17e568ae4bc 100644 (file)
@@ -1,7 +1,9 @@
-#!/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
index 38168531204b4e0aea0cea353962e0288013e7a5..5dd00317f1a2a78dbbb16382dcdfcd2d78d2e65d 100755 (executable)
@@ -1,7 +1,10 @@
 #!/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
@@ -10,22 +13,28 @@ INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
 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
@@ -43,19 +52,22 @@ install: install-stamp
 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
 
 
@@ -68,22 +80,22 @@ binary-indep: build
 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