# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic EAPI="2" DESCRIPTION="An Open Source MQTT v3 Broker" HOMEPAGE="http://mosquitto.atchoo.org/" SRC_URI="http://mosquitto.atchoo.org/files/source/rc/${P/_/~}.tar.gz" S="${WORKDIR}/${P/_/~}" 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() { if use tcpd ; then sed -i 's/\(^LDFLAGS=.*\)/\1 -lwrap/' config.mk 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}" prefix=/usr || die "Install failed" dodir /var/lib/mosquitto dodoc readme.txt ChangeLog.txt || die "dodoc failed" doinitd "${FILESDIR}"/mosquitto dosed "s:^#persistence 0$:persistence 1:" /etc/mosquitto.conf dosed "s:^#persistence_location:persistence_location /var/lib/mosquitto/:" /etc/mosquitto.conf } pkg_setup() { enewuser mosquitto } pkg_postinst() { chown mosquitto: /var/lib/mosquitto elog "To start mosquitto at boot, add it to the default runlevel with:" elog "" elog " rc-update add mosquitto default" }