diff options
Diffstat (limited to 'app-laptop')
-rw-r--r-- | app-laptop/prey/ChangeLog | 10 | ||||
-rw-r--r-- | app-laptop/prey/files/prey-0.5.4-cron-functions.patch | 28 | ||||
-rw-r--r-- | app-laptop/prey/files/prey-0.5.4-gtk-ui.patch | 22 | ||||
-rw-r--r-- | app-laptop/prey/prey-0.5.4.ebuild | 156 |
4 files changed, 214 insertions, 2 deletions
diff --git a/app-laptop/prey/ChangeLog b/app-laptop/prey/ChangeLog index 5eaf4ac040aa..2b4548383c52 100644 --- a/app-laptop/prey/ChangeLog +++ b/app-laptop/prey/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-laptop/prey # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-laptop/prey/ChangeLog,v 1.4 2012/06/01 00:22:28 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-laptop/prey/ChangeLog,v 1.5 2012/07/19 21:42:45 hwoarang Exp $ + +*prey-0.5.4 (19 Jul 2012) + + 19 Jul 2012; Markos Chandras <hwoarang@gentoo.org> + +files/prey-0.5.4-cron-functions.patch, +files/prey-0.5.4-gtk-ui.patch, + +prey-0.5.4.ebuild: + Version bump 01 Jun 2012; Zac Medico <zmedico@gentoo.org> prey-0.5.3.ebuild: inherit user for enewgroup @@ -18,4 +25,3 @@ +files/prey.cron, +files/prey-cron-functions.patch, +metadata.xml: Initial commit. Thanks to Travis Hansen <travisghansen@yahoo.com> and Thomas Kear <thomas.kear@gmail.com> for the ebuilds. Bug #305813 - diff --git a/app-laptop/prey/files/prey-0.5.4-cron-functions.patch b/app-laptop/prey/files/prey-0.5.4-cron-functions.patch new file mode 100644 index 000000000000..963b685292c7 --- /dev/null +++ b/app-laptop/prey/files/prey-0.5.4-cron-functions.patch @@ -0,0 +1,28 @@ +Index: prey/core/functions +=================================================================== +--- prey.orig/core/functions ++++ prey/core/functions +@@ -194,12 +194,12 @@ get_delay_for(){ + + get_current_delay(){ + # crontab -l | grep prey | sed "s/^..\([0-9]*\).*/\1/" +- crontab -l 2> /dev/null | grep prey | head -1 | sed 's/ \/.*//' ++ sed -i 's/ \/.*//' /etc/cron.d/prey.cron + } + + update_execution_delay(){ + local full_path=$(full_path "$base_path") +- (crontab -l 2> /dev/null | grep -v prey; echo "${1}" "${full_path}/prey.sh > /var/log/prey.log 2>&1") | crontab - ++ echo "${new_delay}" "/usr/bin/prey.sh > /var/log/prey.log" > /etc/cron.d/prey.cron + } + + # if device is missing we'll make sure the current delay matches the one +@@ -273,7 +273,7 @@ verify_installation(){ + log " !! Cron daemon not found! Try running it with 'sudo /etc/init.d/cron start'." + fi + log " -- Checking for crontab entry..." +- local result=`crontab -l | grep 'prey.sh' | wc -l 2> /dev/null` ++ local result=`wc -l /etc/cron.d/prey.cron 2> /dev/null` + if [ "$result" -gt 0 ]; then + log " -- Found!" + else diff --git a/app-laptop/prey/files/prey-0.5.4-gtk-ui.patch b/app-laptop/prey/files/prey-0.5.4-gtk-ui.patch new file mode 100644 index 000000000000..6a50a4e0426e --- /dev/null +++ b/app-laptop/prey/files/prey-0.5.4-gtk-ui.patch @@ -0,0 +1,22 @@ +Index: prey/platform/linux/prey-config.py +=================================================================== +--- prey.orig/platform/linux/prey-config.py ++++ prey/platform/linux/prey-config.py +@@ -23,7 +23,7 @@ import base64 + + app_name = 'prey-config' + lang_path = 'lang' +-script_path = os.sys.path[0] ++script_path = '/usr/share/prey/platform/linux/' + + ################################################ + # gettext localization +@@ -42,7 +42,7 @@ _ = gettext.gettext + ################################################ + + PREY_PATH = '/usr/share/prey' +-PREY_CONFIG_FILE = PREY_PATH + '/config' ++PREY_CONFIG_FILE = '/etc/config' + PREY_COMMAND = PREY_PATH + '/prey.sh > /var/log/prey.log 2>&1' + CONTROL_PANEL_URL = 'http://control.preyproject.com' + CONTROL_PANEL_URL_SSL = 'https://control.preyproject.com' diff --git a/app-laptop/prey/prey-0.5.4.ebuild b/app-laptop/prey/prey-0.5.4.ebuild new file mode 100644 index 000000000000..3c9bf470c6cd --- /dev/null +++ b/app-laptop/prey/prey-0.5.4.ebuild @@ -0,0 +1,156 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-laptop/prey/prey-0.5.4.ebuild,v 1.1 2012/07/19 21:42:45 hwoarang Exp $ + +EAPI=4 + +inherit eutils user + +DESCRIPTION="Tracking software for asset recovery" +HOMEPAGE="http://preyproject.com/" +SRC_URI="http://preyproject.com/releases/${PV}/${P}-linux.zip" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="gtk userpriv" + +LINGUAS="en it sv es" +for x in ${LINGUAS}; do + IUSE="${IUSE} linguas_${x}" +done + +MODULES="+alarm +alert +geo lock +network secure +session webcam" +IUSE="${IUSE} ${MODULES}" + +DEPEND="" +#TODO: some of these deps may be dependent on USE +RDEPEND="${DEPEND} + app-shells/bash + virtual/cron + || ( net-misc/curl net-misc/wget ) + dev-perl/IO-Socket-SSL + dev-perl/Net-SSLeay + sys-apps/net-tools + alarm? ( media-sound/mpg123 + media-sound/pulseaudio + ) + alert? ( || ( ( gnome-extra/zenity ) ( kde-base/kdialog ) ) ) + gtk? ( dev-python/pygtk ) + lock? ( dev-python/pygtk ) + network? ( net-analyzer/traceroute ) + session? ( sys-apps/iproute2 + || ( media-gfx/scrot media-gfx/imagemagick ) + ) + webcam? ( || ( ( media-video/mplayer[encode,jpeg,v4l] ) ( media-tv/xawtv ) ) )" + +S=${WORKDIR}/${PN} + +pkg_setup() { + if use userpriv; then + enewgroup ${PN} + fi + if use gtk; then + ewarn "You have the 'gtk' useflag enabled" + ewarn "This means that the ${PN} configuration" + ewarn "will be accessible via a graphical user" + ewarn "interface. This may allow the thief to alter" + ewarn "or disable the ${PN} functionality" + fi + + # remove system module since it depends on hal and we don't + # have hal in portage anymore + rm -rf "${S}"/modules/system || die +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-cron-functions.patch \ + "${FILESDIR}"/${P}-gtk-ui.patch \ + "${FILESDIR}"/${PN}-0.5.3-mplayer-support.patch + sed -i -e 's,readonly base_path=`dirname "$0"`,readonly \ + base_path="/usr/share/prey",' \ + "${S}"/prey.sh || die +} + +src_install() { + # Remove config app if -gtk + if use gtk; then + # fix the path + doicon "${S}"/pixmaps/${PN}.png + newbin "${S}"/platform/linux/${PN}-config.py ${PN}-config + make_desktop_entry ${PN}-config "Prey Configuration" ${PN} \ + "System;Monitor" + else + rm -f "${S}"/platform/linux/prey-config.py || die + fi + + # clear out unneeded language files + for lang in ${LINGUAS}; do + use "linguas_${lang}" || rm -f lang/${lang} modules/*/lang/${lang} + done + + # Core files + insinto /usr/share/prey + doins -r "${S}"/core "${S}"/lang "${S}"/pixmaps "${S}"/platform "${S}"/version + + # Main script + newbin ${PN}.sh ${PN} + + # Put the configuration file into /etc, strict perms, symlink + insinto /etc/prey + newins config ${PN}.conf + # some scripts require /usr/share/prey/config file to be present + # so symlink it to prey.conf + dosym /etc/${PN}/${PN}.conf /usr/share/${PN}/config + use userpriv && { fowners root:${PN} /etc/prey ; } + fperms 770 /etc/prey + use userpriv && { fowners root:${PN} /etc/prey/prey.conf ; } + fperms 660 /etc/prey/prey.conf + + # Add cron.d script + insinto /etc/cron.d + doins "${FILESDIR}/prey.cron" + use userpriv && { fowners root:${PN} /etc/cron.d/prey.cron ; } + fperms 660 /etc/cron.d/prey.cron + + dodoc README + + # modules + cd "${S}"/modules + for mod in * + do + use ${mod} || continue + + # move config, if present, to /etc/prey + if [ -f $mod/config ] + then + insinto "/etc/prey" + newins "$mod/config" "mod-$mod.conf" + use userpriv && { fowners root:${PN} "/etc/${PN}/mod-$mod.conf" ; } + fperms 660 "/etc/${PN}/mod-$mod.conf" + # Rest of the module in its expected location + insinto /usr/share/prey/modules + doins -r "$mod" + if [[ $mod == "lock" ]]; then + fperms 555 \ + "/usr/share/${PN}/modules/lock/platform/linux/${PN}-lock" + fi + fi + done + +} +pkg_postinst () { + elog "--Configuration--" + elog "Make sure you follow the next steps before running prey for the" + elog "first time" + if use userpriv; then + elog "- Add your user to ${PN} group using" + elog "gpasswd -a <your_user> ${PN}" + else + elog "You don't seem to have 'userpriv' enabled so" + elog "${PN} configuration is only accessible as root" + fi + elog "- Create an account on http://preyproject.com/" + elog "- Modify the core and module configuration in /etc/prey" + elog "- Uncomment the line in /etc/cron.d/prey.cron" +} |