From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 17E42138334 for ; Sun, 22 Dec 2019 04:48:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EAC25E0991; Sun, 22 Dec 2019 04:48:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7C038E0991 for ; Sun, 22 Dec 2019 04:48:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CF8B934DA5E for ; Sun, 22 Dec 2019 04:48:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0A77F97A for ; Sun, 22 Dec 2019 04:48:01 +0000 (UTC) From: "Craig Andrews" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Craig Andrews" Message-ID: <1576990075.da418d0d9abe70ba56806ee12e057b390ef5a81a.candrews@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-misc/shellinabox/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-misc/shellinabox/shellinabox-2.20-r4.ebuild X-VCS-Directories: www-misc/shellinabox/ X-VCS-Committer: candrews X-VCS-Committer-Name: Craig Andrews X-VCS-Revision: da418d0d9abe70ba56806ee12e057b390ef5a81a X-VCS-Branch: master Date: Sun, 22 Dec 2019 04:48:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: eb2e00fe-01c7-4fa9-b2cd-5069088c2acd X-Archives-Hash: 23d104ec009a5d9d2981898a867257c2 commit: da418d0d9abe70ba56806ee12e057b390ef5a81a Author: Craig Andrews gentoo org> AuthorDate: Wed Dec 18 21:58:54 2019 +0000 Commit: Craig Andrews gentoo org> CommitDate: Sun Dec 22 04:47:55 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da418d0d www-misc/shellinabox: GLEP 81 user/group management Package-Manager: Portage-2.3.82, Repoman-2.3.20 Signed-off-by: Craig Andrews gentoo.org> www-misc/shellinabox/shellinabox-2.20-r4.ebuild | 108 ++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/www-misc/shellinabox/shellinabox-2.20-r4.ebuild b/www-misc/shellinabox/shellinabox-2.20-r4.ebuild new file mode 100644 index 00000000000..dd3929f75bf --- /dev/null +++ b/www-misc/shellinabox/shellinabox-2.20-r4.ebuild @@ -0,0 +1,108 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools systemd + +DESCRIPTION="Export command line tools to a web based terminal emulator" +HOMEPAGE="https://github.com/shellinabox/shellinabox" +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +IUSE="+pam" + +RDEPEND=" + acct-user/shellinaboxd + acct-group/shellinaboxd" + +DEPEND=" + ${RDEPEND} + dev-libs/openssl:0= + pam? ( sys-libs/pam )" + +SIAB_CERT_DIR="/etc/shellinabox/cert" +SIAB_SSL_BASH="${SIAB_CERT_DIR}/gen_ssl_cert.bash" +SIAB_DAEMON="${PN}d" + +shellinbox_gen_ssl_setup() { + read -r -d '' SIAB_SSL_SETUP << EOF +cd ${SIAB_CERT_DIR} +openssl genrsa -des3 -out server.key 1024 +openssl req -new -key server.key -out server.csr +cp server.key server.key.org +openssl rsa -in server.key.org -out server.key +openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt +cat server.crt server.key > certificate.pem +EOF +} + +src_prepare() { + default + eautoreconf +} + +src_configure() { + local myeconf=( + --disable-runtime-loading + --enable-ssl + ) + + econf \ + $(use_enable pam) \ + "${myeconf[@]}" +} + +src_install() { + emake DESTDIR="${D}" install + + # make installs the binary in bin... + rm -rf "${D}/usr/bin" || die + + # ... whereas it should put it in sbin. + dosbin "${SIAB_DAEMON}" + + # Install init+conf files. + newinitd "${FILESDIR}/${SIAB_DAEMON}.init" "${SIAB_DAEMON}" + newconfd "${FILESDIR}/${SIAB_DAEMON}.conf" "${SIAB_DAEMON}" + + # Install systemd unit file. + systemd_dounit "${FILESDIR}"/shellinaboxd.service + + # Install CSS files. + insinto "/usr/share/${PN}-resources" + doins -r "${PN}"/*.css + + # Create directory where SSL certificates will be generated. + dodir "${SIAB_CERT_DIR}" + + # Generate set up variable. + shellinbox_gen_ssl_setup + + # Dump it in a bash script. + echo "#!/usr/bin/env bash" > "${D}/${SIAB_SSL_BASH}" || die + echo "${SIAB_SSL_SETUP}" >> "${D}/${SIAB_SSL_BASH}" || die + chmod +x "${D}/${SIAB_SSL_BASH}" || die +} + +pkg_postinst() { + ewarn + ewarn "The default configuration exposes a login shell" + ewarn "with SSL disabled on the localhost interface only." + ewarn + + shellinbox_gen_ssl_setup + + einfo + einfo "To generate self-signed SSL certificates" + einfo "please read the procedure explained here:" + einfo "https://code.google.com/p/shellinabox/issues/detail?id=59#c15" + einfo + einfo "${SIAB_SSL_SETUP}" + einfo + einfo "This walkthrough has been written in ${SIAB_SSL_BASH} for your convenience." + einfo "Make sure to execute this script." + einfo +}