Gentoo Archives: gentoo-commits

From: Alexandre Restovtsev <tetromino@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:gnome-next commit in: x11-misc/colord/
Date: Mon, 26 Sep 2011 09:33:42
Message-Id: 0e0466e7ac37e7e9639f7116ddb150ba03fb74ed.tetromino@gentoo
1 commit: 0e0466e7ac37e7e9639f7116ddb150ba03fb74ed
2 Author: Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
3 AuthorDate: Mon Sep 26 07:02:18 2011 +0000
4 Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
5 CommitDate: Mon Sep 26 07:02:18 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=0e0466e7
7
8 x11-misc/colord: add 0.1.12
9
10 Add new colord version. Following the example of Debian, for security we
11 should run colord as a non-root user and refrain from automatically
12 scanning user directories for color profiles.
13
14 ---
15 x11-misc/colord/colord-0.1.12.ebuild | 135 ++++++++++++++++++++++++++++++++++
16 x11-misc/colord/colord-9999.ebuild | 48 ++++++++++++-
17 2 files changed, 182 insertions(+), 1 deletions(-)
18
19 diff --git a/x11-misc/colord/colord-0.1.12.ebuild b/x11-misc/colord/colord-0.1.12.ebuild
20 new file mode 100644
21 index 0000000..34b74ca
22 --- /dev/null
23 +++ b/x11-misc/colord/colord-0.1.12.ebuild
24 @@ -0,0 +1,135 @@
25 +# Copyright 1999-2011 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +# $Header: $
28 +
29 +EAPI="4"
30 +
31 +inherit eutils base
32 +if [[ ${PV} = 9999 ]]; then
33 + GCONF_DEBUG="no"
34 + inherit gnome2-live # need all the hacks from gnome2-live_src_prepare
35 +fi
36 +
37 +DESCRIPTION="System service to accurately color manage input and output devices"
38 +HOMEPAGE="http://www.freedesktop.org/software/colord/"
39 +if [[ ${PV} = 9999 ]]; then
40 + EGIT_REPO_URI="git://gitorious.org/colord/master.git"
41 +else
42 + SRC_URI="http://www.freedesktop.org/software/colord/releases/${P}.tar.xz"
43 +fi
44 +
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +if [[ ${PV} = 9999 ]]; then
48 + KEYWORDS=""
49 +else
50 + KEYWORDS="~amd64 ~x86"
51 +fi
52 +IUSE="doc examples +introspection scanner +udev"
53 +
54 +# XXX: raise to libusb-1.0.9:1 when available
55 +COMMON_DEPEND="
56 + dev-db/sqlite:3
57 + >=dev-libs/glib-2.28.0:2
58 + >=dev-libs/libusb-1.0.8:1
59 + >=media-libs/lcms-2.2:2
60 + >=sys-auth/polkit-0.97
61 + introspection? ( >=dev-libs/gobject-introspection-0.9.8 )
62 + scanner? ( media-gfx/sane-backends )
63 + udev? ( || ( sys-fs/udev[gudev] sys-fs/udev[extras] ) )
64 +"
65 +RDEPEND="${COMMON_DEPEND}
66 + media-gfx/shared-color-profiles"
67 +# XXX: automagic build-time vala dependency if USE=introspection
68 +DEPEND="${COMMON_DEPEND}
69 + app-text/docbook-sgml-utils
70 + dev-libs/libxslt
71 + >=dev-util/intltool-0.35
72 + dev-util/pkgconfig
73 + >=sys-devel/gettext-0.17
74 + doc? (
75 + app-text/docbook-xml-dtd:4.1.2
76 + >=dev-util/gtk-doc-1.9
77 + )
78 + introspection? ( dev-lang/vala:0.12 )
79 +"
80 +
81 +# FIXME: needs pre-installed dbus service files
82 +RESTRICT="test"
83 +
84 +DOCS=(AUTHORS ChangeLog MAINTAINERS NEWS README TODO)
85 +
86 +pkg_setup() {
87 + enewgroup colord
88 + enewuser colord -1 -1 /var/lib/colord colord
89 +}
90 +
91 +src_configure() {
92 + econf \
93 + --disable-examples \
94 + --disable-static \
95 + --enable-polkit \
96 + --enable-reverse \
97 + --disable-volume-search \
98 + --with-daemon-user=colord \
99 + --localstatedir="${EPREFIX}"/var \
100 + $(use_enable doc gtk-doc) \
101 + $(use_enable introspection) \
102 + $(use_enable scanner sane) \
103 + $(use_enable udev gudev) \
104 + VAPIGEN=$(type -p vapigen-0.12)
105 + # parallel make fails in doc/api
106 + use doc && MAKEOPTS=-j1
107 +}
108 +
109 +src_install() {
110 + base_src_install
111 +
112 + # Ensure config and profile directories exist and are writable
113 + local d
114 + for d in /var/lib/{color,colord}; do
115 + keepdir "${d}"
116 + fowners colord:colord "${d}"
117 + done
118 +
119 + # additional documentation files not included in tarball releases
120 + [[ ${PV} = 9999 ]] && use doc && dodoc doc/*.txt doc/*.svg
121 +
122 + if use examples; then
123 + insinto /usr/share/doc/${PF}/examples
124 + doins examples/*.c
125 + fi
126 +
127 + find "${D}" -name "*.la" -delete || die
128 +}
129 +
130 +pkg_postinst() {
131 + # <=colord-0.1.11 ran as root and used /var/lib/lib/colord to store
132 + # configuration files and /var/lib/lib/color for custom color profiles.
133 + local old_dir="${EROOT}var/lib/lib/colord"
134 + local new_dir="${EROOT}var/lib/colord"
135 +
136 + if [[ -e "${old_dir}/mapping.db" || -e "${old_dir}/storage.db" ]] && \
137 + ! [[ -e "${new_dir}/mapping.db" || -e "${new_dir}/storage.db" ]]; then
138 + elog "Old colord configuration files are present in ${old_dir}. If you"
139 + elog "are upgrading from colord-0.1.11 or older and had previously"
140 + elog "customized your color management settings, you will need to copy"
141 + elog "these files to ${new_dir} and then change the file ownership"
142 + elog "to colord:colord :"
143 + elog
144 + elog " # cp ${old_dir}/*.db ${new_dir}"
145 + elog " # chown colord:colord ${new_dir}/*.db"
146 + elog
147 + fi
148 + old_dir="${EROOT}var/lib/lib/color"
149 + new_dir="${EROOT}var/lib/color"
150 + if [[ -e "${old_dir}/icc" && ! -e "${new_dir}/icc" ]]; then
151 + elog "Old custom color profiles are present in ${old_dir}. If you are"
152 + elog "upgrading from colord-0.1.11 or older, you will need to copy them"
153 + elog "to ${new_dir} and then change the ownership to colord:colord :"
154 + elog
155 + elog " # cp -r ${old_dir}/icc ${new_dir}"
156 + elog " # chown -R colord:colord ${new_dir}/icc"
157 + elog
158 + fi
159 +}
160
161 diff --git a/x11-misc/colord/colord-9999.ebuild b/x11-misc/colord/colord-9999.ebuild
162 index e966c19..34b74ca 100644
163 --- a/x11-misc/colord/colord-9999.ebuild
164 +++ b/x11-misc/colord/colord-9999.ebuild
165 @@ -4,7 +4,7 @@
166
167 EAPI="4"
168
169 -inherit base
170 +inherit eutils base
171 if [[ ${PV} = 9999 ]]; then
172 GCONF_DEBUG="no"
173 inherit gnome2-live # need all the hacks from gnome2-live_src_prepare
174 @@ -59,12 +59,20 @@ RESTRICT="test"
175
176 DOCS=(AUTHORS ChangeLog MAINTAINERS NEWS README TODO)
177
178 +pkg_setup() {
179 + enewgroup colord
180 + enewuser colord -1 -1 /var/lib/colord colord
181 +}
182 +
183 src_configure() {
184 econf \
185 --disable-examples \
186 --disable-static \
187 --enable-polkit \
188 --enable-reverse \
189 + --disable-volume-search \
190 + --with-daemon-user=colord \
191 + --localstatedir="${EPREFIX}"/var \
192 $(use_enable doc gtk-doc) \
193 $(use_enable introspection) \
194 $(use_enable scanner sane) \
195 @@ -77,6 +85,13 @@ src_configure() {
196 src_install() {
197 base_src_install
198
199 + # Ensure config and profile directories exist and are writable
200 + local d
201 + for d in /var/lib/{color,colord}; do
202 + keepdir "${d}"
203 + fowners colord:colord "${d}"
204 + done
205 +
206 # additional documentation files not included in tarball releases
207 [[ ${PV} = 9999 ]] && use doc && dodoc doc/*.txt doc/*.svg
208
209 @@ -87,3 +102,34 @@ src_install() {
210
211 find "${D}" -name "*.la" -delete || die
212 }
213 +
214 +pkg_postinst() {
215 + # <=colord-0.1.11 ran as root and used /var/lib/lib/colord to store
216 + # configuration files and /var/lib/lib/color for custom color profiles.
217 + local old_dir="${EROOT}var/lib/lib/colord"
218 + local new_dir="${EROOT}var/lib/colord"
219 +
220 + if [[ -e "${old_dir}/mapping.db" || -e "${old_dir}/storage.db" ]] && \
221 + ! [[ -e "${new_dir}/mapping.db" || -e "${new_dir}/storage.db" ]]; then
222 + elog "Old colord configuration files are present in ${old_dir}. If you"
223 + elog "are upgrading from colord-0.1.11 or older and had previously"
224 + elog "customized your color management settings, you will need to copy"
225 + elog "these files to ${new_dir} and then change the file ownership"
226 + elog "to colord:colord :"
227 + elog
228 + elog " # cp ${old_dir}/*.db ${new_dir}"
229 + elog " # chown colord:colord ${new_dir}/*.db"
230 + elog
231 + fi
232 + old_dir="${EROOT}var/lib/lib/color"
233 + new_dir="${EROOT}var/lib/color"
234 + if [[ -e "${old_dir}/icc" && ! -e "${new_dir}/icc" ]]; then
235 + elog "Old custom color profiles are present in ${old_dir}. If you are"
236 + elog "upgrading from colord-0.1.11 or older, you will need to copy them"
237 + elog "to ${new_dir} and then change the ownership to colord:colord :"
238 + elog
239 + elog " # cp -r ${old_dir}/icc ${new_dir}"
240 + elog " # chown -R colord:colord ${new_dir}/icc"
241 + elog
242 + fi
243 +}