tags 912131 patch
user debian-rele...@lists.debian.org
usertags 912131 + bsp-2019-02-de-bonn
thanks

Dear maintainer,

find attached the fix for netkit-telnet.

This goes beyond the usual scope of an NMU but it seemed wise to brush
up the entire build system so it is robust for any forseeable changes
to the Debian toolchain.

For a full explanation, see
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911154#44

Upload to DELAYED+3 will follow in a few hours, I'd like to give
myself a moment to settle down, then ultimately revisit the
changes done. Feel free to tell me if I should wait a little longer.

Packaging could still take a lot of love.

It might be an idea to drop netkit-telnet in favour of
netkit-telnet-ssl, however netkit-telnet has that might be worth
preserving.

Regards,

    Christoph

diff -Nru netkit-telnet-0.17/debian/changelog 
netkit-telnet-0.17/debian/changelog
--- netkit-telnet-0.17/debian/changelog 2018-12-02 21:12:12.000000000 +0100
+++ netkit-telnet-0.17/debian/changelog 2019-02-24 14:25:14.000000000 +0100
@@ -1,3 +1,10 @@
+netkit-telnet (0.17-41.2) unstable; urgency=high
+
+  * Non-maintainer upload
+  * Use cmake to build the package. Closes: #912131
+
+ -- Christoph Biedl <debian.a...@manchmal.in-ulm.de>  Sun, 24 Feb 2019 
14:25:14 +0100
+
 netkit-telnet (0.17-41.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru netkit-telnet-0.17/debian/compat netkit-telnet-0.17/debian/compat
--- netkit-telnet-0.17/debian/compat    2016-11-05 14:51:10.000000000 +0100
+++ netkit-telnet-0.17/debian/compat    2019-02-24 14:25:14.000000000 +0100
@@ -1 +1 @@
-9
+10
diff -Nru netkit-telnet-0.17/debian/control netkit-telnet-0.17/debian/control
--- netkit-telnet-0.17/debian/control   2016-11-05 15:44:10.000000000 +0100
+++ netkit-telnet-0.17/debian/control   2019-02-24 14:25:14.000000000 +0100
@@ -4,7 +4,7 @@
 Maintainer: Mats Erik Andersson <mats.anders...@gisladisker.se>
 Uploaders: Alberto Gonzalez Iniesta <a...@inittab.org>
 Standards-Version: 3.9.8
-Build-Depends: debhelper (>= 9), libncurses-dev
+Build-Depends: debhelper (>= 10~), libncurses-dev, cmake
 
 Package: telnet
 Architecture: any
diff -Nru netkit-telnet-0.17/debian/dirs netkit-telnet-0.17/debian/dirs
--- netkit-telnet-0.17/debian/dirs      2016-11-05 14:51:10.000000000 +0100
+++ netkit-telnet-0.17/debian/dirs      1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-usr/bin
-usr/share/doc/telnet
-usr/share/man/man1
diff -Nru netkit-telnet-0.17/debian/patches/010-full_set_in_18.diff 
netkit-telnet-0.17/debian/patches/010-full_set_in_18.diff
--- netkit-telnet-0.17/debian/patches/010-full_set_in_18.diff   2016-11-05 
14:51:10.000000000 +0100
+++ netkit-telnet-0.17/debian/patches/010-full_set_in_18.diff   2019-02-24 
14:25:14.000000000 +0100
@@ -21,42 +21,8 @@
 Forwarded: no
 Last-Update: 2015-01-26
 
---- netkit-telnet-0.17.orig/Makefile
-+++ netkit-telnet-0.17/Makefile
-@@ -1,8 +1,7 @@
- # You can do "make SUB=blah" to make only a few, or edit here, or both
- # You can also run make directly in the subdirs you want.
- 
--SUB =   telnet telnetd
--# not yet: telnetlogin
-+SUB =   telnet telnetd telnetlogin
- 
- %.build:
-       (cd $(patsubst %.build, %, $@) && $(MAKE))
---- netkit-telnet-0.17.orig/configure
-+++ netkit-telnet-0.17/configure
-@@ -117,7 +117,7 @@
- 
- cat << EOF > __conftest.cc
-     template <class T> class fnord { public: T x; fnord(T y) { x=y; }};
--    int main() { fnord<int> a(0); return a.x; }
-+    int main() { fnord<int> *a = new fnord<int>(0); return a->x; }
- EOF
- 
- if [ x"$CXX" = x ]; then
---- netkit-telnet-0.17.orig/telnet/Makefile
-+++ netkit-telnet-0.17/telnet/Makefile
-@@ -7,7 +7,7 @@
- 
- # -DAUTHENTICATE
- CXXFLAGS += -DUSE_TERMIO -DKLUDGELINEMODE
--LIBS += $(LIBTERMCAP)
-+LIBS = $(LIBTERMCAP)
- 
- SRCS = commands.cc main.cc network.cc ring.cc sys_bsd.cc telnet.cc \
-       terminal.cc tn3270.cc utilities.cc genget.cc environ.cc netlink.cc
---- netkit-telnet-0.17.orig/telnet/commands.cc
-+++ netkit-telnet-0.17/telnet/commands.cc
+--- a/telnet/commands.cc
++++ b/telnet/commands.cc
 @@ -86,10 +86,6 @@
  
  #define HELPINDENT ((int) sizeof ("connect"))
@@ -374,8 +340,8 @@
  #if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
  
  /*
---- netkit-telnet-0.17.orig/telnet/main.cc
-+++ netkit-telnet-0.17/telnet/main.cc
+--- a/telnet/main.cc
++++ b/telnet/main.cc
 @@ -45,7 +45,10 @@
  
  #include <sys/types.h>
@@ -477,8 +443,8 @@
                *argp++ = argv[0];              /* host */
                if (argc > 1)
                        *argp++ = argv[1];      /* port */
---- netkit-telnet-0.17.orig/telnet/netlink.cc
-+++ netkit-telnet-0.17/telnet/netlink.cc
+--- a/telnet/netlink.cc
++++ b/telnet/netlink.cc
 @@ -81,20 +81,23 @@
      ::close(net);
  }
