Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
prey ebuild (anti-theft software)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Tue Sep 20, 2011 3:07 am    Post subject: prey ebuild (anti-theft software) Reply with quote

just posting this here in case anyone wants it
i may at some point toss it on bugzilla, but putting it here because I'd otherwise forget about it

Software homepage: http://preyproject.com/

They also have a semi-complete web control panel similar to what they use if you do the "non-standalone" version, over on github: https://github.com/prey/standalone-control-panel

Not going to write an ebuild for that, largely, because a)I generally don't like using portage to install webapps, b)given that I have no interest in e.g. webapp-config as a *user*, I have even less interest in writing an ebuild that uses it

at any rate, here goes

prey-0.5.3.ebuild (i put it in app-admin)

Code:

# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3
inherit eutils

DESCRIPTION="Prey Project Anti-Theft Software"
HOMEPAGE="http://www.preyproject.com"
SRC_URI="http://preyproject.com/releases/${PV}/${P}-linux.zip"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND="media-tv/xawtv
        net-misc/wget
        net-misc/curl
        media-gfx/scrot
        dev-perl/IO-Socket-SSL
        dev-perl/Net-SSLeay"
RDEPEND="${DEPEND}"

src_prepare() {
# use /etc/prey.conf instead of /usr/share/prey/config
epatch "${FILESDIR}"/confpath.patch || die
}

src_install() {
dodir /usr/share/prey || die
insinto /etc
newins "${WORKDIR}"/prey/config prey.conf || die
cp -rp "${WORKDIR}"/prey/* "${D}"/usr/share/prey || die
}

pkg_postinst() {
ewarn "Before you first run prey, you will need to open up the"
ewarn "config file at /etc/prey.conf and change your settings"
ewarn "according to your configuration. If you're using the"
ewarn "Control Panel, then you only need to insert your API and"
ewarn "Device keys; otherwise you need to set up your SMTP"
ewarn "server settings."
ewarn " "
ewarn "Prey runs as a cron job, which you will need to create"
ewarn "It should look similar to:"
ewarn ""
ewarn " */20 * * * * /usr/share/prey/prey.sh > /var/log/prey.log"
ewarn ""
ewarn "Further documentation is included with the package, and"
ewarn "can be found at /usr/share/prey, or online at ${HOMEPAGE}"


confpath.patch
Code:

--- prey/core/setup.orig        2011-09-18 23:21:27.208869001 -0500
+++ prey/core/setup     2011-09-18 23:22:34.674585001 -0500
@@ -109,7 +109,7 @@
        readonly lang
        readonly start_time=`date +"%F %T"`

-       readonly config_file="$base_path/config"
+       readonly config_file="/etc/prey.conf"
        readonly tmpdir="$tmpbase/p${RANDOM}"
        readonly last_response="$tmpbase/prey-last-response.xml"
        readonly on_demand_pipefile="$tmpbase/prey-on-demand.pipe"
--- prey/prey.sh.orig   2011-09-19 00:05:16.000000000 -0500
+++ prey/prey.sh        2011-09-19 00:05:39.000000000 -0500
@@ -13,7 +13,7 @@
 ####################################################################

 . "$base_path/version"
-. "$base_path/config"
+. "/etc/prey.conf"
 [ ! -f "lang/$lang" ] && lang='en' # fallback to english in case the lang is missing
 . "$base_path/lang/$lang"
 . "$base_path/core/base"
--- prey/core/functions.orig    2011-02-15 10:01:48.000000000 -0600
+++ prey/core/functions 2011-09-19 00:09:04.000000000 -0500
@@ -301,7 +301,7 @@
                save_config_value device_key "$device_key"

                if [ $? == 1 ]; then
-                       log " -- There was a problem saving the configuration. You probably don't have permissions to modify $base_path/config."
+                       log " -- There was a problem saving the configuration. You probably don't have permissions to modify /etc/prey.conf"
                else
                        log " -- All set. Assigned key is $device_key."
                fi


If you want to just wget the stuff, you can do so here: http://whitehathouston.com/downloads/gentoo/ebuilds/prey/app-admin/prey/

(NB: if years in the future someone finds this, and the above link is dead, it means either I'm dead, or I can't afford my electric/DNS/internet/anyoftheaforementioned bill.)

hope this helps someone. Not sure I'll check on this thread after today, so if anyone changes the ebuild, i doubt I'll see it. And, installing/configuring the thing is up to you!

I wrote this thinking I'd use it, before realizing crypto on my laptops means no data loss, and, my laptops are so damn cheap and shoddy if they were stolen I wouldn't bother retrieving them. I plan on using it on my mobile devices, but it has no use on my linux desktops/laptops. Maybe it does for yours, so I share!
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum