1 |
commit: 2d30d59f0307cc388e91fa5945927559f3241728 |
2 |
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 31 12:55:34 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 31 13:01:28 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d30d59f |
7 |
|
8 |
www-misc/shellinabox: turn openssl into a hard dependency and remove ssl USE flag. |
9 |
|
10 |
dev-libs/openssl:0= previously was an optional dependency available through a |
11 |
USE flag but it turns out shellinabox cannot be compiled with SSL support |
12 |
disabled. let's remove the "ssl" USE flag and turn dev-libs/openssl into a hard |
13 |
dependency. |
14 |
|
15 |
Gentoo-Bug: https://bugs.gentoo.org/607528 |
16 |
|
17 |
Package-Manager: portage-2.3.3 |
18 |
|
19 |
www-misc/shellinabox/shellinabox-2.20-r1.ebuild | 108 ++++++++++++++++++++++++ |
20 |
1 file changed, 108 insertions(+) |
21 |
|
22 |
diff --git a/www-misc/shellinabox/shellinabox-2.20-r1.ebuild b/www-misc/shellinabox/shellinabox-2.20-r1.ebuild |
23 |
new file mode 100644 |
24 |
index 00000000..4e0bfce |
25 |
--- /dev/null |
26 |
+++ b/www-misc/shellinabox/shellinabox-2.20-r1.ebuild |
27 |
@@ -0,0 +1,108 @@ |
28 |
+# Copyright 1999-2017 Gentoo Foundation |
29 |
+# Distributed under the terms of the GNU General Public License v2 |
30 |
+# $Id$ |
31 |
+ |
32 |
+EAPI=5 |
33 |
+ |
34 |
+AUTOTOOLS_AUTORECONF="yes" |
35 |
+AUTOTOOLS_IN_SOURCE_BUILD="yes" |
36 |
+ |
37 |
+inherit user autotools-utils systemd |
38 |
+ |
39 |
+DESCRIPTION="Export command line tools to a web based terminal emulator" |
40 |
+HOMEPAGE="https://github.com/shellinabox/shellinabox" |
41 |
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.zip -> ${P}.zip" |
42 |
+ |
43 |
+LICENSE="GPL-2" |
44 |
+SLOT="0" |
45 |
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
46 |
+IUSE="+pam" |
47 |
+ |
48 |
+DEPEND=" |
49 |
+ dev-libs/openssl:0= |
50 |
+ pam? ( virtual/pam )" |
51 |
+ |
52 |
+SIAB_CERT_DIR="/etc/shellinabox/cert" |
53 |
+SIAB_SSL_BASH="${SIAB_CERT_DIR}/gen_ssl_cert.bash" |
54 |
+SIAB_DAEMON="${PN}d" |
55 |
+ |
56 |
+shellinbox_gen_ssl_setup() { |
57 |
+ read -r -d '' SIAB_SSL_SETUP << EOF |
58 |
+cd ${SIAB_CERT_DIR} |
59 |
+openssl genrsa -des3 -out server.key 1024 |
60 |
+openssl req -new -key server.key -out server.csr |
61 |
+cp server.key server.key.org |
62 |
+openssl rsa -in server.key.org -out server.key |
63 |
+openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt |
64 |
+cat server.crt server.key > certificate.pem |
65 |
+EOF |
66 |
+} |
67 |
+ |
68 |
+pkg_setup() { |
69 |
+ enewgroup "${SIAB_DAEMON}" |
70 |
+ enewuser "${SIAB_DAEMON}" -1 -1 -1 "${SIAB_DAEMON}" |
71 |
+} |
72 |
+ |
73 |
+src_configure() { |
74 |
+ local myeconf=( |
75 |
+ --disable-runtime-loading |
76 |
+ --enable-ssl |
77 |
+ ) |
78 |
+ |
79 |
+ econf \ |
80 |
+ $(use_enable pam) \ |
81 |
+ "${myeconf}" |
82 |
+} |
83 |
+ |
84 |
+src_install() { |
85 |
+ emake DESTDIR="${D}" install |
86 |
+ |
87 |
+ # make installs the binary in bin... |
88 |
+ rm -rf "${D}/usr/bin" || die |
89 |
+ |
90 |
+ # ... whereas it should put it in sbin. |
91 |
+ dosbin "${SIAB_DAEMON}" |
92 |
+ |
93 |
+ # Install init+conf files. |
94 |
+ newinitd "${FILESDIR}/${SIAB_DAEMON}.init" "${SIAB_DAEMON}" |
95 |
+ newconfd "${FILESDIR}/${SIAB_DAEMON}.conf" "${SIAB_DAEMON}" |
96 |
+ |
97 |
+ # Install systemd unit files |
98 |
+ systemd_dounit "${FILESDIR}"/shellinaboxd.service |
99 |
+ |
100 |
+ # Install CSS files. |
101 |
+ insinto "/usr/share/${PN}-resources" |
102 |
+ doins -r "${PN}"/*.css |
103 |
+ |
104 |
+ # Create directory where SSL certificates will be generated. |
105 |
+ dodir "${SIAB_CERT_DIR}" |
106 |
+ fowners "${SIAB_DAEMON}:${SIAB_DAEMON}" "${SIAB_CERT_DIR}" |
107 |
+ |
108 |
+ # Generate set up variable. |
109 |
+ shellinbox_gen_ssl_setup |
110 |
+ |
111 |
+ # Dump it in a bash script. |
112 |
+ echo "#!/usr/bin/env bash" > "${D}/${SIAB_SSL_BASH}" || die |
113 |
+ echo "${SIAB_SSL_SETUP}" >> "${D}/${SIAB_SSL_BASH}" || die |
114 |
+ chmod +x "${D}/${SIAB_SSL_BASH}" || die |
115 |
+} |
116 |
+ |
117 |
+pkg_postinst() { |
118 |
+ ewarn |
119 |
+ ewarn "The default configuration exposes a login shell" |
120 |
+ ewarn "with SSL disabled on the localhost interface only." |
121 |
+ ewarn |
122 |
+ |
123 |
+ shellinbox_gen_ssl_setup |
124 |
+ |
125 |
+ einfo |
126 |
+ einfo "To generate self-signed SSL certificates" |
127 |
+ einfo "please read the procedure explained here:" |
128 |
+ einfo "https://code.google.com/p/shellinabox/issues/detail?id=59#c15" |
129 |
+ einfo |
130 |
+ einfo "${SIAB_SSL_SETUP}" |
131 |
+ einfo |
132 |
+ einfo "This walkthrough has been written in ${SIAB_SSL_BASH} for your convenience." |
133 |
+ einfo "Make sure to execute this script." |
134 |
+ einfo |
135 |
+} |