# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: EAPI="2" inherit eutils multilib versionator regex='s/^\([^\.]*\)\.\(....\)\(..\)\(..\)/\1-\4-\3-\2/' MY_PV=$(echo ${PV} | sed "${regex}") MY_P=${PN}-revision${MY_PV} DESCRIPTION="Grenouille, ou la météo du Net" HOMEPAGE="http://devel.grenouille.com/Camlgrenouille.php" SRC_URI="http://devel.grenouille.com/pub/daily-snapshot/camlgrenouille/${MY_P}.tar.bz2" LICENSE="GPL-2" IUSE="ocamlopt" SLOT="0" KEYWORDS="amd64 ppc -sparc x86" DEPEND="dev-lang/ocaml sys-libs/ncurses" S="${WORKDIR}/${PN}" pkg_setup() { if use ocamlopt && ! built_with_use --missing true dev-lang/ocaml ocamlopt; then eerror "In order to build ${PN} with native code support from ocaml" eerror "You first need to have a native code ocaml compiler." eerror "You need to install dev-lang/ocaml with ocamlopt useflag on." die "Please install ocaml with ocamlopt useflag" fi } src_prepare() { : epatch "${FILESDIR}"/camlgrenouille-commands.patch } src_compile() { local myext="" use ocamlopt || myext=".byte" cd ${S} touch build_linux make depend || die "could not create depencies file" make ${PN}$myext || die "could not make ${PN}" } src_install() { local myext="" use ocamlopt || myext=".byte" insinto /usr/share/camlgrenouille doins plugins/linux/ifconfig/shell_ifconfig.sh || die fowners nobody:nobody /usr/share/camlgrenouille/shell_ifconfig.sh fperms 750 /usr/share/camlgrenouille/shell_ifconfig.sh exeinto /usr/bin newexe camlgrenouille$myext camlgrenouille || die sed -i "s~./shell_ifconfig.sh~/usr/share/camlgrenouille/shell_ifconfig.sh~" user.config.linux insinto /etc/camlgrenouille newins user.config.linux user.config fowners nobody:nobody /etc/camlgrenouille/user.config fperms 640 /etc/camlgrenouille/user.config newinitd "${FILESDIR}/camlgrenouille.rc6" camlgrenouille newconfd "${FILESDIR}/camlgrenouille.confd" camlgrenouille #fperms 600 /etc/conf.d/camlgrenouille #fowners root /etc/conf.d/camlgrenouille insinto /var/log touch "${D}/var/log/camlgrenouille.log" fowners nobody:nobody /var/log/camlgrenouille.log fperms 644 /var/log/camlgrenouille.log dodoc README Changelog TODO || die }