# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit webapp depend.php MY_P=Clutch MY_VAR=/var/clutch SOCKET_FILE=${MY_VAR}/clutch/clutch.socket DESCRIPTION="Clutch is a WebUI for the Transmission BitTorrent client." HOMEPAGE="http://clutchbt.com/" SRC_URI="http://clutchbt.com/Files/${MY_P}-${PV}.tar.gz" LICENSE="GPL-2" KEYWORDS="~amd64 ~x86" RDEPEND=">=dev-lang/php-5.2 >=net-p2p/transmission-1" need_php5_httpd pkg_setup () { webapp_pkg_setup local my_flags="sockets json" require_php_with_use ${my_flags} } src_unpack() { unpack ${A} mv ${WORKDIR}/Clutch-0.4/* ${WORKDIR} rm -r ${WORKDIR}/Clutch-0.4/ } src_install() { webapp_src_preinst echo "${SOCKET_FILE}" > remote/data/socket.txt dodoc LICENSE README rm -f *README LICENSE insinto "${MY_HTDOCSDIR}" doins -r . # Change permission for data dir. webapp_serverowned "${MY_HTDOCSDIR}"/remote/data webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt webapp_src_install # Add init script and /var/clutch newinitd "${FILESDIR}"/clutch.init ${PN} dodir "${MY_VAR}" } pkg_postinst() { elog "Edit php.ini if you want to upload torrents via url." elog " allow_url_fopen = on" elog elog "Edit user and group to match webserver userid." elog " nano /etc/init.d/clutch" elog elog "Start deamon." elog " /etc/init/clutch start" elog elog "rc-update add clutch default" elog webapp_pkg_postinst }