Re: simulating apt-get on gentoo

Jonathan Callen <[email protected]> Wed, 20 Apr 2016 19:59:33 -0400
Newsgroups gmane.linux.gentoo.amd64
Message-ID <[email protected]>
On 04/18/2016 10:11 PM, Daiajo Tibdixious wrote:
> dpkg has a native gentoo version app-arch/dpkg but dpkg --unpack gave an error.
> However ar x worked fine.
> Ended up with usr/bin/runescape-launcher which is fine, but also
> usr/share stuff which I'll check for collisions.
> (this is all in /var/tmp)
> 
> Thanks very much, you saved me much trouble.
> 
> Not sure if its just me, but apt is written in c++ using mostly C
> constructs, and doesn't seem to have been through an oo design.
> Makes it very weird to try to follow.
> 
> I won't be able to install/run it today due to being busy.
> 

Attached is my attempt at a proper ebuild for this package.  The
dependencies are based on what the deps *should* have been, not what the
.deb actually declares.  I haven't actually tested this fully.

-- 
Jonathan Callen
runescape-launcher-2.2.2.ebuild (text/plain, 1.7 KB)
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit eutils

DESCRIPTION="Official Linux client for RuneScape"
HOMEPAGE="http://www.runescape.com/"
SRC_URI="http://content.runescape.com/a=946/downloads/ubuntu/pool/non-free/r/${PN}/${PN}_${PV}_amd64.deb"

LICENSE="RuneScape-Launcher"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE=""

# The dependencies listed come from dpkg-shlibdeps output run in a Ubuntu
# Trusty chroot on the binary included in the package.  These match what
# upstream SHOULD have set the dependencies to.
DEPEND=""
RDEPEND="
	>=dev-libs/glib-2.24.0:2
	>=media-libs/libpng-1.2.13:1.2
	>=net-libs/webkit-gtk-1.3.10:2
	>=net-misc/curl-7.16.2
	>=sys-devel/gcc-4.4.0[cxx]
	>=sys-libs/glibc-2.15
	>=x11-libs/cairo-1.6.0
	>=x11-libs/gdk-pixbuf-2.22.0:2
	>=x11-libs/gtk+-2.24.0:2
	x11-libs/libSM
	x11-libs/libX11
	x11-libs/libXxf86vm
	>=x11-libs/pango-1.22.0
"

RESTRICT="strip"

S="${WORKDIR}"

src_unpack() {
	default
	unpack ./data.tar.xz
}

src_prepare() {
	sed -i -e "s@/usr/share/games/@${EPREFIX}/opt/@" usr/bin/${PN}
	sed -i -e "s@/usr/@${EPREFIX}/opt/@;/MimeType/s/\$/;/" usr/share/applications/${PN}.desktop

	default
}

src_install() {
	into /opt
	dobin usr/bin/${PN}

	exeinto /opt/${PN}
	doexe usr/share/games/${PN}/runescape

	insinto /opt/${PN}
	doins usr/share/games/${PN}/runescape.png

	insinto /usr/share/applications
	doins usr/share/applications/${PN}.desktop

	for size in 16 24 32 48 64 256 512; do
		doicon -s ${size} usr/share/icons/hicolor/${size}x${size}/apps/runescape.png
	done

	insinto /usr/share/kde4/services
	doins usr/share/kde4/services/*.protocol

	dodoc usr/share/doc/${PN}/changelog.gz
}
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJXGBfqAAoJEEIQbvYRB3mgeskP/RxKQvYPfL21A+PCt3UzEQtL
279PsVjpCMBmgkQlr7sG7VDkRGb9A2s7cBbMJV3/2zc6k3VkuJd4+1z0edseMoIi
MhObQA3WyLtAgcbuOM/0I1XA+1BDzTrGZbZ79d2/LzxwOGtgHQcIwARi+SulG72c
CNnM/BNTWNJvMNgq9mxLOrw9FuZl/cfEhMFagmQU/MoChAeHBb7HP450jiWlI1aD
1UBVhXyZcKWPMPL91HhTv2W84Wks9/9q6AVKJ9bv0fWw6CdNpmOVfT6Gv4HgrnPS
TwuQ7faYuQ6etuG/3dW4JqMHmN4VJ8cjz4GgjbGUY5pycao4FUiGNtqhqGXh1gt9
2TBmYZBCz55AWhAOERe2FPOxm/X7ACQPVZT0hHel1pY1v/wB/CyUfuwmS0Pt6+uH
+qsTRvXSn7sgNm3q12Vt4heqn2LeObbIKWqkLYLlpiElv7OrygStC/8PxhrCRHtu
4CRfpundxXoAqJSwnDEqVvnn+CHGo3GFIebHb2tbyK/+VI5KGbHkmy+IsXwiTtbA
FzSGOnDP+JKVwZm2waAhQ3ob3t9hLcyrcNofPuMCevs4DSkj89o+C726utRHkGAq
N81M6nUbgyp3O2lTzJI9byuJD/W8+KSX7GyuA34hKkannLzIx4+6QPoSi2/lG3W5
x0L9loQZptVwvLBPJPQL
=bJ3O
-----END PGP SIGNATURE-----