@@ -545,8 +511,8 @@
      }
      return 2;
  }
---- netkit-telnet-0.17.orig/telnet/netlink.h
-+++ netkit-telnet-0.17/telnet/netlink.h
+--- a/telnet/netlink.h
++++ b/telnet/netlink.h
 @@ -6,8 +6,7 @@
      netlink();
      ~netlink();
@@ -557,8 +523,8 @@
                char *srcroute, int srlen,
                int tos);
      void close(int doshutdown);
---- netkit-telnet-0.17.orig/telnet/network.cc
-+++ netkit-telnet-0.17/telnet/network.cc
+--- a/telnet/network.cc
++++ b/telnet/network.cc
 @@ -40,6 +40,7 @@
  #include <sys/types.h>
  #include <sys/socket.h>
@@ -567,8 +533,8 @@
  #include <errno.h>
  #include <arpa/telnet.h>
  
---- netkit-telnet-0.17.orig/telnet/ring.cc
-+++ netkit-telnet-0.17/telnet/ring.cc
+--- a/telnet/ring.cc
++++ b/telnet/ring.cc
 @@ -165,7 +165,7 @@
  
  /////////////////////////////////////////////////// supply //////////////
@@ -578,8 +544,8 @@
      char xbuf[256];
      va_list ap;
      va_start(ap, format);
---- netkit-telnet-0.17.orig/telnet/ring.h
-+++ netkit-telnet-0.17/telnet/ring.h
+--- a/telnet/ring.h
++++ b/telnet/ring.h
 @@ -83,7 +83,7 @@
      // manual supply
      void putch(char c) { write(&c, 1); }
@@ -589,8 +555,8 @@
      int empty_count() { return size - count; }
  
      // automatic supply
---- netkit-telnet-0.17.orig/telnet/sys_bsd.cc
-+++ netkit-telnet-0.17/telnet/sys_bsd.cc
+--- a/telnet/sys_bsd.cc
++++ b/telnet/sys_bsd.cc
 @@ -189,18 +189,25 @@
   * Various signal handling routines.
   */
@@ -636,8 +602,8 @@
  #ifdef        SIGWINCH
      signal(SIGWINCH, sendwin);
  #endif
---- netkit-telnet-0.17.orig/telnet/telnet.1
-+++ netkit-telnet-0.17/telnet/telnet.1
+--- a/telnet/telnet.1
++++ b/telnet/telnet.1
 @@ -42,7 +42,7 @@
  protocol
  .Sh SYNOPSIS
@@ -706,8 +672,8 @@
  .It Pa ~/.telnetrc
  user customized telnet startup values
  .El
---- netkit-telnet-0.17.orig/telnet/telnet.cc
-+++ netkit-telnet-0.17/telnet/telnet.cc
+--- a/telnet/telnet.cc
++++ b/telnet/telnet.cc
 @@ -646,7 +646,7 @@
      mklist(termbuf, tname, termtypes);
      next = 0;
@@ -785,7 +751,7 @@
                    LM_SLC, 0, SLC_VARIABLE, 0, IAC, SE);
    }
  }
-@@ -1142,6 +1151,7 @@
+@@ -1142,6 +1142,7 @@
    }
  }
  
@@ -793,7 +759,7 @@
  #define       OPT_REPLY_SIZE  256
  unsigned char *opt_reply;
  unsigned char *opt_replyp;
-@@ -1173,6 +1183,7 @@
+@@ -1173,6 +1174,7 @@
  
  void env_opt_add(const char *ep) {
    const char *vp;
@@ -801,7 +767,7 @@
    unsigned char c;
    
    if (opt_reply == NULL)              /*XXX*/
-@@ -1185,11 +1196,12 @@
+@@ -1185,11 +1187,12 @@
      return;
    }
    vp = env_getvalue(ep, 1);
@@ -817,8 +783,8 @@
        opt_reply = (unsigned char *)realloc(opt_reply, len);
        if (opt_reply == NULL) {
        /*@*/                   printf("env_opt_add: realloc() failed!!!\n");
---- netkit-telnet-0.17.orig/telnet/terminal.cc
-+++ netkit-telnet-0.17/telnet/terminal.cc
+--- a/telnet/terminal.cc
++++ b/telnet/terminal.cc
 @@ -45,6 +45,8 @@
  #include <signal.h>
  #include <errno.h>
@@ -828,8 +794,8 @@
  
  #include "ring.h"
  #include "defines.h"
---- netkit-telnet-0.17.orig/telnet/utilities.cc
-+++ netkit-telnet-0.17/telnet/utilities.cc
+--- a/telnet/utilities.cc
++++ b/telnet/utilities.cc
 @@ -47,6 +47,8 @@
  #include <sys/socket.h>
  #include <unistd.h>
@@ -839,20 +805,8 @@
  
  #include "ring.h"
  #include "defines.h"
---- netkit-telnet-0.17.orig/telnetd/Makefile
-+++ netkit-telnet-0.17/telnetd/Makefile
-@@ -9,7 +9,8 @@
- # take out -DPARANOID_TTYS.
- 
- CFLAGS += '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS \
--         -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS
-+         -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS \
-+         -DLOGIN_WRAPPER=\"/usr/lib/telnetlogin\"
- # LIBS += $(LIBTERMCAP)
- 
- OBJS = telnetd.o state.o termstat.o slc.o sys_term.o utility.o \
---- netkit-telnet-0.17.orig/telnetd/authenc.c
-+++ netkit-telnet-0.17/telnetd/authenc.c
+--- a/telnetd/authenc.c
++++ b/telnetd/authenc.c
 @@ -42,18 +42,6 @@
      return(0);
  }
