summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <hwoarang@gentoo.org>2011-09-19 16:25:04 +0000
committerMarkos Chandras <hwoarang@gentoo.org>2011-09-19 16:25:04 +0000
commit0cc89f3b3e87c29a8136a22deea1ed92359e4115 (patch)
tree73fc3895750e4b874f87511d324a4382c9c17d72 /app-laptop
parentRemove unneeded deps (diff)
downloadhistorical-0cc89f3b3e87c29a8136a22deea1ed92359e4115.tar.gz
historical-0cc89f3b3e87c29a8136a22deea1ed92359e4115.tar.bz2
historical-0cc89f3b3e87c29a8136a22deea1ed92359e4115.zip
Initial commit. Thanks to Travis Hansen and Thomas Kear for the ebuilds. Bug #305813
Package-Manager: portage-2.2.0_alpha58/cvs/Linux x86_64
Diffstat (limited to 'app-laptop')
-rw-r--r--app-laptop/prey/ChangeLog12
-rw-r--r--app-laptop/prey/Manifest28
-rw-r--r--app-laptop/prey/files/prey-0.5.3-gtk-ui.patch31
-rw-r--r--app-laptop/prey/files/prey-0.5.3-mplayer-support.patch48
-rw-r--r--app-laptop/prey/files/prey-cron-functions.patch31
-rw-r--r--app-laptop/prey/files/prey.cron1
-rw-r--r--app-laptop/prey/metadata.xml33
-rw-r--r--app-laptop/prey/prey-0.5.3.ebuild157
8 files changed, 341 insertions, 0 deletions
diff --git a/app-laptop/prey/ChangeLog b/app-laptop/prey/ChangeLog
new file mode 100644
index 000000000000..e604f76f00ad
--- /dev/null
+++ b/app-laptop/prey/ChangeLog
@@ -0,0 +1,12 @@
+# ChangeLog for app-laptop/prey
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/prey/ChangeLog,v 1.1 2011/09/19 16:25:04 hwoarang Exp $
+
+*prey-0.5.3 (19 Sep 2011)
+
+ 19 Sep 2011; Markos Chandras <hwoarang@gentoo.org> +prey-0.5.3.ebuild,
+ +files/prey-0.5.3-gtk-ui.patch, +files/prey-0.5.3-mplayer-support.patch,
+ +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/Manifest b/app-laptop/prey/Manifest
new file mode 100644
index 000000000000..13cfebb147b1
--- /dev/null
+++ b/app-laptop/prey/Manifest
@@ -0,0 +1,28 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+AUX prey-0.5.3-gtk-ui.patch 1179 RMD160 d5ce0a426922ef7aad6f49290ce6571af2e1480e SHA1 59901af09f8e6fe82746bd26f4074a12187e3235 SHA256 e6272e6999cb939c7a539633916691448344da7fd43d0fe106cf697259e66fc1
+AUX prey-0.5.3-mplayer-support.patch 1502 RMD160 f5805fb88d9ae13c62fface160c7e58122b02267 SHA1 4744fc84fb3a40064bbbc31a3e18bd733f3141d1 SHA256 e36f42783d7d17e73038dbb09b29812d272ecb2cf2d89e5848078d949d5e8245
+AUX prey-cron-functions.patch 1118 RMD160 13942e017914ad27040bbfa0b4eea75d9886a707 SHA1 39dce3f94af89689a382d83f56b0432ba43997b0 SHA256 365841680a0351621970a1ca1466c33e470146b3527eb0246990c7b0c3cabd7b
+AUX prey.cron 40 RMD160 7e0860ed0f1bef387f880414fda026ef1ce8505d SHA1 913f62662cd79782277e44fd279733708afd6b5b SHA256 db734b149b34c68bb28894d01b0fd4d189cc86aca8cacffddfa9059f44d1413c
+DIST prey-0.5.3-linux.zip 639364 RMD160 511ff534d1b2e629f35733a2aa564711528fec77 SHA1 af459705df270d67f7a3142667cf38c446667cb3 SHA256 fdeed1987d30b4ca585e19ac9884194bc8a108bd56112d2913206fc85be3bd9b
+EBUILD prey-0.5.3.ebuild 4306 RMD160 30261cf964f0c001c608ad7dec3125d2be530b08 SHA1 05390ebe80e66714d24ceef341acffae5855a914 SHA256 8e4b16880dee3146bcd461b4d6d0e9690f0d56de5b1e5017f35c68289735ef36
+MISC ChangeLog 589 RMD160 a8032ef30f4eb0ebaab60e3d38269ced07af00bf SHA1 9130d79eee24b93e27e0970f19df834cb73afbbb SHA256 3c17cadcf61b1eab0e2abb12d9d28d4adeb0803261fd8290f292f8b46010f12c
+MISC metadata.xml 1365 RMD160 ab34ef1886c67cd7194c311bb5283d2617a240c0 SHA1 fc7207eb86e0e0a2a574e5e6cbaf6169513d8cec SHA256 adc1fdd370c7f9397741c3baea1b37c8dab4f0f2b2a6781fe7a4f99d3b31b184
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.18 (GNU/Linux)
+
+iQIcBAEBCgAGBQJOd2yJAAoJEPqDWhW0r/LCP6oQALagi6SXhty3VKre6367oALV
+gvsxKNGZhwUSSHEmF7fXeHie5Ww7ESqOLH4y4KCLGSP7c86ImiK1GKdBXzILRweP
+q5Ymw5upqPorR7iQVNKPM2zkkYj3CzkumT7zhogYXHumVyWh9JdLLmtnqWGA5vzY
+rfWF5vnYEfgd7ovvtXwUFjE4nmM0kg0wwTCkX2sjT5PUkRhXFt7lMr+TnmzPM9Ik
+tGn6/n2WHnesPiB4/OR2FrG9iPNMDn030G7uDHRgHbtwlgNEZg/lP90aRhT/L/XX
+7OiJ86IoGehl6/oe4MfeD5taDKWvIgveXMeFJi6lIrnHRkRe2ZAL2EjH3IK8IZ38
++rc/kYDpp/LRwVqaFjUZHTYYHc+Qwkv27Z4ZSvrsO68MC9gnzdAc9PyNEef8d5UN
++lQPeXT01pTinUWQVjTt8M9FOgkp4NgYLzn/Ta3abn3gLGIND5h5U34umyPeicrc
+NIkVKyvIxuQMhb9yywK8PJtpMJotR1FDWYbYAFYAwV1xPlChejojkUQXmscuM2q7
++e2ctdWLUWyse/CEdfLSqq7/Z76XYXPLbPjduKgmbiNWXB/gLWa61FbnK7rSwUTv
+uLMEPIQlsZSxPygwG9UOP4PRRz8VZFEZJQvZ8bUoI17esc22vdsKwGzcbYg+uw15
+AjX87wIQY685tM7YeDpP
+=4+W6
+-----END PGP SIGNATURE-----
diff --git a/app-laptop/prey/files/prey-0.5.3-gtk-ui.patch b/app-laptop/prey/files/prey-0.5.3-gtk-ui.patch
new file mode 100644
index 000000000000..7b55b83cd3e2
--- /dev/null
+++ b/app-laptop/prey/files/prey-0.5.3-gtk-ui.patch
@@ -0,0 +1,31 @@
+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 urllib
+
+ 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'
+-CONFIG_FILE = PREY_PATH + '/config'
++CONFIG_FILE = '/etc/config'
+ CONTROL_PANEL_URL = 'http://control.preyproject.com'
+ CONTROL_PANEL_URL_SSL = 'https://control.preyproject.com'
+ GUEST_ACCOUNT_NAME = 'guest_account'
+@@ -293,7 +293,7 @@ class PreyConfigurator(object):
+ return True
+
+ def is_config_writable(self):
+- command = 'if [ ! -w "'+PREY_PATH+'/config" ]; then echo 1; fi'
++ command = 'if [ ! -w '+CONFIG_FILE+' ]; then echo 1; fi'
+ no_access = os.popen(command).read().strip()
+ if no_access == '1':
+ self.show_alert(_("Unauthorized"), _("You don't have access to manage Prey's configuration. Sorry."), True)
diff --git a/app-laptop/prey/files/prey-0.5.3-mplayer-support.patch b/app-laptop/prey/files/prey-0.5.3-mplayer-support.patch
new file mode 100644
index 000000000000..970f50d751d9
--- /dev/null
+++ b/app-laptop/prey/files/prey-0.5.3-mplayer-support.patch
@@ -0,0 +1,48 @@
+--- modules/webcam/platform/linux/functions.orig 2011-01-19 22:49:55.457000055 -0700
++++ modules/webcam/platform/linux/functions 2011-01-20 18:19:11.046000085 -0700
+@@ -9,6 +9,7 @@
+
+ # do we have streamer installed ?
+ local streamer=`which streamer`
++ local mencoder=`which mencoder`
+ if [ -n "$streamer" ]; then
+
+ # take four pictures every 0.5 seconds as JPEG
+@@ -37,19 +38,32 @@
+ fi
+
+ fi
+-
++ elif [ -n "${mencoder}" ]; then
++ # not sure how to do this same thing with mencoder
++ mplayer tv:// -tv driver=v4l2:noaudio:device=/dev/video0 -frames 10 -vo jpeg &> /dev/null
++ if [ $? == 0 ]; then
++ mv 00000010.jpg "${webcam__picture}" > /dev/null
++ rm 000000*.jpg > /dev/null
++ fi
+ fi
+
+ }
+
+ capture_video() {
+
+- # we should already know if we do have streamer
++ local frames=$(( $webcam__video_capture_time * $webcam__frames_per_second ))
++
++ # do we have streamer installed ?
++ local streamer=`which streamer`
++ local mencoder=`which mencoder`
++
+ if [ -n "$streamer" ]; then
+-
+- local frames=$(( $webcam__video_capture_time * $webcam__frames_per_second ))
+ $streamer -o "$webcam__video" -f yuv2 -F stereo -r $webcam__frames_per_second -t $frames
+-
++ elif [ -n "${mencoder}" ]; then
++ ${mencoder} tv:// -tv driver=v4l2:noaudio:device=/dev/video0 -ovc lavc -ffourcc DX50 -ofps ${webcam__frames_per_second} -endpos ${webcam__video_capture_time} -o "${tmpdir}/prey-video.avi" &> /dev/null
++ if [ $? == 0 ]; then
++ webcam__video="${tmpdir}/prey-video.avi"
++ fi
+ fi
+
+ }
diff --git a/app-laptop/prey/files/prey-cron-functions.patch b/app-laptop/prey/files/prey-cron-functions.patch
new file mode 100644
index 000000000000..0e5486d27d9b
--- /dev/null
+++ b/app-laptop/prey/files/prey-cron-functions.patch
@@ -0,0 +1,31 @@
+Index: prey/core/functions
+===================================================================
+--- prey.orig/core/functions
++++ prey/core/functions
+@@ -170,7 +170,7 @@ remove_files(){
+
+ get_current_delay(){
+ # crontab -l | grep prey | sed "s/^..\([0-9]*\).*/\1/"
+- crontab -l | grep prey | head -1 | sed 's/ \/.*//'
++ sed -i 's/ \/.*//' /etc/cron.d/prey.cron
+ }
+
+ get_delay_for(){
+@@ -197,7 +197,7 @@ get_delay_for(){
+
+ update_execution_delay(){
+ local full_path=`full_path "$base_path"`
+- (crontab -l | grep -v prey; echo "${new_delay}" "${full_path}/prey.sh > /var/log/prey.log") | crontab -
++ echo "${new_delay}" "/usr/bin/prey.sh > /var/log/prey.log" > /etc/cron.d/prey.cron
+ }
+
+ ####################################################################
+@@ -250,7 +250,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.cron b/app-laptop/prey/files/prey.cron
new file mode 100644
index 000000000000..fe036185a2d5
--- /dev/null
+++ b/app-laptop/prey/files/prey.cron
@@ -0,0 +1 @@
+#*/20 * * * * /usr/bin/prey &>/dev/null
diff --git a/app-laptop/prey/metadata.xml b/app-laptop/prey/metadata.xml
new file mode 100644
index 000000000000..d9836ac35052
--- /dev/null
+++ b/app-laptop/prey/metadata.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+</maintainer>
+<maintainer>
+ <email>travisghansen@yahoo.com</email>
+ <name>Travis Hansen</name>
+ <description>Co-maintainer. CC him on bugs</description>
+</maintainer>
+<maintainer>
+ <email>m4rk@silverarrow.org</email>
+ <name>Markellos Orfanos</name>
+ <description>Ebuild tester. CC him on bugs</description>
+</maintainer>
+<use>
+ <flag name="alarm">Module for playing an audio file</flag>
+ <flag name="alert">Display a warning message when the computer seems to be stolen"</flag>
+ <flag name="geo">Module for retrieving the physical location of the stolen computer</flag>
+ <flag name="lock">Lock stolen computer</flag>
+ <flag name="network">Get network information (active connections, traceroute) from stolen computer</flag>
+ <flag name="secure">Delete or hide sensitive user data</flag>
+ <flag name="session">Get screenshots from user session</flag>
+ <flag name="userpriv">Create a prey user group so regular users can access and modify the prey configuration. Use it with caution</flag>
+ <flag name="webcam">Use computer's webcam to take screenshots of the thief</flag>
+</use>
+<longdescription lang="en">
+</longdescription>
+</pkgmetadata>
+
diff --git a/app-laptop/prey/prey-0.5.3.ebuild b/app-laptop/prey/prey-0.5.3.ebuild
new file mode 100644
index 000000000000..1d8ae6ec14a8
--- /dev/null
+++ b/app-laptop/prey/prey-0.5.3.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/prey/prey-0.5.3.ebuild,v 1.1 2011/09/19 16:25:04 hwoarang Exp $
+
+EAPI=4
+
+inherit eutils
+
+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,v4l2] ) ( 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}"/${PN}-cron-functions.patch \
+ "${FILESDIR}"/${P}-gtk-ui.patch \
+ "${FILESDIR}"/${P}-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"
+ if [[ $mod == "lock" ]]; then
+ fperms 555 \
+ "/usr/share/${PN}/modules/lock/platform/linux/${PN}-lock"
+ fi
+ fi
+
+ # Rest of the module in its expected location
+ insinto /usr/share/prey/modules
+ doins -r "$mod"
+ 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"
+}