public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexandre Restovtsev" <tetromino@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: x11-misc/colord/
Date: Tue, 27 Sep 2011 06:06:07 +0000 (UTC)	[thread overview]
Message-ID: <cc7a30f7a403697b2e94412a9fd6d9fde4311232.tetromino@gentoo> (raw)

commit:     cc7a30f7a403697b2e94412a9fd6d9fde4311232
Author:     Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
AuthorDate: Mon Sep 26 07:02:18 2011 +0000
Commit:     Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Tue Sep 27 06:05:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=cc7a30f7

x11-misc/colord: add 0.1.12

Add new colord version. Following the example of Debian, for security we
should run colord as a non-root user and refrain from automatically
scanning user directories for color profiles.

---
 x11-misc/colord/colord-0.1.12.ebuild |  135 ++++++++++++++++++++++++++++++++++
 x11-misc/colord/colord-9999.ebuild   |   48 ++++++++++++-
 2 files changed, 182 insertions(+), 1 deletions(-)

diff --git a/x11-misc/colord/colord-0.1.12.ebuild b/x11-misc/colord/colord-0.1.12.ebuild
new file mode 100644
index 0000000..34b74ca
--- /dev/null
+++ b/x11-misc/colord/colord-0.1.12.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+inherit eutils base
+if [[ ${PV} = 9999 ]]; then
+	GCONF_DEBUG="no"
+	inherit gnome2-live # need all the hacks from gnome2-live_src_prepare
+fi
+
+DESCRIPTION="System service to accurately color manage input and output devices"
+HOMEPAGE="http://www.freedesktop.org/software/colord/"
+if [[ ${PV} = 9999 ]]; then
+	EGIT_REPO_URI="git://gitorious.org/colord/master.git"
+else
+	SRC_URI="http://www.freedesktop.org/software/colord/releases/${P}.tar.xz"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+if [[ ${PV} = 9999 ]]; then
+	KEYWORDS=""
+else
+	KEYWORDS="~amd64 ~x86"
+fi
+IUSE="doc examples +introspection scanner +udev"
+
+# XXX: raise to libusb-1.0.9:1 when available
+COMMON_DEPEND="
+	dev-db/sqlite:3
+	>=dev-libs/glib-2.28.0:2
+	>=dev-libs/libusb-1.0.8:1
+	>=media-libs/lcms-2.2:2
+	>=sys-auth/polkit-0.97
+	introspection? ( >=dev-libs/gobject-introspection-0.9.8 )
+	scanner? ( media-gfx/sane-backends )
+	udev? ( || ( sys-fs/udev[gudev] sys-fs/udev[extras] ) )
+"
+RDEPEND="${COMMON_DEPEND}
+	media-gfx/shared-color-profiles"
+# XXX: automagic build-time vala dependency if USE=introspection
+DEPEND="${COMMON_DEPEND}
+	app-text/docbook-sgml-utils
+	dev-libs/libxslt
+	>=dev-util/intltool-0.35
+	dev-util/pkgconfig
+	>=sys-devel/gettext-0.17
+	doc? (
+		app-text/docbook-xml-dtd:4.1.2
+		>=dev-util/gtk-doc-1.9
+	)
+	introspection? ( dev-lang/vala:0.12 )
+"
+
+# FIXME: needs pre-installed dbus service files
+RESTRICT="test"
+
+DOCS=(AUTHORS ChangeLog MAINTAINERS NEWS README TODO)
+
+pkg_setup() {
+	enewgroup colord
+	enewuser colord -1 -1 /var/lib/colord colord
+}
+
+src_configure() {
+	econf \
+		--disable-examples \
+		--disable-static \
+		--enable-polkit \
+		--enable-reverse \
+		--disable-volume-search \
+		--with-daemon-user=colord \
+		--localstatedir="${EPREFIX}"/var \
+		$(use_enable doc gtk-doc) \
+		$(use_enable introspection) \
+		$(use_enable scanner sane) \
+		$(use_enable udev gudev) \
+		VAPIGEN=$(type -p vapigen-0.12)
+	# parallel make fails in doc/api
+	use doc && MAKEOPTS=-j1
+}
+
+src_install() {
+	base_src_install
+
+	# Ensure config and profile directories exist and are writable
+	local d
+	for d in /var/lib/{color,colord}; do
+		keepdir "${d}"
+		fowners colord:colord "${d}"
+	done
+
+	# additional documentation files not included in tarball releases
+	[[ ${PV} = 9999 ]] && use doc && dodoc doc/*.txt doc/*.svg
+
+	if use examples; then
+		insinto /usr/share/doc/${PF}/examples
+		doins examples/*.c
+	fi
+
+	find "${D}" -name "*.la" -delete || die
+}
+
+pkg_postinst() {
+	# <=colord-0.1.11 ran as root and used /var/lib/lib/colord to store
+	# configuration files and /var/lib/lib/color for custom color profiles.
+	local old_dir="${EROOT}var/lib/lib/colord"
+	local new_dir="${EROOT}var/lib/colord"
+
+	if [[ -e "${old_dir}/mapping.db" || -e "${old_dir}/storage.db" ]] && \
+	   ! [[ -e "${new_dir}/mapping.db" || -e "${new_dir}/storage.db" ]]; then
+		elog "Old colord configuration files are present in ${old_dir}. If you"
+		elog "are upgrading from colord-0.1.11 or older and had previously"
+		elog "customized your color management settings, you will need to copy"
+		elog "these files to ${new_dir} and then change the file ownership"
+		elog "to colord:colord :"
+		elog
+		elog " # cp ${old_dir}/*.db ${new_dir}"
+		elog " # chown colord:colord ${new_dir}/*.db"
+		elog
+	fi
+	old_dir="${EROOT}var/lib/lib/color"
+	new_dir="${EROOT}var/lib/color"
+	if [[ -e "${old_dir}/icc" && ! -e "${new_dir}/icc" ]]; then
+		elog "Old custom color profiles are present in ${old_dir}. If you are"
+		elog "upgrading from colord-0.1.11 or older, you will need to copy them"
+		elog "to ${new_dir} and then change the ownership to colord:colord :"
+		elog
+		elog " # cp -r ${old_dir}/icc ${new_dir}"
+		elog " # chown -R colord:colord ${new_dir}/icc"
+		elog
+	fi
+}

diff --git a/x11-misc/colord/colord-9999.ebuild b/x11-misc/colord/colord-9999.ebuild
index e966c19..34b74ca 100644
--- a/x11-misc/colord/colord-9999.ebuild
+++ b/x11-misc/colord/colord-9999.ebuild
@@ -4,7 +4,7 @@
 
 EAPI="4"
 
-inherit base
+inherit eutils base
 if [[ ${PV} = 9999 ]]; then
 	GCONF_DEBUG="no"
 	inherit gnome2-live # need all the hacks from gnome2-live_src_prepare
@@ -59,12 +59,20 @@ RESTRICT="test"
 
 DOCS=(AUTHORS ChangeLog MAINTAINERS NEWS README TODO)
 
+pkg_setup() {
+	enewgroup colord
+	enewuser colord -1 -1 /var/lib/colord colord
+}
+
 src_configure() {
 	econf \
 		--disable-examples \
 		--disable-static \
 		--enable-polkit \
 		--enable-reverse \
+		--disable-volume-search \
+		--with-daemon-user=colord \
+		--localstatedir="${EPREFIX}"/var \
 		$(use_enable doc gtk-doc) \
 		$(use_enable introspection) \
 		$(use_enable scanner sane) \
@@ -77,6 +85,13 @@ src_configure() {
 src_install() {
 	base_src_install
 
+	# Ensure config and profile directories exist and are writable
+	local d
+	for d in /var/lib/{color,colord}; do
+		keepdir "${d}"
+		fowners colord:colord "${d}"
+	done
+
 	# additional documentation files not included in tarball releases
 	[[ ${PV} = 9999 ]] && use doc && dodoc doc/*.txt doc/*.svg
 
@@ -87,3 +102,34 @@ src_install() {
 
 	find "${D}" -name "*.la" -delete || die
 }
+
+pkg_postinst() {
+	# <=colord-0.1.11 ran as root and used /var/lib/lib/colord to store
+	# configuration files and /var/lib/lib/color for custom color profiles.
+	local old_dir="${EROOT}var/lib/lib/colord"
+	local new_dir="${EROOT}var/lib/colord"
+
+	if [[ -e "${old_dir}/mapping.db" || -e "${old_dir}/storage.db" ]] && \
+	   ! [[ -e "${new_dir}/mapping.db" || -e "${new_dir}/storage.db" ]]; then
+		elog "Old colord configuration files are present in ${old_dir}. If you"
+		elog "are upgrading from colord-0.1.11 or older and had previously"
+		elog "customized your color management settings, you will need to copy"
+		elog "these files to ${new_dir} and then change the file ownership"
+		elog "to colord:colord :"
+		elog
+		elog " # cp ${old_dir}/*.db ${new_dir}"
+		elog " # chown colord:colord ${new_dir}/*.db"
+		elog
+	fi
+	old_dir="${EROOT}var/lib/lib/color"
+	new_dir="${EROOT}var/lib/color"
+	if [[ -e "${old_dir}/icc" && ! -e "${new_dir}/icc" ]]; then
+		elog "Old custom color profiles are present in ${old_dir}. If you are"
+		elog "upgrading from colord-0.1.11 or older, you will need to copy them"
+		elog "to ${new_dir} and then change the ownership to colord:colord :"
+		elog
+		elog " # cp -r ${old_dir}/icc ${new_dir}"
+		elog " # chown -R colord:colord ${new_dir}/icc"
+		elog
+	fi
+}



             reply	other threads:[~2011-09-27  6:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27  6:06 Alexandre Restovtsev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-24 12:26 [gentoo-commits] proj/gnome:master commit in: x11-misc/colord/ Mart Raudsepp
2014-02-12 23:48 Gilles Dartiguelongue
2012-11-05  7:51 Gilles Dartiguelongue
2011-10-05 17:59 Alexandre Restovtsev
2011-10-05 17:14 Nirbheek Chauhan
2011-09-28 21:18 Alexandre Restovtsev
2011-08-10  1:33 Alexandre Restovtsev
2011-07-12  4:39 Alexandre Restovtsev
2011-06-24 17:35 Alexandre Restovtsev
2011-06-14  6:36 Nirbheek Chauhan
2011-05-08 17:36 Gilles Dartiguelongue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc7a30f7a403697b2e94412a9fd6d9fde4311232.tetromino@gentoo \
    --to=tetromino@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox