dev-vcs/mercurial-server/mercurial-server-1.0.1.ebuild
changeset 3 e4040658b258
equal deleted inserted replaced
2:c4579bc8b669 3:e4040658b258
       
     1 # Copyright 1999-2010 Gentoo Foundation
       
     2 # Distributed under the terms of the GNU General Public License v2
       
     3 # $Header: $
       
     4 
       
     5 EAPI="3"
       
     6 
       
     7 PYTHON_DEPEND="2"
       
     8 
       
     9 inherit eutils python
       
    10 
       
    11 DESCRIPTION="Mercurial authentication and authorization tools"
       
    12 HOMEPAGE="http://www.lshift.net/mercurial-server.html"
       
    13 SRC_URI="http://dev.lshift.net/paul/mercurial-server/mercurial-server_${PV}.tar.gz"
       
    14 
       
    15 LICENSE="GPL-2"
       
    16 SLOT="0"
       
    17 KEYWORDS="~x86 ~amd64"
       
    18 IUSE=""
       
    19 
       
    20 RDEPEND="dev-vcs/mercurial"
       
    21 DEPEND="${RDEPEND}
       
    22 	app-text/docbook-xsl-stylesheets
       
    23 	dev-libs/libxslt"
       
    24 
       
    25 S="${WORKDIR}/${PN}_${PV}.orig"
       
    26 
       
    27 pkg_setup() {
       
    28 	enewgroup hg
       
    29 	enewuser hg -1 /bin/sh /home/hg hg
       
    30 	chmod 700 /home/hg
       
    31 	python_set_active_version 2
       
    32 }
       
    33 
       
    34 src_compile() {
       
    35 	emake DOCBOOK_XSL="${EPREFIX}"/usr/share/sgml/docbook/xsl-stylesheets || die "emake failed"
       
    36 }
       
    37 
       
    38 src_install() {
       
    39 	emake installfiles PREFIX="${EPREFIX}"/usr/share DOCDIR="${EPREFIX}/usr/share/doc/${PF}" DESTDIR="${D}" || die
       
    40 }
       
    41 
       
    42 pkg_postinst() {
       
    43 	#skip the comments if there is already a hgadmin repo
       
    44 	if [ ! -d "${EPREFIX}"/home/hg/repos/hgadmin/.hg ]; then
       
    45 		#Parts could be done automatically, but maybe there is a user hg
       
    46 		elog "This seem to be a first time install, things you may want to do"
       
    47 		elog "-Add your public ssh key to root key folder"
       
    48 		elog "  sudo cp ~/.ssh/id_rsa.pub ${EROOT}etc/mercurial-server/keys/root/\${USER}"
       
    49 		elog "-Create hgadmin repo"
       
    50 		elog "  sudo -H -u hg ${EROOT}usr/share/mercurial-server/init/hginit ${EROOT}usr/share/mercurial-server"
       
    51 		elog "-Init hg's ssh authorized_keys file"
       
    52 		elog "  sudo -H -u hg ${EROOT}usr/share/mercurial-server/refresh-auth"
       
    53 		elog "-Clone hgadmin repo"
       
    54 		elog "  hg clone ssh://hg@localhost/hgadmin hgadmin"
       
    55 		elog "-Start administration"
       
    56 		elog "  cd hgadmin"
       
    57 		elog "  mkdir -p keys/root"
       
    58 		elog "  cp ${ROOT}etc/mercurial-server/keys/root/\${USER} keys/root"
       
    59 		elog "  cp ${ROOT}etc/mercurial-server/access.conf ."
       
    60 		elog "  hg add"
       
    61 		elog "  hg commit -m 'initial commit'"
       
    62 		elog "  hg push ssh://hg@localhost/hgadmin"
       
    63 		elog "-Remove the key in ${EROOT}etc/mercurial-server/keys/root"
       
    64 		elog "  rm ${EROOT}etc/mercurial-server/keys/root/\${USER}"
       
    65 	fi
       
    66 	ewarn "If you are upgrading from an older version of ${PN}, please take a look at"
       
    67 	ewarn "${EROOT}usr/share/mercurial-server/init/dot-mercurial-server"
       
    68 	ewarn "and add missing lines to ~hg/.mercurial-server"
       
    69 }