irda-utils-0.9.18-r6.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic toolchain-funcs udev
  5. DESCRIPTION="IrDA management and handling utilities"
  6. HOMEPAGE="http://irda.sourceforge.net"
  7. SRC_URI="mirror://sourceforge/irda/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ~arm ppc ~sh x86"
  11. IUSE=""
  12. RDEPEND="
  13. dev-libs/glib:2
  14. >=sys-apps/pciutils-2.2.7-r1
  15. sys-process/procps
  16. sys-apps/setserial
  17. sys-apps/grep
  18. virtual/udev
  19. "
  20. DEPEND="${RDEPEND}
  21. virtual/pkgconfig
  22. !app-laptop/smcinit
  23. "
  24. PATCHES=(
  25. "${FILESDIR}/${PN}-rh1.patch"
  26. "${FILESDIR}/${P}-makefile.diff"
  27. "${FILESDIR}/${P}-smcinit.diff"
  28. "${FILESDIR}/${P}-io.h.diff"
  29. "${FILESDIR}/${P}-dofail.patch"
  30. "${FILESDIR}/${P}-asneeded.patch"
  31. "${FILESDIR}/${P}-ldflags.patch"
  32. "${FILESDIR}/${P}-headers.patch"
  33. )
  34. src_prepare() {
  35. # TODO: switch to 'default' once udev.eclass is EAPI=6 clean
  36. epatch -p1 "${PATCHES[@]}"
  37. append-flags "-fno-strict-aliasing" # bug????
  38. # fix Bug 570488 by restoring pre-GCC5 inline semantics
  39. append-cflags -std=gnu89
  40. # fix crosscompile, respect CFLAGS (Bug 200295)
  41. sed -i -e "/^CC/s:gcc:$(tc-getCC):" \
  42. -e "/^LD/s:ld:$(tc-getLD):" \
  43. -e "/^AR/s:ar:$(tc-getAR):" \
  44. -e "/^RANLIB/s:ranlib:$(tc-getRANLIB):" \
  45. -e "/^CFLAGS/s:-O2:${CFLAGS}:" Makefile */Makefile || die
  46. # fix compile when pciutils is compiled with USE=zlib (Bug 200295)
  47. sed -i -e "s:-lpci:$(pkg-config --libs libpci):g" smcinit/Makefile || die
  48. # disable etc subdir in Makefile
  49. sed -i -e "s:^\(DIRS.*=.* \)etc \(.*\):\1\2:g" Makefile || die
  50. # disable write_pid(), because we don't need it
  51. sed -i -e "s:\(write_pid();\):/* \1 */:g" irattach/util.c || die
  52. }
  53. src_compile() {
  54. emake RPM_OPT_FLAGS="${CFLAGS}" RPM_BUILD_ROOT="${D}" ROOT="${D}"
  55. }
  56. src_install () {
  57. dodir /usr/bin
  58. dodir /usr/sbin
  59. emake install RPM_OPT_FLAGS="${CFLAGS}" ROOT="${D}" \
  60. MANDIR="${D}usr/share/man"
  61. newdoc ethereal/README README.wireshark
  62. newdoc irattach/README README.irattach
  63. newdoc irdadump/README README.irdadump
  64. newdoc irdaping/README README.irdaping
  65. newdoc irsockets/README README.irsockets
  66. newdoc tekram/README README.tekram
  67. newdoc smcinit/README README.smcinit
  68. newdoc smcinit/README.Peri README.smcinit.Peri
  69. newdoc smcinit/README.Rob README.smcinit.Rob
  70. newdoc smcinit/README.Tom README.smcinit.Tom
  71. newdoc irattach/ChangeLog ChangeLog.irattach
  72. newdoc irdadump/ChangeLog ChangeLog.irdadump
  73. newdoc smcinit/ChangeLog ChangeLog.smcinit
  74. dohtml smcinit/RobMiller-irda.html
  75. dodoc README
  76. newconfd "${FILESDIR}/irda.confd" irda
  77. newinitd "${FILESDIR}/irda.initd" irda
  78. insinto /etc/modprobe.d
  79. newins "${FILESDIR}/irda.modsd" irda.conf
  80. udev_newrules "${FILESDIR}/irda.rules" 53-irda.rules
  81. exeinto "$(get_udevdir)"
  82. newexe "${FILESDIR}/irda-setup.sh" irda-setup
  83. newexe "${FILESDIR}/irda-usb.sh" irda-usb
  84. }