View Single Post
Old 02-22-10, 07:29 AM   #243
Zooloo
Registered User
 
Join Date: Apr 2006
Posts: 1
Default Gentoo ebuild (packaging)

Hello,

I would like to thank crisalide for this useful tool, and also contribute myself a bit in making it easily installable under Gentoo. Therefore I wrote an ebuild for it, as I do not install anything unmanaged on my Gentoo systems. So for those who want to try it in a local overlay, paste the code below as qvdpautest-0.5.ebuild under the category x11-misc, generate the manifest, keyword if necessary and give it a go:
Code:
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit qt4-r2

DESCRIPTION="VDPAU benchmarking tool"

HOMEPAGE="http://www.nvnews.net/vbulletin/showthread.php?t=133465"

SRC_URI="http://hftom.free.fr/${P}.tar.gz"

LICENSE="LGPL-2.1"

SLOT="0"

KEYWORDS="~x86 ~amd64"

IUSE=""

DEPEND="x11-libs/libvdpau
        x11-libs/qt-gui:4"

RDEPEND="${DEPEND}"

S="${WORKDIR}/${PN}"

src_prepare() {
        cd ${S}
        echo "#!/bin/bash" > ${PN}.sh
        echo '' >> ${PN}.sh
        echo 'CURRDIR="$(pwd)"' >> ${PN}.sh
        echo "cd /usr/share/${PN}" >> ${PN}.sh
        echo "./${PN}-exec \"\$@\"" >> ${PN}.sh
        echo 'cd "${CURRDIR}"' >> ${PN}.sh
}

src_install() {
        newbin ${PN}.sh ${PN}
        dodoc README
        exeinto /usr/share/${PN}
        newexe ${PN} ${PN}-exec
        insinto /usr/share/${PN}
        doins *.dat
}
@crisalide: I'd have a question, would you mind if I submit the ebuild to the official Gentoo bugtracker? For that you should also specify the license model under which you're publishing your code, for now I just assumed LGPL-2.1 as you can see in the ebuild, but you're the one to decide this.
As for installing in a distribution, I had to overcome the fact that your utility only loads the test data from the current directory by installing the executable and the data files into /usr/share/qvdpautest, renaming the executable into qvdpautest-exec and explicitly calling that renamed executable by the batch the Gentoo ebuild generates and actually installs it as /usr/bin/qvdpautest:
Code:
#!/bin/bash

CURRDIR="$(pwd)"
cd /usr/share/qvdpautest
./qvdpautest-exec "$@"
cd "${CURRDIR}"
So, the currently installed files under Gentoo, are the following:
Code:
/usr/bin/qvdpautest
/usr/share/doc/qvdpautest-0.5/README.bz2
/usr/share/qvdpautest/h264720p.dat
/usr/share/qvdpautest/h264hd.dat
/usr/share/qvdpautest/mpeg4hd.dat
/usr/share/qvdpautest/mpg720p.dat
/usr/share/qvdpautest/mpghd.dat
/usr/share/qvdpautest/mpgsd.dat
/usr/share/qvdpautest/qvdpautest-exec
/usr/share/qvdpautest/vc1hd.dat
You may want to address these things in a future version. Other than that, thanks again for this tool, it does a good job!

Kind regards,
Lucian
Zooloo is offline   Reply With Quote