man-1.6g-r1.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils toolchain-funcs user
  5. DESCRIPTION="Standard commands to read man pages"
  6. HOMEPAGE="http://primates.ximian.com/~flucifredi/man/"
  7. SRC_URI="http://primates.ximian.com/~flucifredi/man/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
  11. IUSE="+lzma nls selinux"
  12. DEPEND="nls? ( sys-devel/gettext )"
  13. RDEPEND="|| ( >=sys-apps/groff-1.19.2-r1 app-doc/heirloom-doctools )
  14. !sys-apps/man-db
  15. !<app-arch/lzma-4.63
  16. lzma? ( app-arch/xz-utils )
  17. selinux? ( sec-policy/selinux-makewhatis )"
  18. pkg_setup() {
  19. enewgroup man 15
  20. enewuser man 13 -1 /usr/share/man man
  21. }
  22. src_prepare() {
  23. epatch "${FILESDIR}"/man-1.6f-man2html-compression-2.patch
  24. epatch "${FILESDIR}"/man-1.6-cross-compile.patch
  25. epatch "${FILESDIR}"/man-1.6f-unicode.patch #146315
  26. epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
  27. epatch "${FILESDIR}"/man-1.5m2-apropos.patch
  28. epatch "${FILESDIR}"/man-1.6g-fbsd.patch #138123
  29. epatch "${FILESDIR}"/man-1.6e-headers.patch
  30. epatch "${FILESDIR}"/man-1.6f-so-search-2.patch
  31. epatch "${FILESDIR}"/man-1.6g-compress.patch #205147
  32. epatch "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
  33. epatch "${FILESDIR}"/man-1.6g-xz.patch #302380
  34. epatch "${FILESDIR}"/man-1.6f-makewhatis-compression-cleanup.patch #331979
  35. epatch "${FILESDIR}"/man-1.6g-echo-escape.patch #523874
  36. # make sure `less` handles escape sequences #287183
  37. sed -i -e '/^DEFAULTLESSOPT=/s:"$:R":' configure
  38. }
  39. echoit() { echo "$@" ; "$@" ; }
  40. src_configure() {
  41. strip-linguas $(eval $(grep ^LANGUAGES= configure) ; echo ${LANGUAGES//,/ })
  42. unset NLSPATH #175258
  43. tc-export CC BUILD_CC
  44. local mylang=
  45. if use nls ; then
  46. if [[ -z ${LINGUAS} ]] ; then
  47. mylang="all"
  48. else
  49. mylang="${LINGUAS// /,}"
  50. fi
  51. else
  52. mylang="none"
  53. fi
  54. export COMPRESS
  55. if use lzma ; then
  56. COMPRESS=/usr/bin/xz
  57. else
  58. COMPRESS=/bin/bzip2
  59. fi
  60. echoit \
  61. ./configure \
  62. -confdir=/etc \
  63. +sgid +fhs \
  64. +lang ${mylang} \
  65. || die "configure failed"
  66. }
  67. src_install() {
  68. unset NLSPATH #175258
  69. emake PREFIX="${D}" install || die "make install failed"
  70. dosym man /usr/bin/manpath
  71. dodoc LSM README* TODO
  72. # makewhatis only adds man-pages from the last 24hrs
  73. exeinto /etc/cron.daily
  74. newexe "${FILESDIR}"/makewhatis.cron makewhatis
  75. keepdir /var/cache/man
  76. diropts -m0775 -g man
  77. local mansects=$(grep ^MANSECT "${D}"/etc/man.conf | cut -f2-)
  78. for x in ${mansects//:/ } ; do
  79. keepdir /var/cache/man/cat${x}
  80. done
  81. }
  82. pkg_postinst() {
  83. einfo "Forcing sane permissions onto ${ROOT}var/cache/man (Bug #40322)"
  84. chown -R root:man "${ROOT}"/var/cache/man
  85. chmod -R g+w "${ROOT}"/var/cache/man
  86. [[ -e ${ROOT}/var/cache/man/whatis ]] \
  87. && chown root:0 "${ROOT}"/var/cache/man/whatis
  88. echo
  89. local f files=$(ls "${ROOT}"/etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
  90. for f in ${files} ; do
  91. [[ ${f} == */etc/cron.daily/makewhatis ]] && continue
  92. [[ $(md5sum "${f}") == "8b2016cc778ed4e2570b912c0f420266 "* ]] \
  93. && rm -f "${f}"
  94. done
  95. files=$(ls "${ROOT}"etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
  96. if [[ ${files/$'\n'} != ${files} ]] ; then
  97. ewarn "You have multiple makewhatis cron files installed."
  98. ewarn "You might want to delete all but one of these:"
  99. ewarn ${files}
  100. fi
  101. if has_version app-doc/heirloom-doctools; then
  102. ewarn "Please note that the /etc/man.conf file installed will not"
  103. ewarn "work with heirloom's nroff by default (yet)."
  104. ewarn ""
  105. ewarn "Check app-doc/heirloom-doctools elog messages for the proper"
  106. ewarn "configuration."
  107. fi
  108. }