From 5962a0e0b935a3703b7b1353bd2cdf749b86a32d Mon Sep 17 00:00:00 2001 From: "Peter J. Mello" Date: Wed, 15 May 2019 15:53:22 -0700 Subject: [PATCH] Updated Debian packaging files for Ubuntu 19.04 "Disco Dingo" Signed-off-by: Peter J. Mello --- debian/changelog | 59 ++++++++++- debian/control | 13 +-- debian/copyright | 26 ++++- debian/patches/Makefile.patch | 49 +++++++++ debian/patches/series | 1 + debian/reptyr.1 | 185 ++++++++++++++++++++++++++++++++++ debian/reptyr.docs | 2 + debian/reptyr.fr.1 | 155 ++++++++++++++++++++++++++++ debian/reptyr.manpages | 2 + debian/rules | 21 ++-- debian/watch | 5 +- 11 files changed, 491 insertions(+), 27 deletions(-) create mode 100644 debian/patches/Makefile.patch create mode 100644 debian/patches/series create mode 100644 debian/reptyr.1 create mode 100644 debian/reptyr.fr.1 create mode 100644 debian/reptyr.manpages diff --git a/debian/changelog b/debian/changelog index feded96..dbca7da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,15 @@ -reptyr (0.6.2-1) unstable; urgency=low +reptyr (0.7.0-1~ppa) disco; urgency=medium + * No-changes build from source from repository tag + * Add bash completion support + * Fix compilation with musl libc, CentOS, or GCC 7+ + * Support for PowerPC and aarch64 + + -- Peter J. Mello Mon, 13 May 2019 22:25:07 -0700 + +reptyr (0.6.2-1) utopic; urgency=low + + * Fix tty-stealing on i386 * New release: - Fixup build for tests by adding Python dependencies and disabling tests when Yama would not allow them to run @@ -7,8 +17,24 @@ reptyr (0.6.2-1) unstable; urgency=low -- Evan Broder Sun, 08 Feb 2015 14:13:04 -1000 -reptyr (0.5-1) unstable; urgency=low +reptyr (0.6.1-1) utopic; urgency=low + + * Fix compilation when chown is declared as `warn_unused_result` + + -- Peter J. Mello Thu, 18 Jan 2015 00:00:00 -0700 + +reptyr (0.6-1) utopic; urgency=medium + + * Add -T ("tty-stealing") mode, which works on processes with children. + See https://blog.nelhage.com/2014/08/new-reptyr-feature-tty-stealing/ + * Added FreeBSD support + * Minor bugfixes + + -- Peter J. Mello Sun, 4 Jan 2015 00:00:00 -0700 + +reptyr (0.5-1) saucy; urgency=low + * Add an early check and error if attaching a process with children. * New release (Closes: #711020): - Drop debian/patches/accept-cmd-line-build-flags.patch which was accepted upstream @@ -21,7 +47,15 @@ reptyr (0.5-1) unstable; urgency=low -- Evan Broder Wed, 05 Jun 2013 16:20:50 -0700 -reptyr (0.3-2) unstable; urgency=low +reptyr (0.4-1) precise; urgency=medium + + * Add support for scripting with the -l flag. + * Add a French translation of the man page + * Add a -V flag + + -- Peter J. Mello Thu, 16 Aug 2012 00:00:00 -0700 + + reptyr (0.3-2) natty; urgency=low * Bump standards version to 3.9.2 (no changes). * Build for armhf (Closes: #633750) @@ -29,8 +63,23 @@ reptyr (0.3-2) unstable; urgency=low -- Evan Broder Mon, 31 Oct 2011 12:05:33 -0400 -reptyr (0.3-1) unstable; urgency=low +reptyr (0.3-1) natty; urgency=medium - * Initial release (Closes: #613123) + * Initial Debian release (Closes: #613123) -- Evan Broder Sun, 10 Jul 2011 08:28:45 -0700 + +reptyr (0.2-1) maverick; urgency=low + + * Add a man page + * Add a 'make install' target + * Improve detection of which fd's to attach, + * Add a '-s' option to attach programs not currently on a tty. + + -- Peter J. Mello Tue, 1 Mar 2011 00:00:00 -0700 + +reptyr (0.1-1) maverick; urgency=medium + + * Initial release + + -- Peter J. Mello Thu, 27 Jan 2011 00:00:00 -0700 diff --git a/debian/control b/debian/control index d143734..a1f81ad 100644 --- a/debian/control +++ b/debian/control @@ -1,15 +1,16 @@ Source: reptyr +Maintainer: Peter J. Mello Section: misc Priority: optional -Maintainer: Evan Broder -Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.16.1~), python, python-pexpect -Standards-Version: 3.9.6 +Build-Depends: debhelper-compat (= 12), dpkg-dev (>= 1.16.1), python, + python-pexpect +Standards-Version: 4.3.0 Homepage: https://github.com/nelhage/reptyr -Vcs-Git: git://github.com/nelhage/reptyr.git -b debian -Vcs-Browser: http://github.com/nelhage/reptyr/tree/debian +Vcs-Browser: https://github.com/nelhage/reptyr/tree/debian +Vcs-Git: https://github.com/nelhage/reptyr.git -b debian Package: reptyr -Architecture: i386 amd64 armel armhf +Architecture: i386 amd64 armel armhf arm64 powerpc Depends: ${shlibs:Depends}, ${misc:Depends} Description: Tool for moving running programs between ptys reptyr is a utility for taking an existing running program and diff --git a/debian/copyright b/debian/copyright index 0c7162c..ac3e5a0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,15 +1,16 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: reptyr Upstream-Contact: Nelson Elhage Source: https://github.com/nelhage/reptyr Files: * -Copyright: Copyright (C) 2011 by Nelson Elhage +Copyright: 2011-2018 Nelson Elhage License: Expat Files: debian/* -Copyright: 2011, Evan Broder -License: Expat +Copyright: 2011-2015 Evan Broder + 2019 Peter J. Mello +License: Apache-2.0 License: Expat Permission is hereby granted, free of charge, to any person obtaining @@ -31,3 +32,20 @@ License: Expat ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache License 2.0 can + be found in "/usr/share/common-licenses/Apache-2.0". + diff --git a/debian/patches/Makefile.patch b/debian/patches/Makefile.patch new file mode 100644 index 0000000..0f00583 --- /dev/null +++ b/debian/patches/Makefile.patch @@ -0,0 +1,49 @@ +Description: Change the install prefix + Upstream has a peculiar way of writing the install directive in the Makefile. + I changed it to allow the package build to work properly, which included + changing the prefix from /usr/local to /usr. +Origin: maintainer +Forwarded: no +Last-Update: 2019-05-14 + +--- reptyr-0.7.0~ppa.orig/Makefile ++++ reptyr-0.7.0~ppa/Makefile +@@ -8,11 +8,8 @@ ifeq ($(UNAME_S),FreeBSD) + OBJS += platform/freebsd/freebsd_ptrace.o platform/freebsd/freebsd.o + LDFLAGS += -lprocstat + endif +-# Note that because of how Make works, this can be overridden from the +-# command-line. +-# +-# e.g. install to /usr with `make PREFIX=/usr` +-PREFIX=/usr/local ++ ++PREFIX=/usr + BINDIR=$(PREFIX)/bin + MANDIR=$(PREFIX)/share/man + +@@ -46,15 +43,16 @@ clean: + BASHCOMPDIR ?= $(shell $(PKG_CONFIG) --variable=completionsdir bash-completion 2>/dev/null) + + install: reptyr +- install -d -m 755 $(DESTDIR)$(BINDIR) +- install -m 755 reptyr $(DESTDIR)$(BINDIR)/reptyr +- install -d -m 755 $(DESTDIR)$(MANDIR)/man1 +- install -m 644 reptyr.1 $(DESTDIR)$(MANDIR)/man1/reptyr.1 +- install -d -m 755 $(DESTDIR)$(MANDIR)/fr/man1 +- install -m 644 reptyr.fr.1 $(DESTDIR)$(MANDIR)/fr/man1/reptyr.1 ++ install -d -m 0755 $(DESTDIR)$(BINDIR) ++ install -D -m 0755 reptyr $(DESTDIR)$(BINDIR)/reptyr ++ install -d -m 0755 $(DESTDIR)$(MANDIR)/man1 ++ install -D -m 0644 reptyr.1 $(DESTDIR)$(MANDIR)/man1/reptyr.1 ++ install -d -m 0755 $(DESTDIR)$(MANDIR)/fr/man1 ++ install -D -m 0644 reptyr.fr.1 $(DESTDIR)$(MANDIR)/fr/man1/reptyr.1 + bashcompdir=$(BASHCOMPDIR) ; \ + test -z "$$bashcompdir" && bashcompdir=/etc/bash_completion.d ; \ +- install -d -m 755 $(DESTDIR)$$bashcompdir ; \ +- install -m 644 reptyr.bash $(DESTDIR)$$bashcompdir/reptyr ++ install -d -m 0755 $(DESTDIR)$$bashcompdir ; \ ++ install -D -m 0644 reptyr.bash $(DESTDIR)$$bashcompdir/reptyr + + .PHONY: PHONY ++ diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..5b1c0a4 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +Makefile.patch diff --git a/debian/reptyr.1 b/debian/reptyr.1 new file mode 100644 index 0000000..ea690de --- /dev/null +++ b/debian/reptyr.1 @@ -0,0 +1,185 @@ +.mso www.tmac +.TH reptyr 1 "03 Feb 2011" +.SH NAME +reptyr \- Reparent a running program to a new terminal +.SH SYNOPSIS +.B reptyr +.I PID + +.B reptyr \-l|\-L [COMMAND [ARGS]] + +.SH DESCRIPTION + +.B reptyr +is a utility for taking an existing running program and +attaching it to a new terminal. Started a long-running process over +ssh, but have to leave and don't want to interrupt it? Just start a +screen, use +.B reptyr +to grab it, and then kill the ssh session and head +on home. +.LP +.B reptyr +works by attaching to the target program using +.BR ptrace (2), +redirecting relevant file descriptors, and changing the program's controlling +terminal (See +.BR tty (4)) +It is this last detail that makes +.B reptyr +work much better than alternatives such as +.BR retty (1). + +.LP +After attaching a program, the program will appear to be either backgrounded or +suspended to the shell it was launched from (depending on the shell). For +maximal safety you can run +.IP +bg; disown +.LP + +in the old shell to remove the association with the program, but +.B reptyr +will attempt to ensure that the target program remains running even if you close +the shell without doing so. + +.SH OPTIONS + +.B \-T +.IP +Use an alternate mode of attaching, "TTY-stealing". In this mode, +.B reptyr +will not +.BR ptrace (2) +the target process, but will attempt to discover the terminal emulator +for that process' pty, and steal the master end of the pty. This mode +is more reliable and flexible in many circumstances (for instance, it +can attach all processes on a tty, rather than just a single +process). However, as a downside, children of +.BR sshd(8) +cannot be attached via +.B -T +unless +.B reptyr +is run as root. See +.URL https://blog.nelhage.com/2014/08/new-reptyr-feature-tty-stealing/ +for more information about tty-stealing. +.LP + +.B \-l, \-L [COMMAND [ARGS]] +.IP +Instead of attaching to a new process, create a new pty pair, proxy the master +end to the current terminal, and then print the name of the slave pty. This can +be passed to e.g. +.B gdb\'s +.I set inferior-tty +option. + +If an optional +.B COMMAND +and +.B ARGS +are passed in conjunction with +.B -l, +that command will be executed as a child of +.B reptyr +with the +.B REPTYR_PTY +environment variable set to the name of the slave pty. If +.B -L +is used instead of +.B -l, +then fds 0-2 of the child will also be redirected to point to the +slave, and the child will be run in a fresh session with the slave as +its controlling terminal. +.LP + +.B \-s +.IP + +By default, reptyr will move any file descriptors in the target that were +connected to the target's controlling terminal to point to the new terminal. The +.B -s +option will cause reptyr to unconditionally attach file descriptors 0, 1, and 2 +in the target, even if the target has no controlling terminal or they are not +connected to a terminal. +.LP + +.B \-v +.IP +Print the version of +.B reptyr +and exit. +.LP + +.B \-h +.IP +Print a usage message and exit. +.LP + +.B \-V +.IP +Print verbose debug output while running. +.LP + +.SH NOTES + +.B reptyr +depends on the +.BR ptrace (2) +system call to attach to the remote program. On Ubuntu Maverick and higher, this +ability is disabled by default for security reasons. You can enable it +temporarily by doing +.IP + # echo 0 > /proc/sys/kernel/yama/ptrace_scope +.LP +as root, or permanently by editing the file +.IR /etc/sysctl.d/10-ptrace.conf , +which also contains more information about this setting. + +.SH BUGS + +When attaching to some curses programs, they will not redraw the screen right +away, and a +.B ^L +or similar will be needed to force a redraw. + +Similarly, after attaching to certain programs, the old terminal will be left in +an odd state, and a +.B clear +or even +.B reset +may be required before the old terminal is usable again. + +Attaching to rtorrent (and probably some other apps) doesn't work right +(rtorrent stops accepting input) (The problem is that rtorrent is using epoll to +poll stdin, and we don't update the internal reference that the epoll fd has to +the old tty). + +Attaching to a process with children doesn't work right. This should be possible +to fix -- I just need to ptrace each child individually and do the same games to +it. + +Attaching a +.BR less (1) +process doesn't work if you have a +.I .lessfilter +file, as +.BR less +leaves around a zombie child in this case. This could be worked around. + +Bugs should be reported to the author (see below) or via the issue tracker on +GitHub. + +.SH AUTHORS + +reptyr was written by Nelson Elhage . + +.SH HOMEPAGE + +.URL https://github.com/nelhage/reptyr + +.SH SEE ALSO + +.BR neercs (1), +.BR screen (1) diff --git a/debian/reptyr.docs b/debian/reptyr.docs index b43bf86..2d2ccf3 100644 --- a/debian/reptyr.docs +++ b/debian/reptyr.docs @@ -1 +1,3 @@ +ChangeLog +NOTES README.md diff --git a/debian/reptyr.fr.1 b/debian/reptyr.fr.1 new file mode 100644 index 0000000..2007f49 --- /dev/null +++ b/debian/reptyr.fr.1 @@ -0,0 +1,155 @@ +.\" Traduction Laurent GAUTROT - 2011-08-06 +.mso www.tmac +.TH reptyr 1 "03 Feb 2011" +.SH NOM +reptyr \- Reassoccie un programme en cours d'exécution à un nouveau terminal +.SH SYNOPSIS +.B reptyr +.I PID + +.B reptyr \-l + +.SH DESCRIPTION + +.B reptyr +est un utilitaire qui prend un programme en cours d'exécution et +l'attache à un nouveau terminal. Vous avez démarré un programme long à +travers ssh, mais vous devez partir et vous ne voulez pas +l'interrompre\ ? Démarrez simplement un screen, utilisez +.B reptyr +pour l'attraper, puis tuez la session ssh et vous pouvez rentrer à la +maison. +.LP +.B reptyr +fonctionne en s'attachant au programme visé à l'aide de +.BR ptrace (2), +en redirigeant les descripteurs de fichiers appropriés et en modifiant +le terminal de contrôle du programme (Voir +.BR tty (4)) +C'est le détail qui fait que +.B reptyr +focntionne bien mieux que les autres programmes du même type, comme +.BR retty (1). + +.LP +Après avoir attaché un programme, il apparaît soit à l'arrière-plan, +soit suspendu pour le shell qui l'a lancé (variable en fonction du +shell). +Pour une sécurité maximale, vous pouvez exécuter +.IP +bg; disown +.LP + +dans le vieux shell pour supprimer l'association avec le programme, +mais +.B reptyr +tente de s'assurer que le programme visé reste en cours d'exécution +même si vous fermez le shell sans le faire. + +.SH OPTIONS + +.B \-l +.IP +Plutôt que d'attacher un nouveau processus, crée un couveau couple de +pty, redirige l'extrémité maîtresse vers le terminal en cours, puis +affiche le nom du pty esclave. Il pourra être passé en argument par +exemple à l'option +.I set inferior-tty +de +.B gdb. +.LP + +.B \-s +.IP + +Par défaut, reptyr déplace tout descripteur de fichier de la cible qui +était connecté au terminal de contrôle vers le nouveau terminal. +L'option +.B -s +fait que reptyr attache les descripteurs de fichiers 0, 1 et 2 sans +condition même si la cible n'a pas de terminal de contrôle ou qu'elle +n'est pas connectée à un terminal. +.LP + +.B \-v +.IP +Affiche la version de +.B reptyr +et sort. +.LP + +.B \-h +.IP +Affiche un message d'usage et sort. +.LP + +.B \-V +.IP +Affiche des messages verbeux. +.LP + +.SH NOTES + +.B reptyr +dépend de l'appel système +.BR ptrace (2) +pour s'attacher au programme distant. Sur Ubuntu Maverick et suivant +cette possibilité est désactivée par défaut pour des raisons de +sécurité. Vous pouvez l'activer temporairement avec +.IP + # echo 0 > /proc/sys/kernel/yama/ptrace_scope +.LP +en tant que rootn ou de manière permanente en éditant le fichier +.IR /etc/sysctl.d/10-ptrace.conf , +ui contient aussi plus d'information sur ce réglage. + +.SH BUGS + +Quand on s'attache à quelques programmes curses, ils ne redessinent +pas immédiatement l'écran, et un +.B ^L +ou équivalent est nécessaire pour forcer l'actualisation. + +De la même manière, après avoir attaché certains programmes, le vieux +terminal est dans un état étrange et un +.B clear +ou même un +.B reset +est nécessaire avant que le vieux terminal ne soit à nouveau +utilisable. + +L'attachement à rtorrent (et peut-être à d'autres applications) ne +fonctionne pas (rtorrent arrête d'accepter des entrées). Le problème +est que rtorrent utilise epoll pour vérifier l'entrée standard et +qu'on ne met pas à jour la référence interne que le descripteur de +fichier d'epoll a de l'ancien terminal. + +L'attachement à un processus avec des fils ne fonctionne pas +correctement. Il devrait être possible de le corriger. Il faut juste +ptracer chaque fils individuellement et de jouer avec lui. + +L'attachement à un processus +.BR less (1) +ne fonctionne pas si vous avez un fichier +.I .lessfilter +parce que +.BR less +abandonne un fils zombie dans ce cas. Ça devrait pouvoir être corrigé. + +Vous pouvez rapporter des bugs à l'auteur (voir ci-dessous) ou par +l'issue tracker sur +GitHub. + +.SH AUTEURS + +reptyr est écrit par Nelson Elhage . + +.SH HOMEPAGE + +.URL https://github.com/nelhage/reptyr + +.SH VOIR AUSSI + +.BR neercs (1), +.BR screen (1) + diff --git a/debian/reptyr.manpages b/debian/reptyr.manpages new file mode 100644 index 0000000..1ec0ab9 --- /dev/null +++ b/debian/reptyr.manpages @@ -0,0 +1,2 @@ +reptyr.1 +reptyr.fr.1 diff --git a/debian/rules b/debian/rules index d7d3249..3904f5b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,18 +1,19 @@ #!/usr/bin/make -f +export DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + %: - dh $@ + dh $@ override_dh_auto_build: - dh_auto_build -- $(shell dpkg-buildflags --export=configure) + dh_auto_build -- $(shell dpkg-buildflags --export=configure) -override_dh_auto_install: - dh_auto_install -- PREFIX=/usr +override_dh_auto_clean: + $(MAKE) clean -# reptyr's test suite relies on being able to ptrace non-child -# processes, which isn't allowed under yama's defaults on Ubuntu override_dh_auto_test: - if ! [ -f /proc/sys/kernel/yama/ptrace_scope ] || \ - [ "$$(cat /proc/sys/kernel/yama/ptrace_scope)" = 0 ]; then \ - dh_auto_test; \ - fi + if ! [ -f /proc/sys/kernel/yama/ptrace_scope ] || \ + [ "$$(cat /proc/sys/kernel/yama/ptrace_scope)" = 0 ]; then \ + dh_auto_test; \ + fi diff --git a/debian/watch b/debian/watch index fdf6373..fe46b43 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,3 @@ -version=3 -http://githubredir.debian.net/github/nelhage/reptyr/reptyr-(.*).tar.gz +version=4 +opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/reptyr-$1\.tar\.gz/ \ + https://github.com/nelhage/reptyr/tags .*/?(\d{2}\.\d.\d)\.tar\.gz