| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-vcs/mercurial-server/mercurial-server-1.2.ebuild,v 1.3 2012/06/01 02:30:22 zmedico Exp $
|
| 4 |
|
| 5 |
EAPI="3"
|
| 6 |
PYTHON_DEPEND="2"
|
| 7 |
|
| 8 |
inherit distutils eutils user
|
| 9 |
|
| 10 |
if [[ "${PV}" = "9999" ]]; then
|
| 11 |
inherit mercurial
|
| 12 |
EHG_REPO_URI="http://hg.opensource.lshift.net/mercurial-server"
|
| 13 |
KEYWORDS=""
|
| 14 |
else
|
| 15 |
MY_P="${PN}_${PV}"
|
| 16 |
SRC_URI="http://dev.lshift.net/paul/mercurial-server/${MY_P}.tar.gz"
|
| 17 |
KEYWORDS="~amd64 ~x86"
|
| 18 |
S="${WORKDIR}/${MY_P}.orig"
|
| 19 |
fi
|
| 20 |
|
| 21 |
DESCRIPTION="Mercurial authentication and authorization tools"
|
| 22 |
HOMEPAGE="http://www.lshift.net/mercurial-server.html"
|
| 23 |
|
| 24 |
LICENSE="GPL-2"
|
| 25 |
SLOT="0"
|
| 26 |
IUSE="doc"
|
| 27 |
|
| 28 |
RDEPEND="dev-vcs/mercurial"
|
| 29 |
DEPEND="${RDEPEND}
|
| 30 |
doc? (
|
| 31 |
app-text/docbook-xsl-stylesheets
|
| 32 |
dev-libs/libxslt
|
| 33 |
)"
|
| 34 |
|
| 35 |
pkg_setup() {
|
| 36 |
enewgroup hg
|
| 37 |
enewuser hg -1 /bin/bash "/var/lib/${PN}" hg
|
| 38 |
}
|
| 39 |
|
| 40 |
src_prepare() {
|
| 41 |
# remove useless makefile
|
| 42 |
rm Makefile
|
| 43 |
|
| 44 |
# fix installation paths
|
| 45 |
sed -i -e "s|'init'|'share/${PN}/init'|" setup.py \
|
| 46 |
|| die 'sed setup.py failed.'
|
| 47 |
|
| 48 |
# fix documentation
|
| 49 |
if [[ "${PV}" = "1.1" ]]; then
|
| 50 |
epatch "${FILESDIR}/${P}_documentation.patch"
|
| 51 |
fi
|
| 52 |
}
|
| 53 |
|
| 54 |
src_compile() {
|
| 55 |
distutils_src_compile
|
| 56 |
|
| 57 |
# build documentation
|
| 58 |
if use doc; then
|
| 59 |
xsltproc --nonet -o manual.html \
|
| 60 |
/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl \
|
| 61 |
doc/manual.docbook || die "xsltproc failed"
|
| 62 |
fi
|
| 63 |
}
|
| 64 |
|
| 65 |
src_install() {
|
| 66 |
distutils_src_install --install-scripts="/usr/share/${PN}"
|
| 67 |
|
| 68 |
# install configuration files
|
| 69 |
insinto "/etc/${PN}"
|
| 70 |
doins -r src/init/conf/*
|
| 71 |
keepdir /etc/mercurial-server/keys/{root,users}
|
| 72 |
|
| 73 |
# install documentation
|
| 74 |
if use doc; then
|
| 75 |
dohtml manual.html
|
| 76 |
fi
|
| 77 |
|
| 78 |
# install hg home directory
|
| 79 |
keepdir "/var/lib/${PN}"
|
| 80 |
fowners hg:hg "/var/lib/${PN}"
|
| 81 |
fperms 750 "/var/lib/${PN}"
|
| 82 |
}
|