summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2014-02-14 23:11:54 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2014-02-14 23:11:54 +0000
commit59bc7f90dcc7be42473ef93a6bd66f97a3e348cd (patch)
tree7c86ce76241e0ddff2d73984cff4cc930f395b1e /sys-apps/pcsc-lite
parentVersion bump. (diff)
downloadgentoo-2-59bc7f90dcc7be42473ef93a6bd66f97a3e348cd.tar.gz
gentoo-2-59bc7f90dcc7be42473ef93a6bd66f97a3e348cd.tar.bz2
gentoo-2-59bc7f90dcc7be42473ef93a6bd66f97a3e348cd.zip
Version bump; polkit support is added in this version, install the default policy with an extra patch to work for pcscd daemon running as separate user.
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key D4301342)
Diffstat (limited to 'sys-apps/pcsc-lite')
-rw-r--r--sys-apps/pcsc-lite/ChangeLog12
-rw-r--r--sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch20
-rw-r--r--sys-apps/pcsc-lite/files/pcscd-init.723
-rw-r--r--sys-apps/pcsc-lite/metadata.xml5
-rw-r--r--sys-apps/pcsc-lite/pcsc-lite-1.8.11.ebuild97
5 files changed, 155 insertions, 2 deletions
diff --git a/sys-apps/pcsc-lite/ChangeLog b/sys-apps/pcsc-lite/ChangeLog
index 90bc645475fd..d2eb207686c9 100644
--- a/sys-apps/pcsc-lite/ChangeLog
+++ b/sys-apps/pcsc-lite/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/pcsc-lite
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/ChangeLog,v 1.167 2013/12/02 21:36:32 flameeyes Exp $
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/ChangeLog,v 1.168 2014/02/14 23:11:54 flameeyes Exp $
+
+*pcsc-lite-1.8.11 (14 Feb 2014)
+
+ 14 Feb 2014; Diego E. Pettenò <flameeyes@gentoo.org>
+ +files/pcsc-lite-1.8.11-polkit-pcscd.patch, +files/pcscd-init.7,
+ +pcsc-lite-1.8.11.ebuild, metadata.xml:
+ Version bump; polkit support is added in this version, install the default
+ policy with an extra patch to work for pcscd daemon running as separate user.
02 Dec 2013; Diego E. Pettenò <flameeyes@gentoo.org> -pcsc-lite-1.8.6.ebuild,
-pcsc-lite-1.8.8.ebuild, -pcsc-lite-1.8.9.ebuild:
diff --git a/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch b/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch
new file mode 100644
index 000000000000..e7a7b515820e
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch
@@ -0,0 +1,20 @@
+Index: pcsc-lite-1.8.11/doc/org.debian.pcsc-lite.policy
+===================================================================
+--- pcsc-lite-1.8.11.orig/doc/org.debian.pcsc-lite.policy
++++ pcsc-lite-1.8.11/doc/org.debian.pcsc-lite.policy
+@@ -15,6 +15,7 @@
+ <allow_inactive>auth_admin</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
++ <annotate key="org.freedesktop.policykit.owner">unix-user:pcscd</annotate>
+ </action>
+
+ <action id="org.debian.pcsc-lite.access_card">
+@@ -25,6 +26,7 @@
+ <allow_inactive>auth_admin</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
++ <annotate key="org.freedesktop.policykit.owner">unix-user:pcscd</annotate>
+ </action>
+
+ </policyconfig>
diff --git a/sys-apps/pcsc-lite/files/pcscd-init.7 b/sys-apps/pcsc-lite/files/pcscd-init.7
new file mode 100644
index 000000000000..4208d21f8aba
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcscd-init.7
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/files/pcscd-init.7,v 1.1 2014/02/14 23:11:54 flameeyes Exp $
+
+name="PC/SC Daemon"
+
+pidfile=/run/pcscd/pcscd.pid
+
+command=/usr/sbin/pcscd
+command_args="${EXTRA_OPTS}"
+
+start_stop_daemon_args="--user pcscd:pcscd"
+
+depend() {
+ need localmount
+ after udev openct dbus
+ use logger
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o pcscd:pcscd /run/pcscd
+}
diff --git a/sys-apps/pcsc-lite/metadata.xml b/sys-apps/pcsc-lite/metadata.xml
index f99a1826514f..d4fe6b8b20e7 100644
--- a/sys-apps/pcsc-lite/metadata.xml
+++ b/sys-apps/pcsc-lite/metadata.xml
@@ -20,5 +20,10 @@
disable this flag on Linux kernels. This is provided as an
option for completeness.
</flag>
+
+ <flag name='policykit'>
+ Uses <pkg>sys-auth/polkit</pkg> to restrict access to smartcard readers or
+ smartcars to given users.
+ </flag>
</use>
</pkgmetadata>
diff --git a/sys-apps/pcsc-lite/pcsc-lite-1.8.11.ebuild b/sys-apps/pcsc-lite/pcsc-lite-1.8.11.ebuild
new file mode 100644
index 000000000000..4819a3dc783d
--- /dev/null
+++ b/sys-apps/pcsc-lite/pcsc-lite-1.8.11.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pcsc-lite/pcsc-lite-1.8.11.ebuild,v 1.1 2014/02/14 23:11:54 flameeyes Exp $
+
+EAPI="5"
+
+inherit eutils multilib systemd udev user
+
+DESCRIPTION="PC/SC Architecture smartcard middleware library"
+HOMEPAGE="http://pcsclite.alioth.debian.org/"
+
+STUPID_NUM="3991"
+MY_P="${PN}-${PV/_/-}"
+SRC_URI="http://alioth.debian.org/download.php/file/${STUPID_NUM}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+# GPL-2 is there for the init script; everything else comes from
+# upstream.
+LICENSE="BSD ISC MIT GPL-3+ GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+
+# This is called libusb so that it doesn't fool people in thinking that
+# it is _required_ for USB support. Otherwise they'll disable udev and
+# that's going to be worse.
+IUSE="libusb +udev policykit"
+
+REQUIRED_USE="^^ ( udev libusb )"
+
+CDEPEND="libusb? ( virtual/libusb:1 )
+ udev? ( virtual/udev )
+ policykit? ( >=sys-auth/polkit-0.111 )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !<app-crypt/ccid-1.4.1-r1
+ !<sys-apps/baselayout-2
+ !<sys-apps/openrc-0.11.8"
+
+pkg_setup() {
+ enewgroup openct # make sure it exists
+ enewgroup pcscd
+ enewuser pcscd -1 -1 /run/pcscd pcscd,openct
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-polkit-pcscd.patch
+}
+
+src_configure() {
+ econf \
+ --disable-maintainer-mode \
+ --disable-silent-rules \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb" \
+ --enable-ipcdir=/run/pcscd \
+ $(use_enable udev libudev) \
+ $(use_enable libusb) \
+ $(use_enable policykit polkit) \
+ "$(systemd_with_unitdir)" \
+ ${myconf}
+}
+
+DOCS=( AUTHORS DRIVERS HELP README SECURITY ChangeLog )
+
+src_install() {
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/pcscd-init.7 pcscd
+
+ if use udev; then
+ insinto "$(udev_get_udevdir)"/rules.d
+ doins "${FILESDIR}"/99-pcscd-hotplug.rules
+ fi
+}
+
+pkg_postinst() {
+ elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
+ elog "the pcscd group, to avoid running as root."
+ elog ""
+ elog "This also means you need the newest drivers available so that the"
+ elog "devices get the proper owner."
+ elog ""
+ elog "Furthermore, a conf.d file is no longer installed by default, as"
+ elog "the default configuration does not require one. If you need to"
+ elog "pass further options to pcscd, create a file and set the"
+ elog "EXTRA_OPTS variable."
+ elog ""
+ if use udev; then
+ elog "Hotplug support is provided by udev rules; you only need to tell"
+ elog "the init system to hotplug it, by setting this variable in"
+ elog "/etc/rc.conf:"
+ elog ""
+ elog " rc_hotplug=\"pcscd\""
+ fi
+}