Advertisement
Guest User

Untitled

a guest
Jul 16th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.41 KB | None | 0 0
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: /var/cvsroot/gentoo-x86/app-admin/bcfg2/bcfg2-1.2.2-r1.ebuild,v 1.1 2012/06/29 06:28:40 xmw Exp $
  4.  
  5. EAPI="4"
  6.  
  7. PYTHON_DEPEND="2:2.6"
  8. SUPPORT_PYTHON_ABIS="1"
  9. # ssl module required.
  10. RESTRICT_PYTHON_ABIS="2.4 2.5 3.*"
  11.  
  12. inherit depend.apache distutils eutils
  13.  
  14. DESCRIPTION="configuration management tool"
  15. HOMEPAGE="http://bcfg2.org"
  16. SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${P}.tar.gz"
  17.  
  18. LICENSE="BSD"
  19. SLOT="0"
  20. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris"
  21. IUSE="doc cheetah genshi server web"
  22.  
  23. DEPEND="dev-python/setuptools
  24.     doc? ( dev-python/sphinx )"
  25. RDEPEND="app-portage/gentoolkit
  26.     cheetah? ( dev-python/cheetah )
  27.     genshi? ( dev-python/genshi )
  28.     server? (
  29.         virtual/fam
  30.         dev-python/lxml
  31.         dev-libs/libgamin[python] )
  32.     web? (
  33.         www-apache/mod_wsgi
  34.         www-servers/apache )"
  35.  
  36. PYTHON_MODNAME="Bcfg2"
  37.  
  38. distutils_src_install_post_hook() {
  39.     if ! use server; then
  40.         rm -f "$(distutils_get_intermediate_installation_image)${EPREFIX}/usr/sbin/bcfg2-"*
  41.     fi
  42. }
  43.  
  44. src_prepare() {
  45.     epatch "${FILESDIR}"/${P}-CVE-2012-3366-Trigger-plugin.patch
  46.     cp misc/apache/bcfg2.conf misc/apache/98_bcfg2.conf
  47.     sed -i -e 's/\(<IfModule mod_wsgi.c>\)/<IfDefine BCFG2>\n\1/;s/\(<\/IfModule>\)/\1\n<\/IfDefine>/;' misc/apache/98_bcfg2.conf
  48.     distutils_src_prepare
  49.  
  50. }
  51.  
  52. src_compile() {
  53.     distutils_src_compile
  54.  
  55.     if use doc; then
  56.         einfo "Building Bcfg2 documentation"
  57.         PYTHONPATH="build-$(PYTHON -f --ABI)" \
  58.             sphinx-build doc doc_output || die
  59.     fi
  60. }
  61.  
  62. src_install() {
  63.     distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}/usr/sbin"
  64.  
  65.     if ! use server; then
  66.         rm -rf "${ED}usr/share/bcfg2" || die
  67.         rm -rf "${ED}usr/share/man/man8" || die
  68.     else
  69.         newinitd "${FILESDIR}/${PN}-server-1.2.0.rc" bcfg2-server
  70.     fi
  71.  
  72.     insinto /etc
  73.     doins examples/bcfg2.conf
  74.  
  75.     if use doc; then
  76.         pushd doc_output > /dev/null
  77.         insinto /usr/share/doc/${PF}/html
  78.         doins -r [a-z]* _images _static || die "Failed to install documentation"
  79.         popd > /dev/null
  80.     fi
  81.  
  82.     if use web; then
  83.         insinto /etc/apache2/modules.d
  84.         #insinto "${APACHE_MODULES_CONFDIR}"
  85.         doins  misc/apache/98_bcfg2.conf || die "test"
  86.     fi
  87. }
  88.  
  89. pkg_postinst () {
  90.     distutils_pkg_postinst
  91.  
  92.     if use server; then
  93.         einfo "If this is a new installation, you probably need to run:"
  94.         einfo "    bcfg2-admin init"
  95.     fi
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement