# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils EAPI="2" DESCRIPTION="An Open Source MQTT v3 Broker" HOMEPAGE="http://mosquitto.atchoo.org/" SRC_URI="http://mosquitto.atchoo.org/files/source/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="tcpd pcre" RDEPEND="dev-db/sqlite:3 pcre? ( dev-db/sqlite3-pcre ) tcpd? ( sys-apps/tcp-wrappers )" DEPEND="${RDEPEND}" src_configure() { sed -i s:prefix=/usr/local:prefix=/usr: config.mk if use tcpd ; then sed -i 's/^\/\/#define WITH_WRAP/#define WITH_WRAP/' config.h fi if ! use pcre ; then sed -i /WITH_REGEX/d config.h fi } src_install() { emake install DESTDIR="${D}" || die "Install failed" mv "${D}"/usr/local/bin "${D}"/usr/bin rmdir "${D}"/usr/local dodoc readme.txt ChangeLog.txt || die "dodoc failed" doinitd "${FILESDIR}"/mosquitto } pkg_setup() { enewuser mosquitto } pkg_postinst() { elog "To start mosquitto at boot, add it to the default runlevel with:" elog "" elog " rc-update add mosquitto default" }