http-replicator-3.0-r7.ebuild 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 ) # not 2.6 bug #33907, not 3.0 bug #411083
  5. inherit eutils python-single-r1 systemd
  6. MY_P="${PN}_${PV}"
  7. DESCRIPTION="Proxy cache for Gentoo packages"
  8. HOMEPAGE="https://sourceforge.net/projects/http-replicator"
  9. SRC_URI="mirror://sourceforge/http-replicator/${MY_P}.tar.gz"
  10. S="${WORKDIR}/${MY_P}"
  11. LICENSE="GPL-2"
  12. SLOT="0"
  13. KEYWORDS="~alpha amd64 hppa ppc ~sparc x86"
  14. PATCHES=(
  15. "${FILESDIR}/http-replicator-3.0-sighup.patch"
  16. "${FILESDIR}/http-replicator-3-unique-cache-name.patch"
  17. "${FILESDIR}/http-replicator-3-missing-directory.patch"
  18. )
  19. src_install(){
  20. python-single-r1_pkg_setup
  21. # Daemon and repcacheman into /usr/bin
  22. python_scriptinto /usr/bin
  23. python_doscript http-replicator
  24. python_newscript "${FILESDIR}/http-replicator-3.0-repcacheman-0.44-r2" repcacheman.py
  25. exeinto /usr/bin
  26. newexe "${FILESDIR}/http-replicator-3.0-callrepcacheman-0.1" repcacheman
  27. # init.d scripts
  28. newinitd "${FILESDIR}/http-replicator-3.0.init" http-replicator
  29. newconfd "${FILESDIR}/http-replicator-3.0.conf" http-replicator
  30. systemd_dounit "${FILESDIR}"/http-replicator.service
  31. systemd_install_serviced "${FILESDIR}"/http-replicator.service.conf
  32. # Docs
  33. dodoc README debian/changelog
  34. # Man Page - Not Gentooified yet
  35. doman http-replicator.1
  36. insinto /etc/logrotate.d
  37. newins debian/logrotate http-replicator
  38. }
  39. pkg_postinst() {
  40. elog
  41. ewarn "Before starting http-replicator, please follow the next few steps:"
  42. elog "- Modify /etc/conf.d/http-replicator if required."
  43. ewarn "- Run /usr/bin/repcacheman to set up the cache."
  44. elog "- Add http_proxy=\"http://serveraddress:8080\" to make.conf on"
  45. elog " the server as well as on the client machines."
  46. elog "- Make sure FETCHCOMMAND adds the X-unique-cache-name header to"
  47. elog " HTTP requests in make.conf (or maybe portage will add it to"
  48. elog " the default make.globals someday). Example:"
  49. elog ' FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
  50. elog ' RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
  51. elog "- Arrange to periodically run repcacheman on this server,"
  52. elog " to clean up the local /usr/portage/distfiles directory."
  53. elog "- Arrange to periodically run something like the following"
  54. elog " on this server. 'eclean' is in app-portage/gentoolkit."
  55. elog " ( export DISTDIR=/var/cache/http-replicator/"
  56. elog " eclean -i distfiles )"
  57. elog "- Even with FETCHCOMMAND fixing most cases, occasionally"
  58. elog " an older invalid version of a file may end up in the cache,"
  59. elog " causing checksum failures when portage tries to fetch"
  60. elog " it. To recover, either use eclean (above), manually delete"
  61. elog " the relevant file from the cache, or temporarily comment"
  62. elog " out the http_proxy setting. Commenting only requires"
  63. elog " access to client config, not server cache."
  64. elog "- Make sure GENTOO_MIRRORS in /etc/portage/make.conf starts"
  65. elog " with several good http mirrors."
  66. elog
  67. elog "For more information please refer to the following forum thread:"
  68. elog " http://forums.gentoo.org/viewtopic-t-173226.html"
  69. elog
  70. }