summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Albertson <ramereth@gentoo.org>2009-08-23 01:34:36 +0000
committerLance Albertson <ramereth@gentoo.org>2009-08-23 01:34:36 +0000
commit8c7082e794f97b279b0e14a55be9436ae1145375 (patch)
tree5f3c21d17954311f306bbc3fe04941bfc420f876 /net-misc/stunnel
parentremove unused patches (diff)
downloadhistorical-8c7082e794f97b279b0e14a55be9436ae1145375.tar.gz
historical-8c7082e794f97b279b0e14a55be9436ae1145375.tar.bz2
historical-8c7082e794f97b279b0e14a55be9436ae1145375.zip
Fix init script for #107484 & #102179 (chroot & multiple instance support)
Package-Manager: portage-2.1.6.13/cvs/Linux x86_64
Diffstat (limited to 'net-misc/stunnel')
-rw-r--r--net-misc/stunnel/ChangeLog10
-rw-r--r--net-misc/stunnel/Manifest14
-rw-r--r--net-misc/stunnel/files/stunnel.initd68
-rw-r--r--net-misc/stunnel/stunnel-4.27-r1.ebuild75
4 files changed, 155 insertions, 12 deletions
diff --git a/net-misc/stunnel/ChangeLog b/net-misc/stunnel/ChangeLog
index 90cf84272293..8d7b4305e308 100644
--- a/net-misc/stunnel/ChangeLog
+++ b/net-misc/stunnel/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-misc/stunnel
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/ChangeLog,v 1.103 2009/08/09 09:20:52 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/ChangeLog,v 1.104 2009/08/23 01:34:35 ramereth Exp $
+
+*stunnel-4.27-r1 (22 Aug 2009)
+
+ 22 Aug 2009; Lance Albertson <ramereth@gentoo.org>
+ +stunnel-4.27-r1.ebuild, +files/stunnel.initd:
+ Clean up & fix init script to fix #107484. Additionally, add multiple
+ stunnel instance support to fix #102179. Most of the init script ideas
+ were modeled from the ubuntu stunnel4 script.
09 Aug 2009; Ulrich Mueller <ulm@gentoo.org> +stunnel-3.26.ebuild,
-files/stunnel-4.21-setuid.patch:
diff --git a/net-misc/stunnel/Manifest b/net-misc/stunnel/Manifest
index 104a26f938bd..3115f749b8fa 100644
--- a/net-misc/stunnel/Manifest
+++ b/net-misc/stunnel/Manifest
@@ -1,22 +1,14 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX stunnel-3.26-gentoo.diff 941 RMD160 4ca4f85a8888c7c9dbeed9d1303bae182d19195d SHA1 5517c6e3395664d76c84548ea67ffd8fddddbdcd SHA256 e2a9fab361699b01ccd004ef598bb868d5f6f37bd40d05b7a16a97cd9ecee2f2
AUX stunnel-4.21-libwrap.patch 380 RMD160 c5ed7c06c3612bc5930ca8c77cac8bf58ec403f3 SHA1 fa1bf6674f775fa1b5934f4707c9e7eafed0d8a9 SHA256 b22f56707b96df785ebc20b48faf9761fb52cf4a362be875c60071b0d4572be1
AUX stunnel.conf 1423 RMD160 606c53b0e241e44c8aabe423ca6772dc76aa69a9 SHA1 0b18a6dea836abc3c224c367f9ebd6fa30b931f2 SHA256 be8deb0e051f594e14c898c2ec8a4a6879adcd48a56286093653346d12c3f105
+AUX stunnel.initd 1750 RMD160 c60143c7977b5b0dcd26da436a9200c2c78fe2fa SHA1 02d23737a8552b561acb8aae56354bd4d7b317e8 SHA256 dcc512265c1ce497bdf0e64ba582fe8affe1612ea9935bb3cbd4606942b20475
AUX stunnel.rc6 779 RMD160 3cb0ba8b6f90484a9cec951e3eb36eef45169f6d SHA1 7de8dc829e271b3ed248e3b44afb9b537621cc02 SHA256 b2128e3bfe38485ef4afad35b57d8711666281087f3fcf920d5d313642e06dea
DIST stunnel-3.26.tar.gz 228923 RMD160 63347b6bc6fca1496d74a8ef234eea98a45e0b04 SHA1 0d40d268a9e4b63630312cdee4efa5ecba53c9ec SHA256 d2a55b089d46d14bc4b456bb1927303492dab6649867c67a005d2c9d1ededfb3
DIST stunnel-4.25.tar.gz 532343 RMD160 dcb9962e5273e69f5aeaed6bf709495aa97baa52 SHA1 fc6d61fad996f750c76ea627c5dd9f789af0eaf6 SHA256 9c966a18124ad2c28773fe096b767071320bdb07db69f480df36cbca80069480
DIST stunnel-4.27.tar.gz 538604 RMD160 a0beb4dffbc40c5c4452af767840d6fa703868c9 SHA1 2daf52fb0906de9fc5bd6a270e620e9316034fd4 SHA256 c260a6544a39c3cff59626ca6bc7c14087dc4d4fab95c6cddd7dddd81df87cfb
EBUILD stunnel-3.26.ebuild 742 RMD160 828bcad3275266e52a5036f6670e0612c90e926a SHA1 84966259d3b71ddfce3ffec4b2ee14d43811fd81 SHA256 ab1b1e4697849381ed5acc09728dd07457674148a4864091eec747918b16b5ee
EBUILD stunnel-4.25.ebuild 2375 RMD160 d8e2adf5aa30389a5c6f1ea3b59cccb3e88e2581 SHA1 cab4724bd91dc869cc4df296165804f6d9b57398 SHA256 98457e8a9921a07480aad95e2cd921e96cef87ef60c0e7a4b97f57bf641c63bf
+EBUILD stunnel-4.27-r1.ebuild 2230 RMD160 c655398eb8a9198fedf5359c48c14259d8eaf66f SHA1 4fda271342889c711092d480e85820cd0519aecd SHA256 b5351205411db9cc3e7e61180a641da5c3dd2da7e0050b1009796793fc14fa1c
EBUILD stunnel-4.27.ebuild 2390 RMD160 319d6b740f7e086a5d4fcb4181dc2d6c6b86031c SHA1 abc19ccd0e243f36483f2612f6669e456a32f54d SHA256 51f64f5a5c7bc44a19e62fae2bb54aaa575d80a1dced42a7a2b1bf6003629d90
-MISC ChangeLog 14587 RMD160 c729330a73187d79e44d104dc707bbcf525dad0a SHA1 623c2f5809730bdccff0ae2e9fd0a1fde3e4ee0f SHA256 008f5e02b80a7b0780ffa6a0baa9ed146c712d889e6d3737714da44b4a86702a
+MISC ChangeLog 14921 RMD160 e9b60add4a954561690c405581f81cb21460a5cb SHA1 62334460f8a57b52d69359cfddb4b6849ac3a8ee SHA256 712be9b1a24bbfb997fff10fcfc6a9f3bda18d4031186ab3fee427ef60ee2aa8
MISC metadata.xml 641 RMD160 7ad264c22b9e0705cf00b7985eee8d23c3383310 SHA1 c9314118d8fbc0644eb690f56f9d8859d3f7c578 SHA256 16e547775081b652662ac7156f0b6cfb7d1b8165865416cd154047c9ea6abebb
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.9 (GNU/Linux)
-
-iEYEARECAAYFAkp+lXMACgkQOeoy/oIi7uzSrwCg2/edd5kE/jJnVHmogAsd+Bpq
-eUIAn2t3vwISSyxW/swxEpvrDPK0TywA
-=Ijql
------END PGP SIGNATURE-----
diff --git a/net-misc/stunnel/files/stunnel.initd b/net-misc/stunnel/files/stunnel.initd
new file mode 100644
index 000000000000..8a31e3db858a
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel.initd
@@ -0,0 +1,68 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Default pidfile location
+DEFAULT_PIDFILE="/var/run/stunnel/stunnel.pid"
+FILES="/etc/stunnel/*.conf"
+DAEMON="/usr/sbin/stunnel"
+
+depend() {
+ need net
+ before logger
+}
+
+get_pids() {
+ local file=${1}
+ if test -f ${file} ; then
+ CHROOT=$(grep "^chroot" ${file} | sed "s;.*= *;;")
+ PIDFILE=$(grep "^pid" ${file} | sed "s;.*= *;;")
+ if [ "${PIDFILE}" == "" ] ; then
+ PIDFILE="${DEFAULT_PIDFILE}"
+ fi
+ if test -f ${CHROOT}/${PIDFILE} ; then
+ cat ${CHROOT}/${PIDFILE}
+ fi
+ fi
+}
+
+start() {
+ rm -rf /var/run/stunnel/*.pid
+ ebegin "Starting stunnel"
+ for file in ${FILES} ; do
+ if test -f "${file}" ; then
+ ARGS="${file} ${STUNNEL_OPTIONS}"
+ PROCLIST="$(get_pids ${file})"
+ CHROOT=$(grep "^chroot" ${file} | sed "s;.*= *;;")
+ PIDFILE=$(grep "^pid" ${file} | sed "s;.*= *;;")
+ if [ "${PROCLIST}" ] && kill -0 ${PROCLIST} 2> /dev/null ; then
+ ewarn " already running: ${file} "
+ elif ${DAEMON} ${ARGS} ; then
+ if test -f ${CHROOT}/${PIDFILE} ; then
+ einfo " ${file}"
+ else
+ eerror " error starting: ${file}"
+ fi
+ fi
+ fi
+ done
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping stunnel"
+ for file in ${FILES} ; do
+ PROCLIST=$(get_pids ${file})
+ if [ "${PROCLIST}" ] && kill -0 ${PROCLIST} 2> /dev/null ; then
+ kill ${PROCLIST}
+ einfo " ${file} "
+ fi
+ done
+ eend $?
+}
+
+restart() {
+ stop
+ sleep 1
+ start
+}
diff --git a/net-misc/stunnel/stunnel-4.27-r1.ebuild b/net-misc/stunnel/stunnel-4.27-r1.ebuild
new file mode 100644
index 000000000000..f44809269e42
--- /dev/null
+++ b/net-misc/stunnel/stunnel-4.27-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/stunnel-4.27-r1.ebuild,v 1.1 2009/08/23 01:34:35 ramereth Exp $
+
+inherit autotools ssl-cert eutils
+
+DESCRIPTION="TLS/SSL - Port Wrapper"
+HOMEPAGE="http://stunnel.mirt.net/"
+SRC_URI="http://www.stunnel.org/download/stunnel/src/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="ipv6 selinux tcpd"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+ >=dev-libs/openssl-0.9.8k"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-stunnel )"
+
+pkg_setup() {
+ enewgroup stunnel
+ enewuser stunnel -1 -1 -1 stunnel
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${PN}-4.21-libwrap.patch"
+ eautoreconf
+
+ # Hack away generation of certificate
+ sed -i -e "s/^install-data-local:/do-not-run-this:/" \
+ tools/Makefile.in || die "sed failed"
+}
+
+src_compile() {
+ econf $(use_enable ipv6) \
+ $(use_enable tcpd libwrap) || die "econf died"
+ emake || die "emake died"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ rm -rf "${D}"/usr/share/doc/${PN}
+ rm -f "${D}"/etc/stunnel/stunnel.conf-sample "${D}"/usr/bin/stunnel3 \
+ "${D}"/usr/share/man/man8/stunnel.{fr,pl}.8
+
+ # The binary was moved to /usr/bin with 4.21,
+ # symlink for backwards compatibility
+ dosym ../bin/stunnel /usr/sbin/stunnel
+
+ dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog doc/en/transproxy.txt
+ dohtml doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
+ tools/importCA.html
+
+ insinto /etc/stunnel
+ doins "${FILESDIR}"/stunnel.conf
+ newinitd "${FILESDIR}"/stunnel.initd stunnel
+
+ keepdir /var/run/stunnel
+ fowners stunnel:stunnel /var/run/stunnel
+}
+
+pkg_postinst() {
+ if [ ! -f "${ROOT}"/etc/stunnel/stunnel.key ]; then
+ install_cert /etc/stunnel/stunnel
+ chown stunnel:stunnel "${ROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ chmod 0640 "${ROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ fi
+
+ einfo "If you want to run multiple instances of stunnel, create a new config"
+ einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
+ einfo "\'pid= \' with a unique filename."
+}