apt-cacher-ng-3.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit cmake-utils eutils toolchain-funcs user
  5. DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software packages"
  6. HOMEPAGE="
  7. http://www.unix-ag.uni-kl.de/~bloch/acng/
  8. http://packages.qa.debian.org/a/apt-cacher-ng.html
  9. "
  10. LICENSE="BSD-4 ZLIB public-domain"
  11. SLOT="0"
  12. SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${PV}.orig.tar.xz"
  13. KEYWORDS="~amd64 ~x86"
  14. IUSE="doc fuse systemd tcpd"
  15. COMMON_DEPEND="
  16. app-arch/bzip2
  17. app-arch/xz-utils
  18. dev-libs/openssl:*
  19. sys-libs/zlib
  20. systemd? (
  21. sys-apps/systemd
  22. )
  23. "
  24. DEPEND="
  25. ${COMMON_DEPEND}
  26. dev-util/cmake
  27. >sys-devel/gcc-4.8
  28. virtual/pkgconfig
  29. "
  30. RDEPEND="
  31. ${COMMON_DEPEND}
  32. dev-lang/perl
  33. fuse? ( sys-fs/fuse )
  34. tcpd? ( sys-apps/tcp-wrappers )
  35. "
  36. S=${WORKDIR}/${P/_}
  37. pkg_pretend() {
  38. if [[ $(gcc-major-version) -lt 4 ]]; then
  39. die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)"
  40. elif [[ $(gcc-major-version) = 4 ]] && [[ $(gcc-minor-version) -lt 8 ]]; then
  41. die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)"
  42. fi
  43. }
  44. pkg_setup() {
  45. # add new user & group for daemon
  46. enewgroup ${PN}
  47. enewuser ${PN} -1 -1 -1 ${PN}
  48. }
  49. src_configure(){
  50. mycmakeargs=( "-DCMAKE_INSTALL_PREFIX=/usr" )
  51. if use fuse; then
  52. mycmakeargs+=( "-DHAVE_FUSE_25=yes" )
  53. else
  54. mycmakeargs+=( "-DHAVE_FUSE_25=no" )
  55. fi
  56. if use tcpd; then
  57. mycmakeargs=( "-DHAVE_LIBWRAP=yes" )
  58. else
  59. mycmakeargs=( "-DHAVE_LIBWRAP=no" )
  60. fi
  61. cmake-utils_src_configure
  62. }
  63. src_install() {
  64. pushd ${CMAKE_BUILD_DIR}
  65. dosbin ${PN}
  66. if use fuse; then
  67. dobin acngfs
  68. fi
  69. popd
  70. newinitd "${FILESDIR}"/initd-r1 ${PN}
  71. newconfd "${FILESDIR}"/confd ${PN}
  72. insinto /etc/logrotate.d
  73. newins "${FILESDIR}"/logrotate ${PN}
  74. doman doc/man/${PN}*
  75. if use fuse; then
  76. doman doc/man/acngfs*
  77. fi
  78. # Documentation
  79. dodoc doc/README TODO VERSION INSTALL ChangeLog
  80. if use doc; then
  81. dodoc doc/*.pdf
  82. dohtml doc/html/*
  83. docinto examples/conf
  84. dodoc conf/*
  85. fi
  86. # perl daily cron script
  87. dosbin scripts/expire-caller.pl
  88. exeinto /etc/cron.daily
  89. newexe "${FILESDIR}"/cron.daily ${PN}
  90. # default configuration
  91. insinto /etc/${PN}
  92. newins "${CMAKE_BUILD_DIR}"/conf/acng.conf ${PN}.conf
  93. doins $( echo conf/* | sed 's|conf/acng.conf.in||g' )
  94. keepdir /var/log/${PN}
  95. # Some directories must exists
  96. keepdir /var/log/${PN}
  97. fowners -R ${PN}:${PN} \
  98. /etc/${PN} \
  99. /var/log/${PN}
  100. }