ifd-gempc-1.0.7.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs
  5. DESCRIPTION="GemCore based PC/SC reader drivers for pcsc-lite"
  6. HOMEPAGE="http://ludovic.rousseau.free.fr/softwares/ifd-GemPC"
  7. LICENSE="GPL-2 BSD"
  8. KEYWORDS="~amd64 ~ppc ~x86"
  9. SLOT="0"
  10. SRC_URI="http://ludovic.rousseau.free.fr/softwares/ifd-GemPC/${P}.tar.gz"
  11. IUSE=""
  12. RDEPEND=">=sys-apps/pcsc-lite-1.2.9_beta7
  13. virtual/libusb:0"
  14. DEPEND="${RDEPEND}
  15. virtual/pkgconfig"
  16. DOCS=(
  17. README README.410 README.430
  18. )
  19. src_compile() {
  20. emake CC="$(tc-getCC)"
  21. }
  22. src_install () {
  23. emake CC="$(tc-getCC)" DESTDIR="${D}" install
  24. einstalldocs
  25. local pcscdir="$(pkg-config --variable=usbdropdir libpcsclite)"
  26. local conf="/etc/reader.conf.d/${PN}.conf"
  27. dodir "$(dirname "${conf}")"
  28. insinto "$(dirname "${conf}")"
  29. newins "${FILESDIR}/reader.conf" "$(basename "${conf}")"
  30. sed -e "s:%PCSC_DRIVERS_DIR%:${pcscdir}:g" -e "s:%libGemPC410%:libGemPC410.so.${PV}:g" -i "${D}${conf}"
  31. }
  32. pkg_postinst() {
  33. elog "NOTICE:"
  34. elog "1. If you are using GemPC410, modify ${conf}"
  35. elog "2. Run update-reader.conf, yes this is a command..."
  36. elog "3. Restart pcscd"
  37. }
  38. pkg_postrm() {
  39. #
  40. # Without this, pcscd will not start next time.
  41. #
  42. local conf="/etc/reader.conf.d/${PN}.conf"
  43. if ! [[ -f "${conf}" && -f "$(grep LIBPATH "${conf}" | sed 's/LIBPATH *//' | sed 's/ *$//g' | head -n 1)" ]]; then
  44. [[ -f "${conf}" ]] && rm "${conf}"
  45. update-reader.conf
  46. elog "NOTICE:"
  47. elog "You need to restart pcscd"
  48. fi
  49. }