diff --git a/sys-block/3dm2/3dm2-10.2.1.ebuild b/sys-block/3dm2/3dm2-10.2.1.ebuild new file mode 100644 index 0000000..9c29482 --- /dev/null +++ b/sys-block/3dm2/3dm2-10.2.1.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="3" + +inherit eutils + +MY_REV=9.5.4 +MY_SRC='http://www.lsi.com/channel/support/pages/downloads.aspx?k=*&r=productfamily="AQUzd2FyZQ1wcm9kdWN0ZmFtaWx5AQFeASQ="%20os="AQVMaW51eAJvcwEBXgEk"%20assettype="AQhTb2Z0d2FyZQlhc3NldHR5cGUBAV4BJA=="' +MY_ARCH="${ARCH/amd64/x86_64}" + +DESCRIPTION="3ware Disk Managment web utility and RAID controller CLI tool" +HOMEPAGE="http://www.lsi.com/" +SRC_URI="3DM2_CLI-Linux_${PV}_${MY_REV}.zip" + +LICENSE="LSI" +SLOT="0" +KEYWORDS="amd64 ~x86" +IUSE="cli +web" + +RESTRICT="mirror fetch" +PROPERTIES="interactive" + +RDEPEND="virtual/libc + virtual/logger + virtual/mta" + +DEPEND="cli? ( !sys-block/tw_cli )" + +S=${WORKDIR} + +pkg_nofetch() { + einfo "This software can no longer be automatically downloaded." + echo + einfo "Please manually download the following file:" + einfo "3DM2 CLI Linux from the ${PV}/${MY_REV} code set - non-java based installer" + echo + einfo "from the following URL:" + einfo "${MY_SRC}" + echo + einfo "and move to: ${DISTDIR}/${SRC_URI}" +} + +pkg_setup() { + # Validate USE flags + if (! use cli && ! use web); then + ewarn + ewarn "You must specify at least one USE flag for this package." + ewarn + die "No USE flags enabled." + fi + + # Display some supplimental information about controller support + echo + einfo "This binary supports should support all 3ware controllers, including:" + einfo "PATA: 6xxx, 72xx, 74xx, 78xx, 7000, 7500, 7506" + einfo "SATA: 8006, 8500, 8506, 9500S, 9550SX, 9590SE" + einfo " 9550SXU, 9650SE, 9690SA" + echo +} + +src_unpack() { + unpack ${A} + tar zxf tdmCliLnx.tgz + mkdir help msg + tar zxf tdm2Help.tgz -C help + tar zxf tdm2Msg.tgz -C msg +} + +src_prepare() { + # update conf paths for Gentoo standards + sed -i -e 's;MsgPath /opt/3ware/3DM2/msg;MsgPath /usr/share/3dm2/msg;' \ + -e 's;Help /opt/3ware/3DM2/help;Help /usr/share/3dm2/help;' \ + -e 's;imgPath /etc/3dm2;imgPath /usr/share/3dm2;' \ + 3dm2.conf || die "sed update 3dm2.conf" +} + +src_install() { + if use web; then + newsbin "3dm2.${MY_ARCH}" ${PN} || die "dosbin 3dm2.${MY_ARCH}" + + dodir /etc/${PN} + insinto /etc/${PN} + doins 3dm2.conf || die "doins 3dm2.conf" + + insinto /usr/share/${PN} + doins logo.gif || die "doins logo.gif" + doins -r help || die "doins help" + doins -r msg || die "doins msg" + + newinitd "${FILESDIR}/${PN}.init" ${PN} || die "newinitd 3dm2.init" + fi + + if use cli; then + newsbin tw_cli.${MY_ARCH} tw_cli || die "dosbin tw_cli.${MY_ARCH}" + newman tw_cli.8.nroff tw_cli.8 + dodoc tw_cli.8.html + fi + + dodoc LGPL_License.txt OpenSSL.txt +} + +pkg_preinst() { + RESTART=0 + if use web; then + if [ $(pgrep 3dm2 >/dev/null; echo $?) -eq 0 ]; then + /etc/init.d/${PN} stop + RESTART=1 + fi + fi +} + +pkg_postinst() { + if [ ${RESTART} -eq 0 ]; then + echo + einfo "Start 3dm2, then connect to the server at https://localhost:888/" + einfo "Default password for both user and administrator is: 3ware" + einfo "Note that remote access is *enabled* by default." + einfo + einfo "To change the ssl cert, place a file called 3dm2.pem in /etc/3dm2" + einfo "It must contain the certificate and the key." + einfo "Under normal circumstances you don't need to change it." + else + echo + ewarn "Note: 3dm2 was automatically stopped to complete this upgrade." + ewarn "You should restart it now with: /etc/init.d/${PN} start" + fi + echo +} + diff --git a/sys-block/3dm2/Manifest b/sys-block/3dm2/Manifest new file mode 100644 index 0000000..7ecc1d0 --- /dev/null +++ b/sys-block/3dm2/Manifest @@ -0,0 +1,3 @@ +AUX 3dm2.init 446 RMD160 2d21c023eb042b9cfaa5b43cf71bbd89e384d29e SHA1 d7fad995ad624e25368443ea2aa40d6dc8ca539e SHA256 2169fee591d9603d8618a27c8c5b9ca1c03d8858027a9f632775fd12584a0c2a +DIST 3DM2_CLI-Linux_10.2.1_9.5.4.zip 10393953 RMD160 9f6465a050cfa200ecfd5459b26e96e2d64d93e9 SHA1 0c26051fdcbed446bd0eded9b1fc789be514bec1 SHA256 bf6ba7f083f806011b6fc73522f527893bdee87dad746553f2f071507ead7734 +EBUILD 3dm2-10.2.1.ebuild 3388 RMD160 0a978bbae3dd61010f5b572f773cce687430b615 SHA1 effc1a2e82670268a2d69dd94c039fb686b488d7 SHA256 f63c675237bed6841c816ae9f9e0b2f54602ea348cb06fe0caa136c7c1b77a61 diff --git a/sys-block/3dm2/files/3dm2.init b/sys-block/3dm2/files/3dm2.init new file mode 100644 index 0000000..0984470 --- /dev/null +++ b/sys-block/3dm2/files/3dm2.init @@ -0,0 +1,22 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header$ + +depend() { + need net +} + +start() { + ebegin "Starting 3dm2" + start-stop-daemon --start --quiet --exec /usr/sbin/3dm2 + eend ${?} +} + +stop() { + ebegin "Stopping 3dm2" + start-stop-daemon --stop --quiet --name 3dm2 + [ "$RETVAL" == 2 ] && return 2 + start-stop-daemon --stop --quiet --name 3dm2 + eend ${?} +}