openct-0.6.20-r4.ebuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit flag-o-matic ltprune multilib udev user
  5. DESCRIPTION="library for accessing smart card terminals"
  6. HOMEPAGE="https://github.com/OpenSC/openct/wiki"
  7. SRC_URI="mirror://sourceforge/opensc/${PN}/${P}.tar.gz"
  8. KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
  9. LICENSE="LGPL-2.1"
  10. SLOT="0"
  11. IUSE="doc pcsc-lite usb debug +udev"
  12. # Drop the libtool dep once libltdl goes stable.
  13. RDEPEND="pcsc-lite? ( >=sys-apps/pcsc-lite-1.7.2-r1:= )
  14. usb? ( virtual/libusb:0 )
  15. dev-libs/libltdl:0="
  16. DEPEND="${RDEPEND}
  17. doc? ( app-doc/doxygen )"
  18. # udev is not required at all at build-time as it's only a matter of
  19. # installing the rules; add openrc for the checkpath used in the new
  20. # init script
  21. RDEPEND="${RDEPEND}
  22. udev? ( virtual/udev )
  23. sys-apps/openrc"
  24. pkg_setup() {
  25. enewgroup openct
  26. enewuser openctd
  27. }
  28. src_configure() {
  29. use debug && append-cppflags -DDEBUG_IFDH
  30. econf \
  31. --docdir="/usr/share/doc/${PF}" \
  32. --htmldir="/usr/share/doc/${PF}/html" \
  33. --localstatedir=/var \
  34. --with-udev="$(get_udevdir)" \
  35. --enable-non-privileged \
  36. --with-daemon-user=openctd \
  37. --with-daemon-groups=usb \
  38. --enable-shared --disable-static \
  39. $(use_enable doc) \
  40. $(use_enable doc api-doc) \
  41. $(use_enable pcsc-lite pcsc) \
  42. $(use_with pcsc-lite bundle /usr/$(get_libdir)/readers/usb) \
  43. $(use_enable usb)
  44. }
  45. src_install() {
  46. default
  47. prune_libtool_files --all
  48. rm "${D}"/usr/$(get_libdir)/openct-ifd.*
  49. use udev && udev_newrules etc/openct.udev 70-openct.rules
  50. newinitd "${FILESDIR}"/openct.rc.2 openct
  51. }
  52. pkg_postinst() {
  53. elog
  54. elog "You need to edit /etc/openct.conf to enable serial readers."
  55. elog
  56. elog "You should add \"openct\" to your default runlevel. To do so"
  57. elog "type \"rc-update add openct default\"."
  58. elog
  59. elog "You need to be a member of the (newly created) group openct to"
  60. elog "access smart card readers connected to this system. Set users'"
  61. elog "groups with usermod -G. root always has access."
  62. elog
  63. }