/[gentoo-x86]/app-laptop/prey/prey-0.5.4-r1.ebuild
Gentoo

Contents of /app-laptop/prey/prey-0.5.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Jun 4 18:59:39 2015 UTC (5 years, 2 months ago) by kensington
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +3 -3 lines
Move various kde-base packages to kde-apps.

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0x06B1F38DCA45A1EC!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-laptop/prey/prey-0.5.4-r1.ebuild,v 1.4 2013/02/15 18:47:47 pacho Exp $
4
5 EAPI=4
6
7 inherit eutils readme.gentoo user
8
9 DESCRIPTION="Tracking software for asset recovery"
10 HOMEPAGE="http://preyproject.com/"
11 SRC_URI="http://preyproject.com/releases/${PV}/${P}-linux.zip"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16 IUSE="gtk userpriv"
17
18 LINGUAS="en it sv es"
19 for x in ${LINGUAS}; do
20 IUSE="${IUSE} linguas_${x}"
21 done
22
23 MODULES="+alarm +alert +geo lock +network secure +session webcam"
24 IUSE="${IUSE} ${MODULES}"
25
26 DEPEND=""
27 #TODO: some of these deps may be dependent on USE
28 RDEPEND="${DEPEND}
29 app-shells/bash
30 virtual/cron
31 || ( net-misc/curl net-misc/wget )
32 dev-perl/IO-Socket-SSL
33 dev-perl/Net-SSLeay
34 sys-apps/net-tools
35 alarm? ( media-sound/mpg123
36 media-sound/pulseaudio
37 )
38 alert? ( || ( ( gnome-extra/zenity ) ( kde-apps/kdialog ) ) )
39 gtk? ( dev-python/pygtk )
40 lock? ( dev-python/pygtk )
41 network? ( net-analyzer/traceroute )
42 session? ( sys-apps/iproute2
43 || ( media-gfx/scrot media-gfx/imagemagick )
44 )
45 webcam? ( || ( ( media-video/mplayer[encode,jpeg,v4l] ) ( media-tv/xawtv ) ) )"
46
47 S=${WORKDIR}/${PN}
48
49 pkg_setup() {
50 if use userpriv; then
51 enewgroup ${PN}
52 fi
53 if use gtk; then
54 ewarn "You have the 'gtk' useflag enabled"
55 ewarn "This means that the ${PN} configuration"
56 ewarn "will be accessible via a graphical user"
57 ewarn "interface. This may allow the thief to alter"
58 ewarn "or disable the ${PN} functionality"
59 fi
60 }
61
62 src_prepare() {
63 DISABLE_AUTOFORMATTING="yes"
64 use userpriv && has_version "${CATEGORY}/${PN}:${SLOT}[-userpriv]" && FORCE_PRINT_ELOG="yes"
65 ! use userpriv && has_version "${CATEGORY}/${PN}:${SLOT}[userpriv]" && FORCE_PRINT_ELOG="yes"
66
67 DOC_CONTENTS="--Configuration--
68 Make sure you follow the next steps before running prey for the
69 first time.
70 "
71
72 if use userpriv; then
73 DOC_CONTENTS+="- Add your user to ${PN} group using:
74 # gpasswd -a <your_user> ${PN}"
75 else
76 DOC_CONTENTS+="You don't seem to have 'userpriv' enabled so
77 ${PN} configuration is only accessible as root"
78 fi
79
80 DOC_CONTENTS+="
81 - Create an account on http://preyproject.com/
82 - Modify the core and module configuration in /etc/prey
83 - Uncomment the line in /etc/cron.d/prey.cron"
84
85 # remove system module since it depends on hal and we don't
86 # have hal in portage anymore
87 rm -rf "${S}"/modules/system || die
88
89 epatch "${FILESDIR}"/${P}-cron-functions.patch \
90 "${FILESDIR}"/${P}-gtk-ui.patch \
91 "${FILESDIR}"/${PN}-0.5.3-mplayer-support.patch
92 sed -i -e 's,readonly base_path=`dirname "$0"`,readonly \
93 base_path="/usr/share/prey",' \
94 "${S}"/prey.sh || die
95 # Fix base path. Bug #438728
96 sed -i -e "/readonly/s:base_path=.*:base_path=/usr/share/${PN}:" \
97 prey.sh || die
98 }
99
100 src_install() {
101 # Remove config app if -gtk
102 if use gtk; then
103 # fix the path
104 doicon "${S}"/pixmaps/${PN}.png
105 newbin "${S}"/platform/linux/${PN}-config.py ${PN}-config
106 make_desktop_entry ${PN}-config "Prey Configuration" ${PN} \
107 "System;Monitor"
108 else
109 rm -f "${S}"/platform/linux/prey-config.py || die
110 fi
111
112 # clear out unneeded language files
113 for lang in ${LINGUAS}; do
114 use "linguas_${lang}" || rm -f lang/${lang} modules/*/lang/${lang}
115 done
116
117 # Core files
118 insinto /usr/share/prey
119 doins -r "${S}"/core "${S}"/lang "${S}"/pixmaps "${S}"/platform "${S}"/version
120
121 # Main script
122 newbin ${PN}.sh ${PN}
123
124 # Put the configuration file into /etc, strict perms, symlink
125 insinto /etc/prey
126 newins config ${PN}.conf
127 # some scripts require /usr/share/prey/config file to be present
128 # so symlink it to prey.conf
129 dosym /etc/${PN}/${PN}.conf /usr/share/${PN}/config
130 use userpriv && { fowners root:${PN} /etc/prey ; }
131 fperms 770 /etc/prey
132 use userpriv && { fowners root:${PN} /etc/prey/prey.conf ; }
133 fperms 660 /etc/prey/prey.conf
134
135 # Add cron.d script
136 insinto /etc/cron.d
137 doins "${FILESDIR}/prey.cron"
138 use userpriv && { fowners root:${PN} /etc/cron.d/prey.cron ; }
139 fperms 660 /etc/cron.d/prey.cron
140
141 dodoc README
142
143 # modules
144 cd "${S}"/modules
145 for mod in *
146 do
147 use ${mod} || continue
148
149 # move config, if present, to /etc/prey
150 if [ -f $mod/config ]
151 then
152 insinto "/etc/prey"
153 newins "$mod/config" "mod-$mod.conf"
154 use userpriv && { fowners root:${PN} "/etc/${PN}/mod-$mod.conf" ; }
155 fperms 660 "/etc/${PN}/mod-$mod.conf"
156 # Rest of the module in its expected location
157 insinto /usr/share/prey/modules
158 doins -r "$mod"
159 if [[ $mod == "lock" ]]; then
160 fperms 555 \
161 "/usr/share/${PN}/modules/lock/platform/linux/${PN}-lock"
162 fi
163 fi
164 done
165
166 readme.gentoo_create_doc
167 }

  ViewVC Help
Powered by ViewVC 1.1.20