From dd4176530b61cc62dba2aafc06442794ff9cbb39 Mon Sep 17 00:00:00 2001 From: Alin Năstac Date: Thu, 23 Jul 2009 08:16:12 +0000 Subject: Avoid conflicts with net-misc/putty and x11-terms/pssh by renaming pscp and pssh scripts (#248193 and #278794). (Portage version: 2.1.6.13/cvs/Linux x86_64) --- net-proxy/sshproxy/ChangeLog | 12 +- .../sshproxy-0.6.0_beta2-rename-wrappers.patch | 159 +++++++++++++++++ net-proxy/sshproxy/sshproxy-0.5.0.ebuild | 168 ------------------ net-proxy/sshproxy/sshproxy-0.6.0_beta2-r1.ebuild | 191 +++++++++++++++++++++ 4 files changed, 360 insertions(+), 170 deletions(-) create mode 100644 net-proxy/sshproxy/files/sshproxy-0.6.0_beta2-rename-wrappers.patch delete mode 100644 net-proxy/sshproxy/sshproxy-0.5.0.ebuild create mode 100644 net-proxy/sshproxy/sshproxy-0.6.0_beta2-r1.ebuild (limited to 'net-proxy/sshproxy') diff --git a/net-proxy/sshproxy/ChangeLog b/net-proxy/sshproxy/ChangeLog index 110061d63840..1bbb02ac3982 100644 --- a/net-proxy/sshproxy/ChangeLog +++ b/net-proxy/sshproxy/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-proxy/sshproxy -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/ChangeLog,v 1.11 2008/12/14 14:36:51 mrness Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/ChangeLog,v 1.12 2009/07/23 08:16:12 mrness Exp $ + +*sshproxy-0.6.0_beta2-r1 (23 Jul 2009) + + 23 Jul 2009; Alin Năstac + +files/sshproxy-0.6.0_beta2-rename-wrappers.patch, -sshproxy-0.5.0.ebuild, + +sshproxy-0.6.0_beta2-r1.ebuild: + Avoid conflicts with net-misc/putty and x11-terms/pssh by renaming pscp and + pssh scripts (#248193 and #278794). 14 Dec 2008; Alin Năstac sshproxy-0.5.0.ebuild, -sshproxy-0.6.0_beta1.ebuild, sshproxy-0.6.0_beta2.ebuild: diff --git a/net-proxy/sshproxy/files/sshproxy-0.6.0_beta2-rename-wrappers.patch b/net-proxy/sshproxy/files/sshproxy-0.6.0_beta2-rename-wrappers.patch new file mode 100644 index 000000000000..765bd9d5bdf9 --- /dev/null +++ b/net-proxy/sshproxy/files/sshproxy-0.6.0_beta2-rename-wrappers.patch @@ -0,0 +1,159 @@ +diff -Nru sshproxy-0.6.0_beta2.orig/lib/get_client_scripts/getscript.py sshproxy-0.6.0_beta2/lib/get_client_scripts/getscript.py +--- sshproxy-0.6.0_beta2.orig/lib/get_client_scripts/getscript.py 2008-01-28 01:44:29.000000000 +0200 ++++ sshproxy-0.6.0_beta2/lib/get_client_scripts/getscript.py 2009-07-23 10:34:01.000000000 +0300 +@@ -22,7 +22,7 @@ + from sshproxy import get_class + from sshproxy.util import chanfmt + +-pssh = """#!/bin/bash ++spssh = """#!/bin/bash + + PROXY_PORT=${SSHPROXY_PORT:-%(port)d} + PROXY_HOST=${SSHPROXY_HOST:-%(ip_addr)s} +@@ -32,7 +32,7 @@ + exec ssh -tp $PROXY_PORT $PROXY_USER@$PROXY_HOST -- "$@" + """ + +-pscp = """#!/bin/bash ++spscp = """#!/bin/bash + + PROXY_PORT=${SSHPROXY_PORT:-%(port)s} + PROXY_HOST=${SSHPROXY_HOST:-%(ip_addr)s} +@@ -79,26 +79,26 @@ + class Server(base_class): + def add_cmdline_options(self, parser): + base_class.add_cmdline_options(self, parser) +- parser.add_option("", "--get-pssh", dest="action", +- help="display pssh client script.", ++ parser.add_option("", "--get-spssh", dest="action", ++ help="display spssh client script.", + action="store_const", +- const="get_pssh", ++ const="get_spssh", + ) +- parser.add_option("", "--get-pscp", dest="action", +- help="display pscp client script.", ++ parser.add_option("", "--get-spscp", dest="action", ++ help="display spscp client script.", + action="store_const", +- const="get_pscp", ++ const="get_spscp", + ) + +- def opt_get_pssh(self, options, *args): ++ def opt_get_spssh(self, options, *args): + user = self.pwdb.get_client().username + ip_addr, port = self.ip_addr, self.port +- self.chan.send(pssh % locals()) ++ self.chan.send(spssh % locals()) + +- def opt_get_pscp(self, options, *args): ++ def opt_get_spscp(self, options, *args): + user = self.pwdb.get_client().username + ip_addr, port = self.ip_addr, self.port +- self.chan.send(pscp % locals()) ++ self.chan.send(spscp % locals()) + + + +diff -Nru sshproxy-0.6.0_beta2.orig/lib/get_client_scripts/__init__.py sshproxy-0.6.0_beta2/lib/get_client_scripts/__init__.py +--- sshproxy-0.6.0_beta2.orig/lib/get_client_scripts/__init__.py 2008-01-28 01:44:29.000000000 +0200 ++++ sshproxy-0.6.0_beta2/lib/get_client_scripts/__init__.py 2009-07-23 10:32:34.000000000 +0300 +@@ -21,11 +21,11 @@ + + __plugin_name__ = "Get Client Scripts" + __description__ = """ +- This plugin allows clients to download the pssh and +- pscp wrapper scripts with special options on the ssh ++ This plugin allows clients to download the spssh and ++ spscp wrapper scripts with special options on the ssh + command line: +- ssh -tp 2242 user@sshproxy -- --get-pssh +- ssh -tp 2242 user@sshproxy -- --get-pscp ++ ssh -tp 2242 user@sshproxy -- --get-spssh ++ ssh -tp 2242 user@sshproxy -- --get-spscp + """ + + def __init_plugin__(): +diff -Nru sshproxy-0.6.0_beta2.orig/misc/acl.db sshproxy-0.6.0_beta2/misc/acl.db +--- sshproxy-0.6.0_beta2.orig/misc/acl.db 2008-01-28 01:44:29.000000000 +0200 ++++ sshproxy-0.6.0_beta2/misc/acl.db 2009-07-23 10:30:30.000000000 +0300 +@@ -78,13 +78,13 @@ + # options ###################################################### + + # opt_list_sites is to allow or deny the use of the --list-sites option: +-# $ pssh --list-sites ++# $ spssh --list-sites + opt_list_sites: + # guests group members can't see the list of allowed sites (they're blind) + client.group != "guests" + +-# opt_get_pkey controls the option --get-pkey of pssh: +-# $ pssh --get-pkey root@host ++# opt_get_pkey controls the option --get-pkey of spssh: ++# $ spssh --get-pkey root@host + opt_get_pkey: + # only admins can get the public key of a site login + "admin" in split(client.groups) +diff -Nru sshproxy-0.6.0_beta2.orig/README sshproxy-0.6.0_beta2/README +--- sshproxy-0.6.0_beta2.orig/README 2008-01-28 01:44:29.000000000 +0200 ++++ sshproxy-0.6.0_beta2/README 2009-07-23 10:23:21.000000000 +0300 +@@ -95,9 +95,9 @@ + root@remote-site # exit + me@myhost $ + +-Here is the same with the pssh shell wrapper:: ++Here is the same with the spssh shell wrapper:: + +- me@myhost $ pssh remote-site ++ me@myhost $ spssh remote-site + root@remote-site # + ... doing some administration commands ... + root@remote-site # exit +@@ -105,7 +105,7 @@ + + You can also execute remote commands:: + +- me@myhost $ pssh remote-site uname -a ++ me@myhost $ spssh remote-site uname -a + nova.wallix.com + me@myhost $ + +@@ -114,9 +114,9 @@ + me@myhost $ scp /etc/issue me@proxy:root@remote-site:/etc/issue.new + me@myhost $ + +-And the same with the pscp shell wrapper:: ++And the same with the spscp shell wrapper:: + +- me@myhost $ pscp /etc/issue remote-site:/etc/issue.new ++ me@myhost $ spscp /etc/issue remote-site:/etc/issue.new + me@myhost $ + + +diff -Nru sshproxy-0.6.0_beta2.orig/setup.py sshproxy-0.6.0_beta2/setup.py +--- sshproxy-0.6.0_beta2.orig/setup.py 2008-01-28 01:44:29.000000000 +0200 ++++ sshproxy-0.6.0_beta2/setup.py 2009-07-23 10:22:31.000000000 +0300 +@@ -74,7 +74,7 @@ + url=url, + download_url='%sdownload/sshproxy-%s.tar.gz' % (url, version), + packages=['sshproxy'], +- scripts=['bin/sshproxyd', 'bin/sshproxy-setup', 'bin/pssh', 'bin/pscp'], ++ scripts=['bin/sshproxyd', 'bin/sshproxy-setup', 'bin/spssh', 'bin/spscp'], + long_description=long_description, + data_files=data_files, + classifiers=classifiers, +diff -Nru sshproxy-0.6.0_beta2.orig/sshproxy/server.py sshproxy-0.6.0_beta2/sshproxy/server.py +--- sshproxy-0.6.0_beta2.orig/sshproxy/server.py 2008-01-28 01:44:29.000000000 +0200 ++++ sshproxy-0.6.0_beta2/sshproxy/server.py 2009-07-23 10:30:44.000000000 +0300 +@@ -308,8 +308,8 @@ + + def parse_cmdline(self, args): + usage = u""" +- pssh [options] +- pssh [user@site [cmd]] ++ spssh [options] ++ spssh [user@site [cmd]] + """ + parser = OptionParser(self.chan, usage=usage) + # add options from a mapping or a Registry callback diff --git a/net-proxy/sshproxy/sshproxy-0.5.0.ebuild b/net-proxy/sshproxy/sshproxy-0.5.0.ebuild deleted file mode 100644 index 56d3e5d8a736..000000000000 --- a/net-proxy/sshproxy/sshproxy-0.5.0.ebuild +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/sshproxy-0.5.0.ebuild,v 1.4 2008/12/14 14:36:51 mrness Exp $ - -inherit distutils - -DESCRIPTION="sshproxy is an ssh gateway to apply ACLs on ssh connections" -HOMEPAGE="http://penguin.fr/sshproxy/" -SRC_URI="http://penguin.fr/sshproxy/download/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" - -IUSE="client-only mysql minimal" -# mysql: install the mysql_db backend driver -# minimal: do not install extra plugins -# client-only: install only the client wrappers - -DEPEND="!net-misc/putty - !client-only? ( - >=dev-python/paramiko-1.6.2 - mysql? ( >=dev-python/mysql-python-1.2.0 ) - )" -RDEPEND="${DEPEND} - net-misc/openssh" - -pkg_setup() { - enewgroup sshproxy - enewuser sshproxy -1 -1 /var/lib/sshproxy sshproxy -} - -src_install () { - dobin bin/pssh - dobin bin/pscp - if ! use client-only; then - distutils_src_install - - diropts -o sshproxy -g sshproxy -m0750 - keepdir /var/lib/sshproxy - keepdir /var/log/sshproxy - - # Create a default sshproxy.ini - dodir /etc/sshproxy - insopts -o sshproxy -g sshproxy -m0600 - insinto /etc/sshproxy - doins "${FILESDIR}/sshproxy.ini" - local BLOWFISH_SECRET=$(printf "%04hX%04hX%04hX%04hX\n" ${RANDOM} ${RANDOM} ${RANDOM} ${RANDOM}) - sed -i -e "s/%BLOWFISH_SECRET%/${BLOWFISH_SECRET}/" \ - -e "s/%HOSTNAME%/${HOSTNAME}/" \ - "${D}/etc/sshproxy/sshproxy.ini" - - rm -rf "${D}/usr/lib/sshproxy/spexpect" - if use minimal; then - local p - for p in acl_funcs console_extra logusers; do - rm -rf "${D}/usr/lib/sshproxy/${p}" - done - else - keepdir /var/log/sshproxy/logusers - { # initialize a reasonable value for the logusers plugin - echo - echo "[logusers]" - echo "logdir = /var/log/sshproxy/logusers" - echo - } >> "${D}/etc/sshproxy/sshproxy.ini" - fi - - # init/conf files for sshproxy daemon - newinitd "${FILESDIR}/sshproxyd.initd" sshproxyd - newconfd "${FILESDIR}/sshproxyd.confd" sshproxyd - - if use mysql; then - insinto /usr/share/sshproxy/mysql_db - doins misc/mysql_db.sql - doins misc/sshproxy-mysql-user.sql - else - rm -rf "${D}/usr/lib/sshproxy/mysql_db" - sed -i -e 's/[ \t]\+mysql//' \ - "${D}/etc/init.d/sshproxyd" - fi - fi -} - -pkg_postinst () { - if use client-only; then - echo - einfo "Don't forget to set the following environment variables" - einfo " SSHPROXY_HOST (default to localhost)" - einfo " SSHPROXY_PORT (default to 2242)" - einfo " SSHPROXY_USER (default to $USER)" - einfo "for each sshproxy user." - else - distutils_pkg_postinst - - echo - einfo "If this is your first installation, run" - einfo " emerge --config =${CATEGORY}/${PF}" - einfo "to initialize the backend and configure sshproxy." - echo - einfo "There is no need to install sshproxy on a client machine." - einfo "You can connect to a SSH server using this proxy by running" - einfo " ssh -tp PROXY_PORT PROXY_HOST REMOTE_USER@REMOTE_HOST" - fi -} - -pkg_config() { - if [[ -d "${ROOT}/usr/lib/sshproxy/mysql_db" ]]; then - local PASSWD=$(printf "%04hX%04hX%04hX%04hX\n" ${RANDOM} ${RANDOM} ${RANDOM} ${RANDOM}) - local SHARE="${ROOT}/usr/share/sshproxy/mysql_db" - local DB_HOST DB_PORT - read -p "Enter the MySQL host (default localhost): " DB_HOST - [[ -n "${DB_HOST}" ]] || DB_HOST=localhost - read -p "Enter the MySQL port (default 3306): " DB_PORT - [[ -n "${DB_PORT}" ]] || DB_PORT=3306 - - ewarn "When prompted for a password, enter your MySQL root password" - ewarn - - if mysql -h ${DB_HOST} -P ${DB_PORT} -u root -p <> "${ROOT}/etc/sshproxy/sshproxy.ini" - - sed -i -e 's/^\(\(acl\|client\|site\)_db = \)file_db/\1mysql_db/g' \ - "${ROOT}/etc/sshproxy/sshproxy.ini" - grep -q "^plugin_list .* mysql_db" \ - "${ROOT}/etc/sshproxy/sshproxy.ini" || \ - sed -i -e 's/^\(plugin_list = .*\)$/\1 mysql_db/g' \ - "${ROOT}/etc/sshproxy/sshproxy.ini" - else - ewarn "Failed to create MySQL database!" - ewarn "If the database already existed and you want to replace it," - ewarn "hit Ctrl-C now and drop the old database by running the command:" - ewarn " /usr/bin/mysqladmin -h ${DB_HOST} -P ${DB_PORT} -u root -p drop sshproxy" - read -p "Hit Ctrl-C to stop the procedure or Enter to continue " key - fi - fi - - INITD_STARTUP="/etc/init.d/sshproxyd start" chroot "${ROOT}" \ - sshproxy-setup -u sshproxy -c /etc/sshproxy -} diff --git a/net-proxy/sshproxy/sshproxy-0.6.0_beta2-r1.ebuild b/net-proxy/sshproxy/sshproxy-0.6.0_beta2-r1.ebuild new file mode 100644 index 000000000000..f3bd5ecb7823 --- /dev/null +++ b/net-proxy/sshproxy/sshproxy-0.6.0_beta2-r1.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/sshproxy-0.6.0_beta2-r1.ebuild,v 1.1 2009/07/23 08:16:12 mrness Exp $ + +EAPI="2" + +inherit distutils eutils + +DESCRIPTION="sshproxy is an ssh gateway to apply ACLs on ssh connections" +HOMEPAGE="http://sshproxy-project.org/" +SRC_URI="http://sshproxy-project.org/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="client-only mysql minimal" +# mysql: install the mysql_db backend driver +# minimal: do not install extra plugins +# client-only: install only the client wrappers + +DEPEND="!client-only? ( + >=dev-python/paramiko-1.6.2 + mysql? ( >=dev-python/mysql-python-1.2.0 ) + )" +RDEPEND="${DEPEND} + net-misc/openssh" + +pkg_setup() { + enewgroup sshproxy + enewuser sshproxy -1 -1 /var/lib/sshproxy sshproxy +} + +src_prepare() { + # avoid conflicts with net-misc/putty and x11-terms/pssh + # by renaming pscp and pssh scripts (#248193 and #278794) + epatch "${FILESDIR}"/${P}-rename-wrappers.patch + sed -i -e 's/pscp/spscp/g;s/pssh/spssh/g' doc/* && \ + mv bin/pssh bin/spssh && \ + mv bin/pscp bin/spscp && \ + mv doc/pscp.1 doc/spscp.1 && \ + mv doc/pssh.1 doc/spssh.1 || die "failed to rename pscp or pssh files" + ewarn "For avoiding conflicts with net-misc/putty and x11-terms/pssh," + ewarn "pscp and pssh scripts have been renamed as spscp respectively spssh." +} + +src_install () { + dobin bin/spssh + dobin bin/spscp + if ! use client-only; then + distutils_src_install + + diropts -o sshproxy -g sshproxy -m0750 + keepdir /var/lib/sshproxy + keepdir /var/log/sshproxy + + # Create a default sshproxy.ini + dodir /etc/sshproxy + insopts -o root -g sshproxy -m0600 + insinto /etc/sshproxy + doins "${FILESDIR}/sshproxy.ini" + local BLOWFISH_SECRET=$(printf "%04hX%04hX%04hX%04hX\n" ${RANDOM} ${RANDOM} ${RANDOM} ${RANDOM}) + sed -i -e "s/%BLOWFISH_SECRET%/${BLOWFISH_SECRET}/" \ + -e "s/%HOSTNAME%/${HOSTNAME}/" \ + "${D}/etc/sshproxy/sshproxy.ini" + + insopts -o sshproxy -g sshproxy -m0600 + rm -rf "${D}/usr/lib/sshproxy/spexpect" + if use minimal; then + local p + for p in acl_funcs console_extra logusers; do + rm -rf "${D}/usr/lib/sshproxy/${p}" + done + else + keepdir /var/log/sshproxy/logusers + { # initialize a reasonable value for the logusers plugin + echo + echo "[logusers]" + echo "logdir = /var/log/sshproxy/logusers" + echo + } >> "${D}/etc/sshproxy/sshproxy.ini" + fi + + # init/conf files for sshproxy daemon + newinitd "${FILESDIR}/sshproxyd.initd" sshproxyd + newconfd "${FILESDIR}/sshproxyd.confd" sshproxyd + + # install manpages + doman doc/spscp.1 + doman doc/spssh.1 + if ! use client-only; then + doman doc/sshproxy.ini.5 + doman doc/sshproxy-setup.8 + doman doc/sshproxyd.8 + fi + + if use mysql; then + insinto /usr/share/sshproxy/mysql_db + doins misc/mysql_db.sql + doins misc/sshproxy-mysql-user.sql + else + rm -rf "${D}/usr/lib/sshproxy/mysql_db" + sed -i -e 's/[ \t]\+mysql//' \ + "${D}/etc/init.d/sshproxyd" + fi + fi +} + +pkg_postinst () { + echo + einfo "Don't forget to set the following environment variables" + einfo " SSHPROXY_HOST (default to localhost)" + einfo " SSHPROXY_PORT (default to 2242)" + einfo " SSHPROXY_USER (default to \$USER)" + einfo "for each sshproxy user." + if ! use client-only; then + distutils_pkg_postinst + + echo + einfo "If this is your first installation, run" + einfo " emerge --config =${CATEGORY}/${PF}" + einfo "to initialize the backend and configure sshproxy." + echo + einfo "There is no need to install sshproxy on a client machine." + einfo "You can connect to a SSH server using this proxy by running" + einfo " ssh -tp PROXY_PORT PROXY_USER@PROXY_HOST -- REMOTE_USER@REMOTE_HOST" + fi +} + +pkg_config() { + if [[ -d "${ROOT}/usr/lib/sshproxy/mysql_db" ]]; then + local PASSWD=$(printf "%04hX%04hX%04hX%04hX\n" ${RANDOM} ${RANDOM} ${RANDOM} ${RANDOM}) + local SHARE="${ROOT}/usr/share/sshproxy/mysql_db" + local DB_HOST DB_PORT + read -p "Enter the MySQL host (default localhost): " DB_HOST + [[ -n "${DB_HOST}" ]] || DB_HOST=localhost + read -p "Enter the MySQL port (default 3306): " DB_PORT + [[ -n "${DB_PORT}" ]] || DB_PORT=3306 + + ewarn "When prompted for a password, enter your MySQL root password" + ewarn + + if mysql -h ${DB_HOST} -P ${DB_PORT} -u root -p <> "${ROOT}/etc/sshproxy/sshproxy.ini" + + sed -i -e 's/^\(\(acl\|client\|site\)_db = \)ini_db/\1mysql_db/g' \ + "${ROOT}/etc/sshproxy/sshproxy.ini" + grep -q "^plugin_list .* mysql_db" \ + "${ROOT}/etc/sshproxy/sshproxy.ini" || \ + sed -i -e 's/^\(plugin_list = .*\)$/\1 mysql_db/g' \ + "${ROOT}/etc/sshproxy/sshproxy.ini" + else + ewarn "Failed to create MySQL database!" + ewarn "If the database already existed and you want to replace it," + ewarn "hit Ctrl-C now and drop the old database by running the command:" + ewarn " /usr/bin/mysqladmin -h ${DB_HOST} -P ${DB_PORT} -u root -p drop sshproxy" + read -p "Hit Ctrl-C to stop the procedure or Enter to continue " key + fi + fi + + INITD_STARTUP="/etc/init.d/sshproxyd start" chroot "${ROOT}" \ + sshproxy-setup -u sshproxy -c /etc/sshproxy +} -- cgit v1.2.3-65-gdbad