# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils linux-info EAPI=3 DESCRIPTION="Handler for rfkill events in userspace" HOMEPAGE="http://www.freedesktop.org/wiki/Software/urfkill" SRC_URI="https://github.com/downloads/lcp/${PN}/${PF}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="doc nls static-libs test X" DEPEND="sys-fs/udev dev-libs/glib:2 sys-apps/dbus dev-libs/dbus-glib sys-auth/polkit dev-libs/expat doc? ( dev-util/gtk-doc ) nls? ( sys-devel/gettext dev-util/intltool )" RDEPEND="${DEPEND} dev-util/pkgconfig" pkg_setup() { CONFIG_CHECK="~RFKILL" linux-info_pkg_setup } src_configure() { # No man pages for now, even if requested during ./configure. econf \ $(use_enable doc gtk-doc) \ $(use_enable nls) \ $(use_enable static-libs static) \ $(use_enable test tests) || die "econf failed" } src_install() { emake DESTDIR="${D}" install || die "emake install failed" if use X; then insinto /etc/xdg/autostart doins "${FILESDIR}"/urfkill-startup.desktop insinto /usr/bin doins "${FILESDIR}"/ping-urfkilld fperms a+x /usr/bin/ping-urfkilld fi newinitd "${FILESDIR}"/urfkilld.rc urfkilld dodoc AUTHORS NEWS README } pkg_postinst() { echo einfo "If you prefer to set an unprivileged user, check" einfo "'user' variable in /etc/urfkill/urfkill.conf" echo if use X; then einfo "Startup script has been placed in /usr/bin/ping-urfkilld," einfo "so there's no need to execute it with init script." echo fi }