ufdbguard-1.32.4.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils flag-o-matic user
  5. MY_P="ufdbGuard-${PV}"
  6. DESCRIPTION="ufdbGuard is a redirector for the Squid internet proxy"
  7. HOMEPAGE="http://www.urlfilterdb.com/en/products/ufdbguard.html"
  8. SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz
  9. doc? ( mirror://sourceforge/${PN}/${PV/\.?/}/ReferenceManual.pdf -> ${P}-manual.pdf )"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="doc +httpd"
  14. COMMON_DEPEND="
  15. app-arch/bzip2
  16. dev-libs/openssl:0=
  17. net-misc/wget
  18. "
  19. DEPEND="${COMMON_DEPEND}
  20. sys-devel/bison
  21. sys-devel/flex
  22. "
  23. RDEPEND="${COMMON_DEPEND}
  24. sys-apps/openrc
  25. "
  26. DOCS=( CHANGELOG README src/sampleufdbGuard.conf )
  27. PATCHES=( "${FILESDIR}"/${PN}-1.24-gentoo.patch )
  28. S="${WORKDIR}/${MY_P}"
  29. pkg_setup() {
  30. enewgroup squid
  31. enewuser squid -1 -1 /var/cache/squid squid
  32. }
  33. src_configure() {
  34. # better safe than sorry, the code has a number of possible
  35. # breakage, and at least one certain breakage.
  36. append-flags -fno-strict-aliasing
  37. econf \
  38. --with-ufdb-user=squid \
  39. --with-ufdb-config="${EPREFIX}"/etc \
  40. --with-ufdb-bindir="${EPREFIX}"/usr/libexec/ufdbguard \
  41. --with-ufdb-logdir="${EPREFIX}"/var/log/ufdbguard \
  42. --with-ufdb-dbhome="${EPREFIX}"/usr/share/ufdbguard/blacklists \
  43. --with-ufdb-images_dir="${EPREFIX}"/usr/share/ufdbguard/images
  44. }
  45. src_install() {
  46. einstalldocs
  47. doman doc/*.1
  48. dobin src/ufdbAnalyse src/ufdbGenTable src/ufdbGrab \
  49. src/ufdbConvertDB
  50. dosbin src/ufdbUpdate
  51. exeinto /usr/libexec/ufdbguard
  52. doexe src/mtserver/ufdbguardd src/mtserver/ufdbgclient
  53. if use httpd; then
  54. exeinto /usr/libexec/ufdbguard
  55. doexe src/ufdbhttpd
  56. fi
  57. keepdir /usr/share/ufdbguard/blacklists
  58. insinto /etc
  59. doins src/ufdbGuard.conf
  60. insinto /usr/share/ufdbguard/images
  61. doins -r src/images/.
  62. newconfd "${FILESDIR}"/ufdb.confd ufdb
  63. newinitd "${FILESDIR}"/ufdb.initd.2 ufdb
  64. exeinto /etc/cron.daily
  65. newexe "${FILESDIR}"/ufdbUpdate.cron ufdbUpdate
  66. use doc && newdoc "${DISTDIR}"/${P}-manual.pdf ReferenceManual.pdf
  67. }
  68. pkg_postinst() {
  69. elog "The default location for the blacklist database has been"
  70. elog "moved to ${EROOT%/}/usr/share/ufdbguard/blacklists."
  71. elog ""
  72. elog "The configuration file is no longer configurable in the"
  73. elog "service file, and now resides at ${EROOT%/}/etc/ufdbGuard.conf ."
  74. elog ""
  75. elog "The service script has been renamed from ufdbguad to simply"
  76. elog "${EROOT%/}/etc/init.d/ufdb, to follow the official documentation, and"
  77. elog "it gained a reload option with a reconfig alias."
  78. elog ""
  79. elog "You can configure the username and password parameters for"
  80. elog "ufdbUpdate, to fetch the blacklist database provided by"
  81. elog "URLfilterDB, directly in ${EROOT%/}/etc/conf.d/ufdb without touching"
  82. elog "the script itself."
  83. elog ""
  84. elog "To enable ufdbguard in squid, you should add this to your"
  85. elog "squid.conf:"
  86. elog ""
  87. elog " url_rewrite_program ${EROOT%/}/usr/libexec/ufdbguard/ufdbgclient -l ${EROOT%/}/var/log/ufdbguard"
  88. elog " url_rewrite_children 64"
  89. elog ""
  90. if ! use httpd; then
  91. elog "You chose to not install the lightweight http daemon that"
  92. elog "comes with ufdbguard."
  93. else
  94. elog "The ufdb service will start both the ufdbguardd daemon and"
  95. elog "the ufdbhttpd http daemon to provide a local redirect CGI."
  96. elog "If you don't want this to happen, disable the httpd USE flag."
  97. fi
  98. if use doc; then
  99. elog ""
  100. elog "The reference manual has been installed as"
  101. elog " ${EROOT%/}/usr/share/doc/${PF}/ReferenceManual.pdf"
  102. fi
  103. }