@@ -872,8 +826,8 @@
  int
  telnet_spin()
  {
---- netkit-telnet-0.17.orig/telnetd/defs.h
-+++ netkit-telnet-0.17/telnetd/defs.h
+--- a/telnetd/defs.h
++++ b/telnetd/defs.h
 @@ -55,10 +55,11 @@
  #include <fcntl.h>
  #include <sys/file.h>
@@ -887,8 +841,8 @@
  #include <stdio.h>
  #include <stdlib.h>
  #include <signal.h>
---- netkit-telnet-0.17.orig/telnetd/ext.h
-+++ netkit-telnet-0.17/telnetd/ext.h
+--- a/telnetd/ext.h
++++ b/telnetd/ext.h
 @@ -81,12 +81,11 @@
   */
  extern char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
@@ -947,8 +901,8 @@
  extern int (*decrypt_input)(int);
  extern char *nclearto;
  #endif
---- netkit-telnet-0.17.orig/telnetd/global.c
-+++ netkit-telnet-0.17/telnetd/global.c
+--- a/telnetd/global.c
++++ b/telnetd/global.c
 @@ -87,11 +87,10 @@
  
  char  netibuf[BUFSIZ], *netip;
@@ -963,16 +917,16 @@
  int   pty, net;
  int   SYNCHing;               /* we are in TELNET SYNCH mode */
  
---- netkit-telnet-0.17.orig/telnetd/issue.net.5
-+++ netkit-telnet-0.17/telnetd/issue.net.5
+--- a/telnetd/issue.net.5
++++ b/telnetd/issue.net.5
 @@ -40,4 +40,4 @@
  .Sh FILES
  .Pa /etc/issue.net
  .Sh "SEE ALSO"
 -.Xr telnetd 8
 +.Xr in.telnetd 8
---- netkit-telnet-0.17.orig/telnetd/setproctitle.c
-+++ netkit-telnet-0.17/telnetd/setproctitle.c
+--- a/telnetd/setproctitle.c
++++ b/telnetd/setproctitle.c
 @@ -139,7 +139,7 @@
        (void) strcpy(Argv[0], buf);
        p = &Argv[0][i];
@@ -982,8 +936,8 @@
        Argv[1] = NULL;
  }
  
---- netkit-telnet-0.17.orig/telnetd/state.c
-+++ netkit-telnet-0.17/telnetd/state.c
+--- a/telnetd/state.c
++++ b/telnetd/state.c
 @@ -179,6 +179,7 @@
                   */
              case AO:
@@ -1003,8 +957,8 @@
                      DIAG(TD_OPTIONS, printoption("td: send IAC", DM));
                      break;
                  }
---- netkit-telnet-0.17.orig/telnetd/sys_term.c
-+++ netkit-telnet-0.17/telnetd/sys_term.c
+--- a/telnetd/sys_term.c
++++ b/telnetd/sys_term.c
 @@ -41,8 +41,6 @@
  
  #include "telnetd.h"
@@ -1024,8 +978,8 @@
      fatalperror(net, loginprg);
  }
  
---- netkit-telnet-0.17.orig/telnetd/telnetd.8
-+++ netkit-telnet-0.17/telnetd/telnetd.8
+--- a/telnetd/telnetd.8
++++ b/telnetd/telnetd.8
 @@ -161,7 +161,7 @@
  .It Fl L Ar loginprg
  This option may be used to specify a different login program.
@@ -1051,8 +1005,8 @@
  .Sh BUGS
  Some
  .Tn TELNET
---- netkit-telnet-0.17.orig/telnetd/telnetd.c
-+++ netkit-telnet-0.17/telnetd/telnetd.c
+--- a/telnetd/telnetd.c
++++ b/telnetd/telnetd.c
 @@ -43,12 +43,16 @@
  
  #include "../version.h"
@@ -1457,8 +1411,8 @@
            netflush();
        if (ncc > 0)
            telrcv();
---- netkit-telnet-0.17.orig/telnetd/utility.c
-+++ netkit-telnet-0.17/telnetd/utility.c
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
 @@ -41,6 +41,7 @@
  
  #include <stdarg.h>
@@ -2072,8 +2026,8 @@
 +      }
 +      return listlen != 1 ? listlen : tail->len - skip;
 +}
---- netkit-telnet-0.17.orig/telnetlogin/telnetlogin.8
-+++ netkit-telnet-0.17/telnetlogin/telnetlogin.8
+--- a/telnetlogin/telnetlogin.8
++++ b/telnetlogin/telnetlogin.8
 @@ -40,6 +40,7 @@
  .Nm telnetlogin
  .Op Fl h Ar host
@@ -2103,8 +2057,8 @@
  work with telnetds that perform authentication via Kerberos or SSL.
  .Pp
  THIS IS PRESENTLY EXPERIMENTAL CODE; USE WITH CAUTION.
---- netkit-telnet-0.17.orig/telnetlogin/telnetlogin.c
-+++ netkit-telnet-0.17/telnetlogin/telnetlogin.c
+--- a/telnetlogin/telnetlogin.c
++++ b/telnetlogin/telnetlogin.c
 @@ -51,20 +51,24 @@
  #include <string.h>
  #include <stdarg.h>
