pcsc-lite-1.8.20.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit python-single-r1 systemd udev user multilib-minimal
  6. DESCRIPTION="PC/SC Architecture smartcard middleware library"
  7. HOMEPAGE="http://pcsclite.alioth.debian.org/"
  8. STUPID_NUM="4203"
  9. MY_P="${PN}-${PV/_/-}"
  10. SRC_URI="http://alioth.debian.org/download.php/file/${STUPID_NUM}/${MY_P}.tar.bz2"
  11. S="${WORKDIR}/${MY_P}"
  12. # GPL-2 is there for the init script; everything else comes from
  13. # upstream.
  14. LICENSE="BSD ISC MIT GPL-3+ GPL-2"
  15. SLOT="0"
  16. KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
  17. # This is called libusb so that it doesn't fool people in thinking that
  18. # it is _required_ for USB support. Otherwise they'll disable udev and
  19. # that's going to be worse.
  20. IUSE="python libusb policykit selinux +udev"
  21. REQUIRED_USE="^^ ( udev libusb ) \
  22. python? ( ${PYTHON_REQUIRED_USE} )"
  23. # No dependencies need the MULTILIB_DEPS because the libraries are actually
  24. # standalone, the deps are only needed for the daemon itself.
  25. CDEPEND="libusb? ( virtual/libusb:1 )
  26. udev? ( virtual/udev )
  27. policykit? ( >=sys-auth/polkit-0.111 )
  28. python? ( ${PYTHON_DEPS} )"
  29. DEPEND="${CDEPEND}
  30. virtual/pkgconfig"
  31. RDEPEND="${CDEPEND}
  32. !<app-crypt/ccid-1.4.1-r1
  33. !<sys-apps/baselayout-2
  34. !<sys-apps/openrc-0.11.8
  35. selinux? ( sec-policy/selinux-pcscd )
  36. "
  37. PATCHES=(
  38. "${FILESDIR}"/${PN}-1.8.11-polkit-pcscd.patch
  39. )
  40. DOCS=( AUTHORS DRIVERS HELP README SECURITY ChangeLog )
  41. pkg_setup() {
  42. use python && python-single-r1_pkg_setup
  43. enewgroup openct # make sure it exists
  44. enewgroup pcscd
  45. enewuser pcscd -1 -1 /run/pcscd pcscd,openct
  46. }
  47. multilib_src_configure() {
  48. ECONF_SOURCE="${S}" econf \
  49. --disable-maintainer-mode \
  50. --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb" \
  51. --enable-ipcdir=/run/pcscd \
  52. --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
  53. $(multilib_native_use_enable udev libudev) \
  54. $(multilib_native_use_enable libusb) \
  55. $(multilib_native_use_enable policykit polkit)
  56. }
  57. multilib_src_install_all() {
  58. einstalldocs
  59. newinitd "${FILESDIR}"/pcscd-init.7 pcscd
  60. if use udev; then
  61. insinto "$(get_udevdir)"/rules.d
  62. doins "${FILESDIR}"/99-pcscd-hotplug.rules
  63. fi
  64. for f in "${ED}/usr/bin/pcsc-spy"; do
  65. if use python; then
  66. python_fix_shebang "${f}"
  67. else
  68. rm "${f}"
  69. fi
  70. done
  71. }
  72. pkg_postinst() {
  73. elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
  74. elog "the pcscd group, to avoid running as root."
  75. elog ""
  76. elog "This also means you need the newest drivers available so that the"
  77. elog "devices get the proper owner."
  78. elog ""
  79. elog "Furthermore, a conf.d file is no longer installed by default, as"
  80. elog "the default configuration does not require one. If you need to"
  81. elog "pass further options to pcscd, create a file and set the"
  82. elog "EXTRA_OPTS variable."
  83. elog ""
  84. if use udev; then
  85. elog "Hotplug support is provided by udev rules; you only need to tell"
  86. elog "the init system to hotplug it, by setting this variable in"
  87. elog "/etc/rc.conf:"
  88. elog ""
  89. elog " rc_hotplug=\"pcscd\""
  90. fi
  91. }