add old ebuilds from svn ub0rlay
[ub0rlay.git] / app-benchmarks / phoronix-test-suite / phoronix-test-suite-1.0.5.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 # TODO:
6 # * add installation of new documenation (README.html and documentation/) as real dodoc,
7 #   currently docs end inside the normal install path (/usr/share/phoronix-test-suite/documentation/)
8 # * switch SRC_URI to http://www.phoronix-test-suite.com/download.php?file=${P}.tar.gz
9 #   currently this is not done due to problems with the filename in src_unpack, but
10 #   thic change would allow using existing mirros for the package
11
12 inherit eutils depend.php
13
14 DESCRIPTION="Comprehensive testing and benchmarking platform"
15 HOMEPAGE="http://phoronix-test-suite.com"
16 SRC_URI="http://www.phoronix-test-suite.com/releases/${P}.tar.gz"
17
18 LICENSE="GPL-3"
19 SLOT="0"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="get-all-deps"
22
23 RDEPEND="sys-process/time
24                 sys-apps/lsb-release
25         get-all-deps? ( app-shells/tcsh
26                 dev-util/git
27                 dev-util/scons
28                 media-libs/glew
29                 media-libs/imlib2
30                 media-libs/jpeg
31                 >=media-libs/libpng-1.2
32                 >=media-libs/libsdl-1.2
33                 media-libs/portaudio
34                 >=media-libs/sdl-gfx-2.0
35                 >=media-libs/sdl-image-1.2
36                 >=media-libs/sdl-net-1.2
37                 >=media-libs/sdl-ttf-2.0
38                 sys-devel/bison
39                 sys-devel/flex
40                 virtual/glut
41                 >=virtual/jre-1.5
42                 x11-base/xorg-server
43                 >=x11-libs/gtk+-2 ) "
44 need_php_cli
45
46 S="${WORKDIR}/${PN}"
47
48 pkg_setup() {
49         has_php
50         require_php_with_use cli gd
51         if use get-all-deps && ! built_with_use sys-devel/gcc fortran ; then
52                 echo
53                 eerror "In order to be able to install all tests for the phoronix-test-suite you need to have"
54                 eerror "sys-devel/gcc emerged with \"fortran\" in your USE flag. Please add"
55                 eerror "that flag, re-emerge gcc, and then emerge phoronix-test-suite again."
56                 echo
57                 die "sys-devel/gcc not built with \"fortran\" support."
58         fi
59 }
60
61
62 src_unpack() {
63         unpack ${A}
64         cd ${S}
65         sed -i -e "s,export PTS_DIR=\`pwd\`,export PTS_DIR=\"/usr/share/${PN}\"," ${PN}
66 }
67
68 src_install() {
69         dodir /usr/share/${PN}
70         insinto /usr/share/${PN}
71         exeinto /usr/bin
72         doins -r ${S}/{documentation,pts,pts-core,README.html} || die "Install failed!"
73         fperms 755 /usr/share/${PN}/pts-core/scripts/launch-browser.sh
74         fperms 755 /usr/share/${PN}/pts/distro-scripts/*.sh
75         doexe phoronix-test-suite || die "Installing the executable failed!"
76         dodoc CHANGE-LOG
77 }
78
79 pkg_postinst() {
80         if use ! get-all-deps ; then
81                 elog "For several tests external dependencies are needed. You can"
82                 elog "easily install them with setting the useflag 'get-all-deps'."
83                 elog "When not having the deps installed, the testsuite will ask for"
84                 elog "the root password when installing tests that require external"
85                 elog "dependencies and install them systemwide via portage."
86                 elog "These are the possible deps:"
87                 elog "app-shells/tcsh"
88                 elog "dev-util/git"
89                 elog "dev-util/scons"
90                 elog "media-libs/glew"
91                 elog "media-libs/imlib2"
92                 elog "media-libs/jpeg"
93                 elog ">=media-libs/libpng-1.2"
94                 elog ">=media-libs/libsdl-1.2"
95                 elog "media-libs/portaudio"
96                 elog ">=media-libs/sdl-gfx-2.0"
97                 elog ">=media-libs/sdl-image-1.2"
98                 elog ">=media-libs/sdl-net-1.2"
99                 elog ">=media-libs/sdl-ttf-2.0"
100                 elog "sys-devel/bison"
101                 elog "sys-devel/flex"
102                 elog "sys-devel/gcc with fortran useflag active"
103                 elog "virtual/glut"
104                 elog ">=virtual/jre-1.5"
105                 elog "x11-base/xorg-server"
106                 elog ">=x11-libs/gtk+-2"
107         fi
108 }