diff -Nru netkit-telnet-0.17/debian/patches/020-from_18_to_24.diff 
netkit-telnet-0.17/debian/patches/020-from_18_to_24.diff
--- netkit-telnet-0.17/debian/patches/020-from_18_to_24.diff    2016-11-05 
14:51:10.000000000 +0100
+++ netkit-telnet-0.17/debian/patches/020-from_18_to_24.diff    2019-02-24 
14:25:14.000000000 +0100
@@ -51,21 +51,8 @@
 Forwarded: no
 Last-Update: 2015-01-27
 
-diff -u netkit-telnet-0.17/configure netkit-telnet-0.17/configure
---- netkit-telnet-0.17/configure
-+++ netkit-telnet-0.17/configure
-@@ -67,7 +67,7 @@
- 
- ##################################################
- 
--WARNINGS='-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual 
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 
-Wnested-externs -Winline '
-+WARNINGS='-Wall -Wno-trigraphs '
- 
- cat << EOF > __conftest.c
-     int main() { int class=0; return class; }
-diff -u netkit-telnet-0.17/telnet/commands.cc 
netkit-telnet-0.17/telnet/commands.cc
---- netkit-telnet-0.17/telnet/commands.cc
-+++ netkit-telnet-0.17/telnet/commands.cc
+--- a/telnet/commands.cc
++++ b/telnet/commands.cc
 @@ -476,6 +476,7 @@
  int send_tncmd(int (*func)(int, int), const char *cmd, const char *name) {
      char **cpp;
@@ -218,9 +205,8 @@
  }
  
  #if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
-diff -u netkit-telnet-0.17/telnet/main.cc netkit-telnet-0.17/telnet/main.cc
---- netkit-telnet-0.17/telnet/main.cc
-+++ netkit-telnet-0.17/telnet/main.cc
+--- a/telnet/main.cc
++++ b/telnet/main.cc
 @@ -84,7 +84,7 @@
      fprintf(stderr, "Usage: %s %s%s%s%s\n",
            prompt,
@@ -307,9 +293,8 @@
                if (family) {
                        *argp++ = family == AF_INET ? "-4" : "-6";
                }
-diff -u netkit-telnet-0.17/telnet/netlink.cc 
netkit-telnet-0.17/telnet/netlink.cc
---- netkit-telnet-0.17/telnet/netlink.cc
-+++ netkit-telnet-0.17/telnet/netlink.cc
+--- a/telnet/netlink.cc
++++ b/telnet/netlink.cc
 @@ -79,20 +79,56 @@
        shutdown(net, 2);
      }
@@ -374,9 +359,8 @@
  
  #if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
      if (srcroute) {
-diff -u netkit-telnet-0.17/telnet/netlink.h netkit-telnet-0.17/telnet/netlink.h
---- netkit-telnet-0.17/telnet/netlink.h
-+++ netkit-telnet-0.17/telnet/netlink.h
+--- a/telnet/netlink.h
++++ b/telnet/netlink.h
 @@ -1,11 +1,15 @@
  
  class netlink {
@@ -393,9 +377,8 @@
      int connect(int debug, struct addrinfo *hostaddr, 
                char *srcroute, int srlen,
                int tos);
-diff -u netkit-telnet-0.17/telnet/telnet.1 netkit-telnet-0.17/telnet/telnet.1
---- netkit-telnet-0.17/telnet/telnet.1
-+++ netkit-telnet-0.17/telnet/telnet.1
+--- a/telnet/telnet.1
++++ b/telnet/telnet.1
 @@ -44,6 +44,7 @@
  .Nm telnet
  .Op Fl 468ELadr
@@ -430,9 +413,8 @@
  commands associated with that host are executed.
  .It Ic quit
  Close any open session and exit
-diff -u netkit-telnet-0.17/telnet/telnet.cc netkit-telnet-0.17/telnet/telnet.cc
---- netkit-telnet-0.17/telnet/telnet.cc
-+++ netkit-telnet-0.17/telnet/telnet.cc
+--- a/telnet/telnet.cc
++++ b/telnet/telnet.cc
 @@ -88,7 +88,8 @@
  char  will_wont_resp[256];
  
@@ -443,7 +425,7 @@
    autologin = 0,      /* Autologin anyone? */
    skiprc = 0,
    connected,
-@@ -1743,8 +1754,8 @@
+@@ -1743,8 +1744,8 @@
      send_do(TELOPT_STATUS, 1);
      if (env_getvalue("DISPLAY", 0))
        send_will(TELOPT_XDISPLOC, 1);
@@ -454,9 +436,8 @@
    }
  #endif /* !defined(TN3270) */
    
-diff -u netkit-telnet-0.17/telnet/terminal.cc 
netkit-telnet-0.17/telnet/terminal.cc
---- netkit-telnet-0.17/telnet/terminal.cc
-+++ netkit-telnet-0.17/telnet/terminal.cc
+--- a/telnet/terminal.cc
++++ b/telnet/terminal.cc
 @@ -157,9 +157,11 @@
      if (localflow)
        mode |= MODE_FLOW;
@@ -504,9 +485,8 @@
  
  #ifdef        SIGTSTP
        signal(SIGTSTP, SIG_DFL);
-diff -u netkit-telnet-0.17/telnetd/ext.h netkit-telnet-0.17/telnetd/ext.h
---- netkit-telnet-0.17/telnetd/ext.h
-+++ netkit-telnet-0.17/telnetd/ext.h
+--- a/telnetd/ext.h
++++ b/telnetd/ext.h
 @@ -88,7 +88,7 @@
  #define netoprintf(fmt, ...) fprintf(netfile, fmt, ## __VA_ARGS__)
  
@@ -516,9 +496,8 @@
  extern int SYNCHing;          /* we are in TELNET SYNCH mode */
  
  void _termstat(void);
-diff -u netkit-telnet-0.17/telnetd/sys_term.c 
netkit-telnet-0.17/telnetd/sys_term.c
---- netkit-telnet-0.17/telnetd/sys_term.c
-+++ netkit-telnet-0.17/telnetd/sys_term.c
+--- a/telnetd/sys_term.c
++++ b/telnetd/sys_term.c
 @@ -204,17 +204,17 @@
   *
   * Returns the file descriptor of the opened pty.
@@ -567,9 +546,8 @@
      shutdown(net, 2);
      exit(0);
  }
