On Thursday 20 January 2005 13:24, Aaron Walker wrote:
> Alexander Mieland wrote:
> | On Thursday 20 January 2005 01:16, Chris Gianelloni wrote:
> |>pkg_postinst() {
> |>  if [ -f ${ROOT}/etc/basc/bash-time ]
> |>  then
> |>    einfo "Benchmark data present.  To re-run the benchmark
> |> execute:" einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild
> |> config" else
> |>    ewarn "Benchmark data not present.  You will need to execute:"
> |>    ewarn "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
> |>    ewarn "before using basc."
> |>  fi
> |>}
> |>
> |>pkg_config() {
> |>  mkdir -p ${ROOT}/tmp/${PF}
> |>  cd ${ROOT}/tmp/${PF}
> |
> | from where should the ebuild get the bash-source-tarball?
> | shouldn't here also be a wget or something else?
>
> The URL of the tarball needs to be listed in SRC_URI along with the
> basc tarball.  No need for wget; portage will take care of the rest.

hmm... I really don't know how to do this.

Does "unpack" do the whole job (downloading to ${DISTFILES}, unpacking)?

I've modified the ebuild now to download bash-3.0.tar.gz from my own 
server, because I thought that perhaps sometime in the future bash-3.0 
will not exist any longer on the gentoo-mirrors. And it is absolutley 
necessary to download and compile exactly the same version of bash every 
time.

well it would be easier to attach my newest ebuild.
Perhaps you or someone else can give me some issues on what to make 
better...

Btw. I've tested this ebuild and it works great for me. So for me there 
would be no need to change anything...


-- 
http://de.gentoo-wiki.com              Alexander Mieland (aka dma147)
http://www.gentoo-stats.org             Registered Linux-User #249600
http://www.php-programs.de                        GnuGPG-ID: 27491179
http://www.affen-in-not.de             www.php-programs.de/dma147.asc
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header $

# ebuild contributed by Alexander Mieland and Daniel Herzog

inherit eutils toolchain-funcs

DESCRIPTION="Buildtime And Statistics Client for http://www.gentoo-stats.org";
HOMEPAGE="http://www.gentoo-stats.org";
SRC_URI="http://www.gentoo-stats.org/download/${P}.tar.gz";

KEYWORDS=""
SLOT="0"
LICENSE="GPL-2"

IUSE="screenshot"

RDEPEND="app-portage/gentoolkit
        dev-lang/perl
        sys-devel/gcc
        sys-apps/sed
        sys-apps/grep
        app-arch/gzip
        sys-apps/diffutils
        sys-apps/time
        sys-devel/bc
        >=sys-apps/uhinv-0.4
        screenshot? (media-gfx/scrot)"

pkg_setup() {
        enewgroup stats
        enewuser stats -1 /bin/false /tmp stats
}

src_compile() {
        sed -i "s:/usr/local:/usr:g" client/basc
        useq x86 && $(tc-getCC) ${CFLAGS} -o client/smt-detect 
client/smt-detect.c >/dev/null 2>&1
}

src_install() {
        exeinto /usr/bin
        doexe client/basc client/urandom.sh
        useq x86 && doexe client/smt-detect
        dodoc README ChangeLog TEAM
        dodir /etc/basc
}

pkg_postinst() {

        chown -R root:stats ${ROOT}/etc/basc
        chmod -R ug+rw ${ROOT}/etc/basc

        einfo
        if [ -f ${ROOT}/etc/basc/basc.gu ]
        then
                einfo "Benchmark data present. To re-run the benchmark execute:"
                einfo "\"ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild 
config\""
                einfo
                einfo "The Gentoo Buildtime and Statistics client can be 
started by"
                einfo "typing:"
                einfo
                einfo "  \"basc\""
                einfo
                einfo "Note:"
                einfo
                einfo "You have to be in the stats group to use the client!"
                einfo "A user can be added to the stats group by executing:"
                einfo
                einfo "  \"usermod -G \$(groups <ME> | sed -e 's/ /,/g'),stats 
<ME>\""
                einfo
                einfo "Replace <ME> with your username on the system."
                einfo "After a login, you are ready to use the client."
                einfo
                einfo "If you want to automatically launch the client every 
24h,"
                einfo "you must set up a cronjob for the stats user or a user 
in"
                einfo "the stats group."
                einfo
                einfo "For example:"
                einfo
                einfo "   \"0 0 * * * /usr/bin/basc -q -y >/dev/null 2>&1\""
                einfo
                einfo "will start the client every day at 00:00am"
                einfo
                ebeep
        else
                ewarn "Benchmark data not present. You will need to execute:"
                ewarn "\"ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild 
config\""
                ewarn "before using basc."
                einfo
                ebeep
                epause 2
        fi
}

pkg_config() {
        mkdir -p ${ROOT}/tmp/${PF}
        cd ${ROOT}/tmp/${PF}
        einfo
        einfo "I will benchmark your system now."
        einfo
        einfo "I'll download bash-3.0 now. This package is needed to "
        einfo "compile it as a benchmark for your system. It will not"
        einfo "be installed on your system. We only need to compile it,"
        einfo "to have the compiletime then as your GU for your system."
        einfo
        
        einfo "Downloading bash-3.0.tar.gz... please wait..."
        wget -q http://www.gentoo-stats.org/download/bash-3.0.tar.gz
        
        einfo "Unpacking bash-3.0.tar.gz... please wait..."
        tar -xzf bash-3.0.tar.gz
        cd bash-3.0
        
        einfo "Configuring bash-3.0... please wait..."
        /usr/bin/time -p -o ../configure.time -a ./configure >/dev/null 2>&1
        
        einfo "Compiling bash-3.0... please wait..."
        /usr/bin/time -p -o ../make.time -a make >/dev/null 2>&1
        
        einfo "Calculating your GU for your system..."
        cd ..
        CONFTIME=`cat ./configure.time 2>/dev/null | head -n 1 | sed -e 
's/^real \([^ ]*\)$/\1/'`
        MAKETIME=`cat ./make.time 2>/dev/null | head -n 1 | sed -e 's/^real 
\([^ ]*\)$/\1/'`
        GU=`echo "${CONFTIME} + ${MAKETIME}" | bc | cut -d "." -f 1`
        echo ${GU} > ./basc.gu
        cp ./basc.gu ${ROOT}/etc/basc/basc.gu
        
        einfo "Deleting these temporary files..."
        rm -fr ${ROOT}/tmp/${PF}
        
        einfo
        einfo "Benchmarking successfully finished."
        einfo 
        ewarn "Your GU: ${GU}"
        einfo 
        einfo "Now you can run basc by typing \"basc\"."
        einfo "To get help, type \"basc -h\"."  
        einfo
        einfo "Note:"
        einfo ""
        einfo "You have to be in the stats group to use the client!"
        einfo "A user can be added to the stats group by executing:"
        einfo ""
        einfo "  \"usermod -G \$(groups <ME> | sed -e 's/ /,/g'),stats <ME>\""
        einfo ""
        einfo "Replace <ME> with your username on the system."
        einfo "After a login, you are ready to use the client."
        einfo ""
        einfo "If you want to automatically launch the client every 24h,"
        einfo "you must set up a cronjob for the stats user or a user in"
        einfo "the stats group."
        einfo ""
        einfo "For example:"
        einfo ""
        einfo "   \"0 0 * * * /usr/bin/basc -q -y >/dev/null 2>&1\""
        einfo ""
        einfo "will start the client every day at 00:00am"
        einfo
        chown -R root:stats ${ROOT}/etc/basc
        chmod -R ug+rw ${ROOT}/etc/basc
}

Attachment: pgpSmcmgF7dNn.pgp
Description: PGP signature

Reply via email to