wget-1.19.1-r1.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python3_{4,5} )
  5. inherit flag-o-matic python-any-r1 toolchain-funcs eutils
  6. DESCRIPTION="Network utility to retrieve files from the WWW"
  7. HOMEPAGE="https://www.gnu.org/software/wget/"
  8. SRC_URI="mirror://gnu/wget/${P}.tar.xz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  12. IUSE="debug gnutls idn ipv6 libressl nls ntlm pcre +ssl static test uuid zlib"
  13. REQUIRED_USE=" ntlm? ( !gnutls ssl ) gnutls? ( ssl )"
  14. # Force a newer libidn2 to avoid libunistring deps. #612498
  15. LIB_DEPEND="idn? ( >=net-dns/libidn2-0.14[static-libs(+)] )
  16. pcre? ( dev-libs/libpcre[static-libs(+)] )
  17. ssl? (
  18. gnutls? ( net-libs/gnutls:0=[static-libs(+)] )
  19. !gnutls? (
  20. !libressl? ( dev-libs/openssl:0=[static-libs(+)] )
  21. libressl? ( dev-libs/libressl[static-libs(+)] )
  22. )
  23. )
  24. uuid? ( sys-apps/util-linux[static-libs(+)] )
  25. zlib? ( sys-libs/zlib[static-libs(+)] )"
  26. RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
  27. DEPEND="${RDEPEND}
  28. app-arch/xz-utils
  29. virtual/pkgconfig
  30. static? ( ${LIB_DEPEND} )
  31. test? (
  32. ${PYTHON_DEPS}
  33. dev-lang/perl
  34. dev-perl/HTTP-Daemon
  35. dev-perl/HTTP-Message
  36. dev-perl/IO-Socket-SSL
  37. )
  38. nls? ( sys-devel/gettext )"
  39. DOCS=( AUTHORS MAILING-LIST NEWS README doc/sample.wgetrc )
  40. PATCHES=(
  41. "${FILESDIR}"/${P}-CRLF_injection.patch
  42. )
  43. pkg_setup() {
  44. use test && python-any-r1_pkg_setup
  45. }
  46. src_prepare() {
  47. epatch "${PATCHES[@]}"
  48. # revert some hack that breaks linking, bug #585924
  49. if [[ ${CHOST} == *-darwin* ]] || [[ ${CHOST} == *-solaris* ]] || [[ ${CHOST} == *-uclibc* ]]; then
  50. sed -i \
  51. -e 's/^ LIBICONV=$/:/' \
  52. configure || die
  53. fi
  54. }
  55. src_configure() {
  56. # fix compilation on Solaris, we need filio.h for FIONBIO as used in
  57. # the included gnutls -- force ioctl.h to include this header
  58. [[ ${CHOST} == *-solaris* ]] && append-cppflags -DBSD_COMP=1
  59. if use static ; then
  60. append-ldflags -static
  61. tc-export PKG_CONFIG
  62. PKG_CONFIG+=" --static"
  63. fi
  64. # There is no flag that controls this. libunistring-prefix only
  65. # controls the search path (which is why we turn it off below).
  66. # Further, libunistring is only needed w/older libidn2 installs,
  67. # and since we force the latest, we can force off libunistring. #612498
  68. ac_cv_libunistring=no \
  69. econf \
  70. --disable-assert \
  71. --disable-rpath \
  72. --without-included-libunistring \
  73. --without-libunistring-prefix \
  74. $(use_enable debug) \
  75. $(use_enable idn iri) \
  76. $(use_enable ipv6) \
  77. $(use_enable nls) \
  78. $(use_enable ntlm) \
  79. $(use_enable pcre) \
  80. $(use_enable ssl digest) \
  81. $(use_enable ssl opie) \
  82. $(use_with idn libidn) \
  83. $(use_with ssl ssl $(usex gnutls gnutls openssl)) \
  84. $(use_with uuid libuuid) \
  85. $(use_with zlib)
  86. }
  87. src_test() {
  88. emake check
  89. }
  90. src_install() {
  91. default
  92. sed -i \
  93. -e "s:/usr/local/etc:${EPREFIX}/etc:g" \
  94. "${ED}"/etc/wgetrc \
  95. "${ED}"/usr/share/man/man1/wget.1 \
  96. "${ED}"/usr/share/info/wget.info
  97. }