-diff -u netkit-telnet-0.17/telnetd/telnetd.8 
netkit-telnet-0.17/telnetd/telnetd.8
---- netkit-telnet-0.17/telnetd/telnetd.8
-+++ netkit-telnet-0.17/telnetd/telnetd.8
+--- a/telnetd/telnetd.8
++++ b/telnetd/telnetd.8
 @@ -161,7 +161,7 @@
  .It Fl L Ar loginprg
  This option may be used to specify a different login program.
@@ -579,20 +557,16 @@
  is used.
  .It Fl n
  Disable
-only in patch2:
-unchanged:
---- netkit-telnet-0.17.orig/telnet/defines.h
-+++ netkit-telnet-0.17/telnet/defines.h
+--- a/telnet/defines.h
++++ b/telnet/defines.h
 @@ -50,3 +50,5 @@
  #define       MODE_COMMAND_LINE(m)    ((m)==-1)
  
  #define       CONTROL(x)      ((x)&0x1f)              /* CTRL(x) is not 
portable */
 +
 +#define MODE_OUT8     0x8000                  /* binary mode sans -opost */
-only in patch2:
-unchanged:
---- netkit-telnet-0.17.orig/telnet/proto.h
-+++ netkit-telnet-0.17/telnet/proto.h
+--- a/telnet/proto.h
++++ b/telnet/proto.h
 @@ -13,7 +13,7 @@
  void auth_encrypt_user(char *);
  void auth_name(unsigned char *, int);
@@ -602,10 +576,8 @@
  void env_init(void);
  int getconnmode(void);
  void init_network(void);
-only in patch2:
-unchanged:
---- netkit-telnet-0.17.orig/telnet/externs.h
-+++ netkit-telnet-0.17/telnet/externs.h
+--- a/telnet/externs.h
++++ b/telnet/externs.h
 @@ -48,9 +48,7 @@
  typedef unsigned char cc_t;
  #endif
diff -Nru netkit-telnet-0.17/debian/patches/040-do_not_strip_programs.diff 
netkit-telnet-0.17/debian/patches/040-do_not_strip_programs.diff
--- netkit-telnet-0.17/debian/patches/040-do_not_strip_programs.diff    
2016-11-05 14:51:10.000000000 +0100
+++ netkit-telnet-0.17/debian/patches/040-do_not_strip_programs.diff    
1970-01-01 01:00:00.000000000 +0100
@@ -1,46 +0,0 @@
-Description: Do not strip programs.
- Remove stripping options during installation.  This is handled by
- other means.
-Author: Alberto Gonzalez Iniesta
-Bug-Debian: http://bugs.debian.org/437618
-Comment: interdiff netkit-telnet_0.17-{34,36}.diff
-Forwarded: no
-Last-Update: 2008-06-22
-
-diff -u netkit-telnet-0.17/telnet/Makefile netkit-telnet-0.17/telnet/Makefile
---- netkit-telnet-0.17/telnet/Makefile
-+++ netkit-telnet-0.17/telnet/Makefile
-@@ -22,7 +22,7 @@
-       $(CXX) $(CXXFLAGS) -MM $(SRCS) >depend.mk
- 
- install: telnet
--      install -s -m$(BINMODE) telnet $(INSTALLROOT)$(BINDIR)
-+      install -m$(BINMODE) telnet $(INSTALLROOT)$(BINDIR)
-       install -m$(MANMODE) telnet.1 $(INSTALLROOT)$(MANDIR)/man1
- 
- clean:
-diff -u netkit-telnet-0.17/telnetd/Makefile netkit-telnet-0.17/telnetd/Makefile
---- netkit-telnet-0.17/telnetd/Makefile
-+++ netkit-telnet-0.17/telnetd/Makefile
-@@ -28,7 +28,7 @@
- telnetd.o: ../version.h
- 
- install: telnetd
--      install -s -m$(DAEMONMODE) telnetd $(INSTALLROOT)$(SBINDIR)/in.telnetd
-+      install -m$(DAEMONMODE) telnetd $(INSTALLROOT)$(SBINDIR)/in.telnetd
-       install -m$(MANMODE) issue.net.5 $(INSTALLROOT)$(MANDIR)/man5/
-       install -m$(MANMODE) telnetd.8 $(INSTALLROOT)$(MANDIR)/man8/in.telnetd.8
-       ln -sf in.telnetd.8 $(INSTALLROOT)$(MANDIR)/man8/telnetd.8
-only in patch2:
-unchanged:
---- netkit-telnet-0.17.orig/telnetlogin/Makefile
-+++ netkit-telnet-0.17/telnetlogin/Makefile
-@@ -11,7 +11,7 @@
- $(OBJS): ../version.h
- 
- install: telnetlogin
--      install -s -m4750 -oroot -gtelnetd telnetlogin $(INSTALLROOT)$(SBINDIR)
-+      install -m4750 -oroot -gtelnetd telnetlogin $(INSTALLROOT)$(SBINDIR)
-       install -m$(MANMODE) telnetlogin.8 $(INSTALLROOT)$(MANDIR)/man8
- 
- clean:
diff -Nru netkit-telnet-0.17/debian/patches/124-support_uservar.diff 
netkit-telnet-0.17/debian/patches/124-support_uservar.diff
--- netkit-telnet-0.17/debian/patches/124-support_uservar.diff  2016-11-05 
14:51:10.000000000 +0100
+++ netkit-telnet-0.17/debian/patches/124-support_uservar.diff  2019-02-24 
14:25:14.000000000 +0100
@@ -99,7 +99,7 @@
  }
  
  /* check that variable is safe to pass to login or shell */
