From d384ba970383b89664b6aa823d8bbd8792662a1a Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Thu, 13 Jun 2019 16:41:47 +0800 Subject: [PATCH] Port patches from Debian (BZ#1716106) Requires lrzsz --- ...Remove-build-instruction-about-lrzsz.patch | 82 +++++++++++++++++++ 0002-Install-files-into-under-DESTDIR.patch | 27 ++++++ 0003-Do-not-symlink-zssh-to-ztelnet.patch | 21 +++++ 0004-Use-GNU-openpty-library-for-pty.h.patch | 53 ++++++++++++ 0005-Do-not-call-strip-in-build-process.patch | 23 ++++++ ...ction-call-with-rl_completion_func_t.patch | 22 +++++ 0007-Fix-typo-in-man-page-zssh.1.patch | 21 +++++ ...-from-version-string-to-enable-repro.patch | 21 +++++ zssh.spec | 31 +++++-- 9 files changed, 293 insertions(+), 8 deletions(-) create mode 100644 0001-Remove-build-instruction-about-lrzsz.patch create mode 100644 0002-Install-files-into-under-DESTDIR.patch create mode 100644 0003-Do-not-symlink-zssh-to-ztelnet.patch create mode 100644 0004-Use-GNU-openpty-library-for-pty.h.patch create mode 100644 0005-Do-not-call-strip-in-build-process.patch create mode 100644 0006-replace-CPPFunction-call-with-rl_completion_func_t.patch create mode 100644 0007-Fix-typo-in-man-page-zssh.1.patch create mode 100644 0008-Strip-build-date-from-version-string-to-enable-repro.patch diff --git a/0001-Remove-build-instruction-about-lrzsz.patch b/0001-Remove-build-instruction-about-lrzsz.patch new file mode 100644 index 0000000..a7d5aea --- /dev/null +++ b/0001-Remove-build-instruction-about-lrzsz.patch @@ -0,0 +1,82 @@ +From: Bart Martens +Date: Tue, 17 Jan 2006 00:23:59 +0100 +Subject: Remove build instruction about lrzsz. + +Now that we have removed bundled lrzsz in source tarball, the package's +build instrctions need patching as well. +--- + Makefile.in | 20 ++------------------ + fake_readline/Makefile.in | 2 +- + test/Makefile.in | 4 ++-- + 3 files changed, 5 insertions(+), 21 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 92c7254..6e46a93 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -86,21 +86,6 @@ uninstall : + fake_readline : force + -cd fake_readline && $(MAKE) + +-lrzsz : +- cd lrzsz-0.12.20 && ./configure --prefix=@prefix@ +- cd lrzsz-0.12.20 && $(MAKE) +- +-lrzsz_links : +- ln -s @bindir@/lrz @bindir@/rz +- ln -s @bindir@/lsz @bindir@/sz +- ln -s @bindir@/lrb @bindir@/rb +- ln -s @bindir@/lsb @bindir@/sb +- ln -s @bindir@/lrx @bindir@/rx +- ln -s @bindir@/lsx @bindir@/sx +- +-lrzsz_install : +- cd lrzsz-0.12.20 && $(MAKE) install +- + # create source archive in ~/backup + tgz $(TGZ) : distclean force + @cdir=`pwd` && cdir=`basename $$cdir` && cd .. && \ +@@ -136,11 +121,10 @@ TAGS : + new : clean all + + clean : +- -rm *.o *~ *.a \#*\# core $(PRGS) typescript nohup.out $(RPMSPEC) $(BACKLINK) ++ -rm -f *.o *~ *.a \#*\# core $(PRGS) typescript nohup.out $(RPMSPEC) $(BACKLINK) + + distclean : clean +- -rm Makefile config.cache config.status config.log config.scan config.h TAGS +- -(cd lrzsz-0.12.20 && $(MAKE) distclean) ++ -rm -f Makefile config.cache config.status config.log config.scan config.h TAGS + -(cd fake_readline && $(MAKE) distclean) + -(cd test && $(MAKE) distclean) + +diff --git a/fake_readline/Makefile.in b/fake_readline/Makefile.in +index 77eca27..1134a5c 100644 +--- a/fake_readline/Makefile.in ++++ b/fake_readline/Makefile.in +@@ -28,7 +28,7 @@ new : clean all + + + clean : +- -rm *.o *~ *.a \#*\# core $(NAME) typescript nohup.out ++ -rm -f *.o *~ *.a \#*\# core $(NAME) typescript nohup.out + + distclean : clean + +diff --git a/test/Makefile.in b/test/Makefile.in +index 30f6dc1..7d8671f 100644 +--- a/test/Makefile.in ++++ b/test/Makefile.in +@@ -68,10 +68,10 @@ TAGS : + new : clean all + + clean : +- -rm *.o *~ *.a \#*\# core $(PRGS) typescript nohup.out $(RPMSPEC) $(BACKLINK) output.* ++ -rm -f *.o *~ *.a \#*\# core $(PRGS) typescript nohup.out $(RPMSPEC) $(BACKLINK) output.* + + distclean : clean +- -rm Makefile config.cache config.status config.log config.scan config.h TAGS ++ -rm -f Makefile config.cache config.status config.log config.scan config.h TAGS + + autoconf: + autoconf diff --git a/0002-Install-files-into-under-DESTDIR.patch b/0002-Install-files-into-under-DESTDIR.patch new file mode 100644 index 0000000..8969704 --- /dev/null +++ b/0002-Install-files-into-under-DESTDIR.patch @@ -0,0 +1,27 @@ +From: Bart Martens +Date: Sun, 20 May 2007 11:00:41 +0200 +Subject: Install files into under $(DESTDIR). + +This patch forces all installed files under $(DESTDIR) to cooperate +with Debian's build system. +--- + Makefile.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 6e46a93..69f68d7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -75,9 +75,9 @@ ztelnet : $(NAME) + + install : + strip $(NAME) +- $(INSTALL) -m 0711 zssh @bindir@ +- ln -f @bindir@/zssh @bindir@/ztelnet +- $(INSTALL) -m 0644 $(MANS) @mandir@/man1 ++ $(INSTALL) -m 0711 zssh $(DESTDIR)/@bindir@ ++ ln -f $(DESTDIR)/@bindir@/zssh $(DESTDIR)/@bindir@/ztelnet ++ $(INSTALL) -m 0644 $(MANS) $(DESTDIR)/@mandir@/man1 + + uninstall : + -cd @bindir@ && rm $(PRGS) diff --git a/0003-Do-not-symlink-zssh-to-ztelnet.patch b/0003-Do-not-symlink-zssh-to-ztelnet.patch new file mode 100644 index 0000000..61f0794 --- /dev/null +++ b/0003-Do-not-symlink-zssh-to-ztelnet.patch @@ -0,0 +1,21 @@ +From: Bart Martens +Date: Sun, 20 May 2007 11:00:41 +0200 +Subject: Do not symlink zssh to ztelnet + +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 69f68d7..51f60c0 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -76,7 +76,7 @@ ztelnet : $(NAME) + install : + strip $(NAME) + $(INSTALL) -m 0711 zssh $(DESTDIR)/@bindir@ +- ln -f $(DESTDIR)/@bindir@/zssh $(DESTDIR)/@bindir@/ztelnet ++ #ln -f $(DESTDIR)/@bindir@/zssh $(DESTDIR)/@bindir@/ztelnet + $(INSTALL) -m 0644 $(MANS) $(DESTDIR)/@mandir@/man1 + + uninstall : diff --git a/0004-Use-GNU-openpty-library-for-pty.h.patch b/0004-Use-GNU-openpty-library-for-pty.h.patch new file mode 100644 index 0000000..be6f6f1 --- /dev/null +++ b/0004-Use-GNU-openpty-library-for-pty.h.patch @@ -0,0 +1,53 @@ +From: Ben Wong +Date: Tue, 25 Sep 2007 01:48:30 -0700 +Subject: Use GNU openpty library for pty.h + +--- + configure.in | 11 +++++++++-- + openpty.c | 4 ++++ + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/configure.in b/configure.in +index a8f1441..af2cad0 100644 +--- a/configure.in ++++ b/configure.in +@@ -57,7 +57,7 @@ AC_CONFIG_HEADER(config.h) + AC_HEADER_STDC + AC_HEADER_SYS_WAIT + AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h termios.h unistd.h \ +- err.h sys/cdefs.h sys/param.h util.h stropts.h) ++ err.h sys/cdefs.h sys/param.h util.h stropts.h pty.h) + + + +@@ -97,7 +97,14 @@ AC_CHECK_FUNCS(strdup getpt isastream tcsetpgrp) + + + dnl Check what is available for tty/pty allocation +-AC_CHECK_FUNCS(_getpty getpseudotty openpty grantpt unlockpt) ++AC_CHECK_FUNCS(_getpty getpseudotty grantpt unlockpt) ++AC_CHECK_FUNCS(openpty,, ++ [AC_CHECK_LIB(util,openpty, ++ [AC_DEFINE(HAVE_OPENPTY) ++ LIBS="$LIBS -lutil"] ++ )]) ++ ++ + AC_MSG_CHECKING(for pseudo ttys) + if test -c /dev/getpty && test $ac_cv_func_getpseudotty = yes + then +diff --git a/openpty.c b/openpty.c +index 42cb203..0b8a642 100644 +--- a/openpty.c ++++ b/openpty.c +@@ -25,6 +25,10 @@ static char gl_slavename[GL_SLAVENAMELEN + 1] = {0}; + #include + #endif + ++#ifdef HAVE_PTY_H ++#include ++#endif ++ + void getmaster() + { + #ifdef DEBUG diff --git a/0005-Do-not-call-strip-in-build-process.patch b/0005-Do-not-call-strip-in-build-process.patch new file mode 100644 index 0000000..6efbe29 --- /dev/null +++ b/0005-Do-not-call-strip-in-build-process.patch @@ -0,0 +1,23 @@ +From: Ben Wong +Date: Tue, 25 Sep 2007 01:48:30 -0700 +Subject: Do not call strip in build process + +This is handled later in Debian build system by debhelper. +This closes #438380. +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 51f60c0..6f5542c 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -74,7 +74,7 @@ ztelnet : $(NAME) + ln $(NAME) $@ + + install : +- strip $(NAME) ++ #strip $(NAME) + $(INSTALL) -m 0711 zssh $(DESTDIR)/@bindir@ + #ln -f $(DESTDIR)/@bindir@/zssh $(DESTDIR)/@bindir@/ztelnet + $(INSTALL) -m 0644 $(MANS) $(DESTDIR)/@mandir@/man1 diff --git a/0006-replace-CPPFunction-call-with-rl_completion_func_t.patch b/0006-replace-CPPFunction-call-with-rl_completion_func_t.patch new file mode 100644 index 0000000..b555a20 --- /dev/null +++ b/0006-replace-CPPFunction-call-with-rl_completion_func_t.patch @@ -0,0 +1,22 @@ +From: YuanQing Su +Date: Mon, 21 Jul 2014 08:22:29 +0000 +Subject: replace CPPFunction call with rl_completion_func_t + +This closes #741761. +--- + completion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/completion.c b/completion.c +index 98e714a..de44329 100644 +--- a/completion.c ++++ b/completion.c +@@ -53,7 +53,7 @@ void initialize_readline() + so that if zssh_completion() fails nothing is completed */ + rl_completion_entry_function = fake_generator; + /* Tell the completer that we want a crack first. */ +- rl_attempted_completion_function = (CPPFunction *) zssh_completion; ++ rl_attempted_completion_function = (rl_completion_func_t *) zssh_completion; + + } + diff --git a/0007-Fix-typo-in-man-page-zssh.1.patch b/0007-Fix-typo-in-man-page-zssh.1.patch new file mode 100644 index 0000000..33cf632 --- /dev/null +++ b/0007-Fix-typo-in-man-page-zssh.1.patch @@ -0,0 +1,21 @@ +From: Boyuan Yang <073plan@gmail.com> +Date: Fri, 22 Dec 2017 10:31:58 +0800 +Subject: Fix typo in man page zssh.1 + +--- + zssh.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/zssh.1 b/zssh.1 +index 1a2ef44..c7e404f 100644 +--- a/zssh.1 ++++ b/zssh.1 +@@ -227,7 +227,7 @@ Other arguments are passed verbatim to ssh/telnet/whatever. + + .TP 10 + .B ZSSHESCAPE +-Setting the ZSSHESCAPE environment variable allows to override the default ++Setting the ZSSHESCAPE environment variable allows one to override the default + escape sequence. ZSSHESCAPE should contain only two characters of the form + `^X', meaning that ^X is to be the new escape sequence. + diff --git a/0008-Strip-build-date-from-version-string-to-enable-repro.patch b/0008-Strip-build-date-from-version-string-to-enable-repro.patch new file mode 100644 index 0000000..e02a741 --- /dev/null +++ b/0008-Strip-build-date-from-version-string-to-enable-repro.patch @@ -0,0 +1,21 @@ +From: Reiner Herrmann +Date: Fri, 22 Dec 2017 10:40:03 +0800 +Subject: Strip build date from version string to enable reproducible building + +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 6f5542c..db0ba38 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -110,7 +110,7 @@ $(RPMSPEC) : $(RPMSPEC:.spec=.spec.tpl) + + + version.h : force +- echo '#define ZSSH_VERSION "' `cat VERSION` ', built' `date` '"' > version.h ++ echo '#define ZSSH_VERSION "' `cat VERSION` '"' > version.h + + fun.h : $(SRC) + protos -o fun.h $(SRC) diff --git a/zssh.spec b/zssh.spec index d418f69..8883ae4 100644 --- a/zssh.spec +++ b/zssh.spec @@ -1,39 +1,54 @@ Name: zssh Version: 1.5c -Release: 3%{?dist} +Release: 4%{?dist} Summary: SSH and Telnet client with ZMODEM file transfer capability License: GPLv3 URL: http://zssh.sourceforge.net/ Source0: http://downloads.sourceforge.net/project/zssh/zssh/1.5/%{name}-%{version}.tgz +# patches from https://sources.debian.org/patches/zssh/1.5c.debian.1-7/ +Patch0: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0001-Remove-build-instruction-about-lrzsz.patch +Patch1: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0002-Install-files-into-under-DESTDIR.patch +Patch2: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0003-Do-not-symlink-zssh-to-ztelnet.patch +Patch3: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0004-Use-GNU-openpty-library-for-pty.h.patch +Patch4: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0005-Do-not-call-strip-in-build-process.patch +Patch5: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0006-replace-CPPFunction-call-with-rl_completion_func_t.patch +Patch6: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0007-Fix-typo-in-man-page-zssh.1.patch +Patch7: https://sources.debian.org/data/main/z/zssh/1.5c.debian.1-7/debian/patches/0008-Strip-build-date-from-version-string-to-enable-repro.patch BuildRequires: gcc BuildRequires: readline-devel BuildRequires: libtermcap-devel +BuildRequires: autoconf +Requires: lrzsz %description %{summary}. %prep -%setup -q +%autosetup -p1 +# remove bundled lrzsz +rm -fr lrzsz-0.12.20 %build +autoconf %configure %make_build %install -install -Dm 0755 %{name} %{buildroot}%{_bindir}/%{name} -ln -s %{_bindir}/%{name} %{buildroot}%{_bindir}/ztelnet -install -Dm 0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 -install -Dm 0644 ztelnet.1 %{buildroot}%{_mandir}/man1/ztelnet.1 +mkdir -p %{buildroot}%{_bindir}/ %{buildroot}%{_mandir}/man1/ +%make_install +rm %{buildroot}%{_mandir}/man1/ztelnet.1* %files %doc README %license COPYING %{_bindir}/%{name} -%{_bindir}/ztelnet %{_mandir}/man1/%{name}.1.* -%{_mandir}/man1/ztelnet.1.* %changelog +* Thu Jun 13 2019 Robin Lee - 1.5c-4 +- Port patches from Debian (BZ#1716106) +- Requires lrzsz + * Sun Feb 17 2019 Igor Gnatenko - 1.5c-3 - Rebuild for readline 8.0