-@@ -1414,6 +1414,8 @@ static int envvarok(char *varp) {
+@@ -1399,6 +1414,8 @@ static int envvarok(char *varp) {
      if (!strcmp(varp, "USER")) return 1;
      if (!strcmp(varp, "LOGNAME")) return 1;
      if (!strcmp(varp, "POSIXLY_CORRECT")) return 1;
diff -Nru netkit-telnet-0.17/debian/patches/150-cross_configure.diff 
netkit-telnet-0.17/debian/patches/150-cross_configure.diff
--- netkit-telnet-0.17/debian/patches/150-cross_configure.diff  2016-11-07 
18:28:57.000000000 +0100
+++ netkit-telnet-0.17/debian/patches/150-cross_configure.diff  1970-01-01 
01:00:00.000000000 +0100
@@ -1,60 +0,0 @@
-Description: Do not run built programs during configure.
- When cross compiling the source, the host-specific programs
- built during the configuration phase are irrelevant for execution.
- Avoid running those executables.  The compile test is still there,
- but the runtime test value should have been well accomplished after
- all these years!
-Author: Helmut Grohne <hel...@subdivi.de>
-Bug-Debian: http://bugs.debian.org/835977
-Forwarded: no
-Last Update: 2016-08-29
-
-Index: netkit-telnet-0.17/configure
-===================================================================
---- netkit-telnet-0.17.orig/configure
-+++ netkit-telnet-0.17/configure
-@@ -94,7 +94,6 @@
-     echo -n 'Checking if C compiler works... '
-     if (
-           $CC __conftest.c -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-          echo 'yes'
-      else
-@@ -141,7 +140,6 @@
-     echo -n 'Checking if C++ compiler works... '
-     if (
-           $CXX __conftest.cc -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-          echo 'yes'
-      else
-@@ -427,7 +425,6 @@
- else
-     if (
-           $CXX $CXXFLAGS -D_GNU_SOURCE __conftest.cc  -o __conftest || exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-         echo '-D_GNU_SOURCE'
-         CFLAGS="$CFLAGS -D_GNU_SOURCE"
-@@ -460,20 +457,17 @@
- EOF
- if (
-       $CXX $CXXFLAGS  __conftest.cc $LIBBSD -o __conftest || exit 1
--      ./__conftest || exit 1
-    ) >/dev/null 2>&1; then
-     echo 'ok'
- else
-     if (
-           $CXX $CXXFLAGS  __conftest.cc -lsnprintf $LIBBSD -o __conftest || 
exit 1
--          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-         echo '-lsnprintf'
-         LIBS="$LIBS -lsnprintf"
-     else
-         if (
-               $CXX $CXXFLAGS  __conftest.cc -ldb $LIBBSD -o __conftest || 
exit 1
--              ./__conftest || exit 1
-            ) >/dev/null 2>&1; then
-             echo '-ldb'
-             LIBS="$LIBS -ldb"
diff -Nru netkit-telnet-0.17/debian/patches/series 
netkit-telnet-0.17/debian/patches/series
--- netkit-telnet-0.17/debian/patches/series    2016-11-05 15:06:40.000000000 
+0100
+++ netkit-telnet-0.17/debian/patches/series    2019-02-24 14:25:14.000000000 
+0100
@@ -4,7 +4,6 @@
 024-can_2004-0911.diff
 026-can_2005_0469.diff
 030-reject_invalid_port.diff
-040-do_not_strip_programs.diff
 045-avoid_unsetting_term.diff
 100-format_security_error.diff
 110-markup_errors.diff
@@ -13,4 +12,5 @@
 130-drain_input_from_child.diff
 140-telnetlogin_name_check.diff
 142-numeric_hosts.diff
-150-cross_configure.diff
+use-cmake-as-buildsystem.patch
+use-cmake-as-buildsystem-debian-extras.patch
diff -Nru 
netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem-debian-extras.patch 
netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem-debian-extras.patch
--- 
netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem-debian-extras.patch  
    1970-01-01 01:00:00.000000000 +0100
+++ 
netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem-debian-extras.patch  
    2019-02-24 14:25:14.000000000 +0100
@@ -0,0 +1,61 @@
+Description: Debian-specific changes to the cmake build system
+Author: Christoph Biedl <debian.a...@manchmal.in-ulm.de>
+Forwarded: not-needed
+Last-Update: 2019-02-24
+
+--- a/telnet/CMakeLists.txt
++++ b/telnet/CMakeLists.txt
+@@ -6,7 +6,7 @@
+ ")
+ 
+ add_executable(
+-    telnet
++    telnet.netkit
+     commands.cc
+     environ.cc
+     genget.cc
+@@ -21,11 +21,12 @@
+     utilities.cc
+ )
+ install(
+-    TARGETS telnet
++    TARGETS telnet.netkit
+     DESTINATION ${BIN_DIR}
+ )
+ 
+ install(
+     FILES telnet.1
+     DESTINATION ${MAN_DIR}/man1/
++    RENAME telnet.netkit.1
+ )
+--- a/telnetd/CMakeLists.txt
++++ b/telnetd/CMakeLists.txt
+@@ -36,8 +36,6 @@
+     RENAME in.telnetd.8
+ )
+ install(
+-    CODE "execute_process( \
+-        COMMAND ${CMAKE_COMMAND} -E create_symlink \
+-        telnetd.8 \$ENV{DESTDIR}${MAN_DIR}/man8/in.telnetd.8 \
+-    )"
++    FILES issue.net.5
++    DESTINATION ${MAN_DIR}/man5/
+ )
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,6 +10,7 @@
+ set(
+     CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
+     -D_GNU_SOURCE \
++    -Ddebian \
+     -DACCEPT_USERVAR \
+     -Wall \
+     -Wno-trigraphs \
+@@ -17,6 +18,7 @@
+ set(
+     CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
+     -D_GNU_SOURCE \
++    -Ddebian \
+     -DACCEPT_USERVAR \
+     -Wall \
+     -Wno-trigraphs \
diff -Nru netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem.patch 
netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem.patch
--- netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem.patch    
1970-01-01 01:00:00.000000000 +0100
+++ netkit-telnet-0.17/debian/patches/use-cmake-as-buildsystem.patch    
2019-02-24 14:25:14.000000000 +0100
@@ -0,0 +1,137 @@
+Description: Use cmake as build system
+Author: Christoph Biedl <debian.a...@manchmal.in-ulm.de>
+Bug-Debian: https://bugs.debian.org/912131
+Last-Update: 2019-02-24
+
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,27 @@
++cmake_minimum_required(VERSION 3.7)
++project(netkit-telnet)
++
++set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
++set(SBIN_DIR "${CMAKE_INSTALL_PREFIX}/sbin")
++set(MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
++
++set(USE_GLIBC 1)
++
++set(
++    CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
++    -D_GNU_SOURCE \
++    -DACCEPT_USERVAR \
++    -Wall \
++    -Wno-trigraphs \
++")
++set(
++    CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
++    -D_GNU_SOURCE \
++    -DACCEPT_USERVAR \
++    -Wall \
++    -Wno-trigraphs \
++")
++
++add_subdirectory(telnet)
++add_subdirectory(telnetd)
++add_subdirectory(telnetlogin)
+--- /dev/null
++++ b/telnet/CMakeLists.txt
+@@ -0,0 +1,31 @@
++
++set(
++    CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
++    -DUSE_TERMIO \
++    -DKLUDGELINEMODE \
++")
++
++add_executable(
++    telnet
++    commands.cc
++    environ.cc
++    genget.cc
++    main.cc
++    netlink.cc
++    network.cc
++    ring.cc
++    sys_bsd.cc
++    telnet.cc
++    terminal.cc
++    tn3270.cc
++    utilities.cc
++)
++install(
++    TARGETS telnet
++    DESTINATION ${BIN_DIR}
++)
++
++install(
++    FILES telnet.1
++    DESTINATION ${MAN_DIR}/man1/
++)
+--- /dev/null
++++ b/telnetd/CMakeLists.txt
+@@ -0,0 +1,43 @@
++
++set(CMAKE_C_FLAGS "\
++    ${CMAKE_C_FLAGS} \
++    -DISSUE_FILE='\"/etc/issue.net\"' \
++    -DPARANOID_TTYS \
++    -DNO_REVOKE \
++    -DKLUDGELINEMODE \
++    -DDIAGNOSTICS \
++    -DLOGIN_WRAPPER='\"/usr/lib/telnetlogin\"' \
++")
++
++add_executable(
++    in.telnetd
++    global.c
++    setproctitle.c
++    slc.c
++    state.c
++    sys_term.c
++    telnetd.c
++    termstat.c
++    utility.c
++)
++target_link_libraries(
++    in.telnetd
++    ncurses
++    util
++)
++install(
++    TARGETS in.telnetd
++    DESTINATION ${SBIN_DIR}
++)
++
++install(
++    FILES telnetd.8
++    DESTINATION ${MAN_DIR}/man8/
++    RENAME in.telnetd.8
++)
++install(
++    CODE "execute_process( \
++        COMMAND ${CMAKE_COMMAND} -E create_symlink \
++        telnetd.8 \$ENV{DESTDIR}${MAN_DIR}/man8/in.telnetd.8 \
++    )"
++)
+--- /dev/null
++++ b/telnetlogin/CMakeLists.txt
+@@ -0,0 +1,19 @@
++
++add_executable(
++    telnetlogin
++    telnetlogin.c
++)
++install(
++    TARGETS telnetlogin
++    DESTINATION ${SBIN_DIR}
++    PERMISSIONS
++        SETUID
++        OWNER_WRITE OWNER_READ OWNER_EXECUTE
++        GROUP_READ GROUP_EXECUTE
++
++)
++
++install(
++    FILES telnetlogin.8
++    DESTINATION ${MAN_DIR}/man8/
++)
diff -Nru netkit-telnet-0.17/debian/rules netkit-telnet-0.17/debian/rules
--- netkit-telnet-0.17/debian/rules     2016-11-06 01:36:33.000000000 +0100
+++ netkit-telnet-0.17/debian/rules     2019-02-24 14:25:14.000000000 +0100
@@ -1,104 +1,7 @@
 #!/usr/bin/make -f
-# $Id: rules,v 1.12 2003/10/18 03:37:54 herbert Exp $
-# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+%:
+       dh $@ --buildsystem=cmake
 
-LDDEFS := -Wl,-z,defs -Wl,--as-needed
-
-CFLAGS += $(shell dpkg-buildflags --get CFLAGS) -fPIE -pie
-CXXFLAGS += $(shell dpkg-buildflags --get CXXFLAGS) -fPIE -pie
-CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
-LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS) -Wl,-z,now
-
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-ifeq ($(origin CC),default)
-       CC = $(DEB_HOST_GNU_TYPE)-gcc
-endif
-export CC
-ifeq ($(origin CXX),default)
-       CXX = $(DEB_HOST_GNU_TYPE)-g++
-endif
-export CXX
-
-build: build-arch build-indep
-build-arch: build-stamp
-build-indep: build-stamp
-build-stamp:
-       dh_testdir
-
-       if [ ! -f MCONFIG ]; then \
-               ./configure; \
-               sed -e 's;^CFLAGS=\(.*\)$$;CFLAGS= -Ddebian -D_GNU_SOURCE 
-DACCEPT_USERVAR -g $(CFLAGS) $(CPPFLAGS) \1;' \
-                   -e 's;^CXXFLAGS=\(.*\)$$;CXXFLAGS= -Ddebian -D_GNU_SOURCE 
-DACCEPT_USERVAR -g $(CXXFLAGS) $(CPPFLAGS) \1;' \
-                   -e 's;^LDFLAGS=\(.*\)$$;& $(LDDEFS) $(LDFLAGS);' \
-                   MCONFIG > MCONFIG.new; \
-               mv MCONFIG.new MCONFIG; \
-       fi
-       $(MAKE)
-
-       touch build-stamp
-
-clean:
-       dh_testdir
-       dh_testroot
-
-       test ! -f MCONFIG || $(MAKE) distclean
-
-       dh_clean
-
-install: install-stamp
-install-stamp: build-stamp
-       dh_testdir
-       dh_testroot
-       dh_prep
-       dh_installdirs
-
-       $(MAKE) -C telnet INSTALLROOT=`pwd`/debian/telnet MANDIR=/usr/share/man 
\
-               install
-       mv debian/telnet/usr/bin/telnet debian/telnet/usr/bin/telnet.netkit
-       mv debian/telnet/usr/share/man/man1/telnet.1 \
-          debian/telnet/usr/share/man/man1/telnet.netkit.1
-       cp telnet/README debian/telnet/usr/share/doc/telnet/README.telnet
-       cp telnet/README.old 
debian/telnet/usr/share/doc/telnet/README.telnet.old
-       $(MAKE) -C telnetd INSTALLROOT=`pwd`/debian/telnetd \
-               MANDIR=/usr/share/man install
-       cp telnetlogin/telnetlogin.8 debian/telnetd/usr/share/man/man8
-       cp telnetlogin/telnetlogin debian/telnetd/usr/lib
-       touch install-stamp
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-#      dh_testversion
-       dh_testdir
-       dh_testroot
-       dh_installdocs
-       dh_installexamples
-       dh_installmenu
-#      dh_installemacsen
-#      dh_installinit
-       dh_installcron
-#      dh_installmanpages
-#      dh_undocumented
-       dh_installchangelogs ChangeLog
-       dh_lintian
-       dh_strip
-       dh_compress
-       dh_fixperms
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-#      dh_makeshlibs
-       dh_md5sums
-       dh_builddeb
-
-source diff:                                                                  
-       @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+override_dh_missing:
+       dh_missing --fail-missing
diff -Nru netkit-telnet-0.17/debian/telnet.docs 
netkit-telnet-0.17/debian/telnet.docs
--- netkit-telnet-0.17/debian/telnet.docs       1970-01-01 01:00:00.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnet.docs       2019-02-24 14:25:14.000000000 
+0100
@@ -0,0 +1,3 @@
+
+telnet/README
+telnet/README.old
diff -Nru netkit-telnet-0.17/debian/telnet.install 
netkit-telnet-0.17/debian/telnet.install
--- netkit-telnet-0.17/debian/telnet.install    1970-01-01 01:00:00.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnet.install    2019-02-24 14:25:14.000000000 
+0100
@@ -0,0 +1,2 @@
+
+usr/bin/telnet.netkit
diff -Nru netkit-telnet-0.17/debian/telnet.manpages 
netkit-telnet-0.17/debian/telnet.manpages
--- netkit-telnet-0.17/debian/telnet.manpages   1970-01-01 01:00:00.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnet.manpages   2019-02-24 14:25:14.000000000 
+0100
@@ -0,0 +1,2 @@
+
+debian/tmp/usr/share/man/man1/telnet.netkit.1
diff -Nru netkit-telnet-0.17/debian/telnetd.dirs 
netkit-telnet-0.17/debian/telnetd.dirs
--- netkit-telnet-0.17/debian/telnetd.dirs      2016-11-05 14:51:10.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnetd.dirs      1970-01-01 01:00:00.000000000 
+0100
@@ -1,4 +0,0 @@
-usr/lib
-usr/share/man/man5
-usr/share/man/man8
-usr/sbin
diff -Nru netkit-telnet-0.17/debian/telnetd.docs 
netkit-telnet-0.17/debian/telnetd.docs
--- netkit-telnet-0.17/debian/telnetd.docs      2016-11-05 14:51:10.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnetd.docs      2019-02-24 14:25:14.000000000 
+0100
@@ -1,2 +1 @@
-BUGS
-README 
+README
diff -Nru netkit-telnet-0.17/debian/telnetd.install 
netkit-telnet-0.17/debian/telnetd.install
--- netkit-telnet-0.17/debian/telnetd.install   1970-01-01 01:00:00.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnetd.install   2019-02-24 14:25:14.000000000 
+0100
@@ -0,0 +1,3 @@
+
+usr/sbin/in.telnetd
+usr/sbin/telnetlogin    usr/lib/
diff -Nru netkit-telnet-0.17/debian/telnetd.manpages 
netkit-telnet-0.17/debian/telnetd.manpages
--- netkit-telnet-0.17/debian/telnetd.manpages  1970-01-01 01:00:00.000000000 
+0100
+++ netkit-telnet-0.17/debian/telnetd.manpages  2019-02-24 14:25:14.000000000 
+0100
@@ -0,0 +1,4 @@
+
+debian/tmp/usr/share/man/man5/issue.net.5
+debian/tmp/usr/share/man/man8/in.telnetd.8
+debian/tmp/usr/share/man/man8/telnetlogin.8

Attachment: signature.asc
Description: PGP signature

Reply via email to