Mailing List Archive

simulating apt-get on gentoo
A package I wish to download has these instructions:

wget -O - http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
| apt-key add -
mkdir -p /etc/apt/sources.list.d
echo "deb http://content.runescape.com/a=946/downloads/ubuntu trusty
non-free" > /etc/apt/sources.list.d/runescape.list
apt-get update
apt-get install -y runescape-launcher

I have downloaded the apt sources and have been reading it. However
its fairly large &
complex which will take me a while to figure out.
The gpg key was fairly easy, but I don't see how apt-get uses it yet.
I also don't see how apt gets the list of files to download, since
there is only a directory given.
I can't displayhttp://content.runescape.com/a=946/downloads/ubuntu in a browser.

Just wondering if anyone has anything helpful to shorten the process
of figuring it out.
I'm planning to create a cut down apt-get which just fetches the
files, but don't have much time most days.
Re: simulating apt-get on gentoo [ In reply to ]
On Mon, Apr 18, 2016 at 5:40 AM, Daiajo Tibdixious <daiajo@gmail.com> wrote:

> A package I wish to download has these instructions:
>
> wget -O -
> http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
> | apt-key add -
> mkdir -p /etc/apt/sources.list.d
> echo "deb http://content.runescape.com/a=946/downloads/ubuntu trusty
> non-free" > /etc/apt/sources.list.d/runescape.list
> apt-get update
> apt-get install -y runescape-launcher
>
> I have downloaded the apt sources and have been reading it. However
> its fairly large &
> complex which will take me a while to figure out.
> The gpg key was fairly easy, but I don't see how apt-get uses it yet.
> I also don't see how apt gets the list of files to download, since
> there is only a directory given.
> I can't displayhttp://content.runescape.com/a=946/downloads/ubuntu in a
> browser.
>
> Just wondering if anyone has anything helpful to shorten the process
> of figuring it out.
> I'm planning to create a cut down apt-get which just fetches the
> files, but don't have much time most days.
>
>
In my experience if you're running Gentoo you're better off staying in the
Gentoo
package framework and finding the app you want in a portage overlay:

https://gpo.zugaina.org/games-rpg/unix-runescape-client
Re: simulating apt-get on gentoo [ In reply to ]
I have that for the (now) old java client/launcher. Jagex released a
new client/launcher called NXT which doesn't have that yet.
If I can get the files I'll have a go at writing an ebuild (and other
stuff) and try to get them to make a
gentoo package.
Tempted to put Ubuntu on my old comp, install it there to work out the
files & locations.

On Mon, Apr 18, 2016 at 10:49 PM, Mark Knecht <markknecht@gmail.com> wrote:
>
>
> On Mon, Apr 18, 2016 at 5:40 AM, Daiajo Tibdixious <daiajo@gmail.com> wrote:
>>
>> A package I wish to download has these instructions:
>>
>> wget -O -
>> http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
>> | apt-key add -
>> mkdir -p /etc/apt/sources.list.d
>> echo "deb http://content.runescape.com/a=946/downloads/ubuntu trusty
>> non-free" > /etc/apt/sources.list.d/runescape.list
>> apt-get update
>> apt-get install -y runescape-launcher
>>
>> I have downloaded the apt sources and have been reading it. However
>> its fairly large &
>> complex which will take me a while to figure out.
>> The gpg key was fairly easy, but I don't see how apt-get uses it yet.
>> I also don't see how apt gets the list of files to download, since
>> there is only a directory given.
>> I can't displayhttp://content.runescape.com/a=946/downloads/ubuntu in a
>> browser.
>>
>> Just wondering if anyone has anything helpful to shorten the process
>> of figuring it out.
>> I'm planning to create a cut down apt-get which just fetches the
>> files, but don't have much time most days.
>>
>
> In my experience if you're running Gentoo you're better off staying in the
> Gentoo
> package framework and finding the app you want in a portage overlay:
>
> https://gpo.zugaina.org/games-rpg/unix-runescape-client
Re: simulating apt-get on gentoo [ In reply to ]
On 04/18/2016 08:49 AM, Mark Knecht wrote:
> On Mon, Apr 18, 2016 at 5:40 AM, Daiajo Tibdixious
> <daiajo@gmail.com> wrote:
>
>> A package I wish to download has these instructions:
>>
>> wget -O -
>> http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
>>
>>
| apt-key add -
>> mkdir -p /etc/apt/sources.list.d echo "deb
>> http://content.runescape.com/a=946/downloads/ubuntu trusty
>> non-free" > /etc/apt/sources.list.d/runescape.list apt-get
>> update apt-get install -y runescape-launcher
>>
>> I have downloaded the apt sources and have been reading it.
>> However its fairly large & complex which will take me a while to
>> figure out. The gpg key was fairly easy, but I don't see how
>> apt-get uses it yet. I also don't see how apt gets the list of
>> files to download, since there is only a directory given. I can't
>> displayhttp://content.runescape.com/a=946/downloads/ubuntu in a
>> browser.
>>
>> Just wondering if anyone has anything helpful to shorten the
>> process of figuring it out. I'm planning to create a cut down
>> apt-get which just fetches the files, but don't have much time
>> most days.
>>
>>
> In my experience if you're running Gentoo you're better off staying
> in the Gentoo package framework and finding the app you want in a
> portage overlay:
>
> https://gpo.zugaina.org/games-rpg/unix-runescape-client
>

To approximate what the apt-get client actually does; first download
"http://content.runescape.com/a=946/downloads/ubuntu/trusty/Release"
(URL given + distversion + "/Release); note the MD5/SHA1/SHA256 checksums.

Download the 64-bit Packages file from
"http://content.runescape.com/a=946/downloads/ubuntu/dists/trusty/non-free/binary-amd64/Packages",
this will give the name/version/dependencies for every package
distributed from that repo.

From that file, find the "Filename:" field, append that directly to
the URL they gave, so
"http://content.runescape.com/a=946/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.2_amd64.deb".

This file declares the following dependencies:

Ubuntu
Gentoo Equivalent
libsdl2-2.0-0 (>= 2.0.2+dfsg1-3ubuntu1.1)
>=media-libs/libsdl2-2.0.2
[This doesn't appear to actually be used by the executable]
libglew1.10 (>= 1.10.0-3)
>=media-libs/glew-1.10.0:0/1.10
[This doesn't appear to actually be used by the executable]
libc6 (>= 2.19-0ubuntu6.6)
>=sys-libs/glibc-2.19
libcurl3-gnutls (>= 7.35.0-1ubuntu2.5)
>=net-misc/curl-7.35.0
libstdc++6 (>= 4.8.4-2ubuntu1~14.04)
>=sys-devel/gcc-4.8.4[cxx]
libgcc1 (>= 1:4.9.1-0ubuntu1)
>=sys-devel/gcc-4.9.1
libvorbisenc2 (>= 1.3.2-1.3ubuntu1)
>=media-libs/libvorbis-1.3.2
[This doesn't appear to actually be used by the executable]
libwebkitgtk-1.0-0 (>= 2.4.8-1ubuntu1~ubuntu14.04.1)
>=net-libs/webkit-gtk-2.4.8:2 (I think)

The package also depends on the following shared libraries, not
exposed above:

dev-libs/glib:2
libglib-2.0.so.0
libgobject-2.0.so.0
media-libs/libpng:1.2
libpng12.so.0
x11-libs/libXxf86vm
libXxf86vm.so.1
x11-libs/gtk+:2
libgdk-x11-2.0.so.0
libgtk-x11-2.0.so.0
x11-libs/gdk-pixbuf:2
libgdk_pixbuf-2.0.so.0
x11-libs/libX11
libX11.so.6
x11-libs/cairo
libcairo.so.2
x11-libs/libSM
libSM.so.6
x11-libs/pango
libpango-1.0.so.0
libpangocairo-1.0.so.0

To extract the .deb, if you don't have dpkg installed, you can use `ar
x ./runescape-launcher_2.2.2_amd64.deb data.tar.xz` to get a tarball
named "data.tar.xz" that contains the actual binary package.

Note that the only thing that was really Gentoo-specific in the above
was the mapping of libraries to package names/slots/versions.
Everything else is "Generic Linux amd64" :).

--
Jonathan Callen
Re: Re: simulating apt-get on gentoo [ In reply to ]
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.

On Tue, Apr 19, 2016 at 10:56 AM, Jonathan Callen <jcallen@gentoo.org> wrote:
> On 04/18/2016 08:49 AM, Mark Knecht wrote:
>> On Mon, Apr 18, 2016 at 5:40 AM, Daiajo Tibdixious
>> <daiajo@gmail.com> wrote:
>>
>>> A package I wish to download has these instructions:
>>>
>>> wget -O -
>>> http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
>>>
>>>
> | apt-key add -
>>> mkdir -p /etc/apt/sources.list.d echo "deb
>>> http://content.runescape.com/a=946/downloads/ubuntu trusty
>>> non-free" > /etc/apt/sources.list.d/runescape.list apt-get
>>> update apt-get install -y runescape-launcher
>>>
>>> I have downloaded the apt sources and have been reading it.
>>> However its fairly large & complex which will take me a while to
>>> figure out. The gpg key was fairly easy, but I don't see how
>>> apt-get uses it yet. I also don't see how apt gets the list of
>>> files to download, since there is only a directory given. I can't
>>> displayhttp://content.runescape.com/a=946/downloads/ubuntu in a
>>> browser.
>>>
>>> Just wondering if anyone has anything helpful to shorten the
>>> process of figuring it out. I'm planning to create a cut down
>>> apt-get which just fetches the files, but don't have much time
>>> most days.
>>>
>>>
>> In my experience if you're running Gentoo you're better off staying
>> in the Gentoo package framework and finding the app you want in a
>> portage overlay:
>>
>> https://gpo.zugaina.org/games-rpg/unix-runescape-client
>>
>
> To approximate what the apt-get client actually does; first download
> "http://content.runescape.com/a=946/downloads/ubuntu/trusty/Release"
> (URL given + distversion + "/Release); note the MD5/SHA1/SHA256 checksums.
>
> Download the 64-bit Packages file from
> "http://content.runescape.com/a=946/downloads/ubuntu/dists/trusty/non-free/binary-amd64/Packages",
> this will give the name/version/dependencies for every package
> distributed from that repo.
>
> From that file, find the "Filename:" field, append that directly to
> the URL they gave, so
> "http://content.runescape.com/a=946/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.2_amd64.deb".
>
> This file declares the following dependencies:
>
> Ubuntu
> Gentoo Equivalent
> libsdl2-2.0-0 (>= 2.0.2+dfsg1-3ubuntu1.1)
> >=media-libs/libsdl2-2.0.2
> [This doesn't appear to actually be used by the executable]
> libglew1.10 (>= 1.10.0-3)
> >=media-libs/glew-1.10.0:0/1.10
> [This doesn't appear to actually be used by the executable]
> libc6 (>= 2.19-0ubuntu6.6)
> >=sys-libs/glibc-2.19
> libcurl3-gnutls (>= 7.35.0-1ubuntu2.5)
> >=net-misc/curl-7.35.0
> libstdc++6 (>= 4.8.4-2ubuntu1~14.04)
> >=sys-devel/gcc-4.8.4[cxx]
> libgcc1 (>= 1:4.9.1-0ubuntu1)
> >=sys-devel/gcc-4.9.1
> libvorbisenc2 (>= 1.3.2-1.3ubuntu1)
> >=media-libs/libvorbis-1.3.2
> [This doesn't appear to actually be used by the executable]
> libwebkitgtk-1.0-0 (>= 2.4.8-1ubuntu1~ubuntu14.04.1)
> >=net-libs/webkit-gtk-2.4.8:2 (I think)
>
> The package also depends on the following shared libraries, not
> exposed above:
>
> dev-libs/glib:2
> libglib-2.0.so.0
> libgobject-2.0.so.0
> media-libs/libpng:1.2
> libpng12.so.0
> x11-libs/libXxf86vm
> libXxf86vm.so.1
> x11-libs/gtk+:2
> libgdk-x11-2.0.so.0
> libgtk-x11-2.0.so.0
> x11-libs/gdk-pixbuf:2
> libgdk_pixbuf-2.0.so.0
> x11-libs/libX11
> libX11.so.6
> x11-libs/cairo
> libcairo.so.2
> x11-libs/libSM
> libSM.so.6
> x11-libs/pango
> libpango-1.0.so.0
> libpangocairo-1.0.so.0
>
> To extract the .deb, if you don't have dpkg installed, you can use `ar
> x ./runescape-launcher_2.2.2_amd64.deb data.tar.xz` to get a tarball
> named "data.tar.xz" that contains the actual binary package.
>
> Note that the only thing that was really Gentoo-specific in the above
> was the mapping of libraries to package names/slots/versions.
> Everything else is "Generic Linux amd64" :).
>
> --
> Jonathan Callen
>
Re: simulating apt-get on gentoo [ In reply to ]
Daiajo Tibdixious posted on Mon, 18 Apr 2016 22:40:08 +1000 as excerpted:

> A package I wish to download has these instructions:
>
> wget -O -
> http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
> | apt-key add -

That, and each of the following, are effectively single command-lines,
one each, only wrapped here, as they would be on a limited-width
terminal, for purposes of display.

That line simply adds the linked gpg key to apt's keys file, presumably
so it can validate the later package as a validly signed package.

Of course the key fetch is using unsecured http, not https, so it's not
as if the key really provides much actual security, since anyone with
access to the connection could substitute a fake key, but that's more or
less beside the point. The point would be that apt wants packages signed
by keys it trusts, and that adds said key to the appropriate trusted key
store, regardless of whether the key has actually been verified as
trustworthy.

> mkdir -p /etc/apt/sources.list.d

Makes (if it doesn't already exist) that local dir, used in the next
command.

> echo "deb http://content.runescape.com/a=946/downloads/ubuntu trusty
> non-free" > /etc/apt/sources.list.d/runescape.list

Just to make it explicit, that ">" between non-free and /etc/apt/... is
output redirection in the original command, not just a misplaced quote
character.

This creates a file "runescape.list" in the directory created by the mkdir
above, with one line of content:

deb http://content.runescape.com/a=946/downloads/ubuntu trusty non-free

Presumably, the "deb" on that line tells apt what format the repo is in,
the link tells apt where it's at and the protocol to use, "trusty" tells
it what version of ubuntu it's for, and non-free tells it the (Debian/
Ubuntu/apt) license status.

> apt-get update

This will be their equivalent of portage's emerge --sync command. It'll
sync all configured repos, including the one just configured above, with
that /etc/apt/sources.list.d/runescape.list file and its content.

> apt-get install -y runescape-launcher

With the local apt set of repos synced by the above, this installs the
actual package, runescape-launcher.


> I have downloaded the apt sources and have been reading it. However its
> fairly large & complex which will take me a while to figure out.

No kidding. You'd not expect someone to download and read the portage
sources to figure out how to manually install a package from an ebuild,
would you? Sure it should work... provided you're technically literate
and patient enough, but it's definitely the long way around.

All you need is a basic general understanding of what package managers
/do/, a look at the instructions provided, and if necessary, a look at
the package manager's manpage, etc, tho that's not really necessary here.

FWIW I've never run a Debian-based distro, tho for about three years
before I switched to gentoo in 2004, I ran Mandrake, an RPM-based
distro. My rpm foo is thus well over a decade out of date and is rpm,
not deb, but it does give me experience with a second package manager,
one from a binary-based distro, to compare against portage and gentoo as
a from-source package manager and distro, and that, coupled with a
general familiarity with how Unix-style commandlines and bash as a shell
work, is enough to decipher the above.

> The gpg key was fairly easy, but I don't see how apt-get uses it yet.

As with most such things, it's simply a corruption detection and
authenticity verification thing. It's likely possible to turn off such
checks in apt-get's options, but doing so for other than perhaps one's
own local repo/overlay would be highly discouraged, and the above
procedure, while not really secure because the key was fetched using
insecure means, does at least still do integrity verification, which is
what verification of unauthenticated signatures effectively amounts to.

But presumably you can simply gpgverify the package once you download it
manually, skipping figuring out the precise gpg-verification code in apt-
get. Or even skip the verification entirely...

> I also don't see how apt gets the list of files to download, since there
> is only a directory given.
> I can't display http://content.runescape.com/a=946/downloads/ubuntu in a
> browser.

Presumably, apt-get update simply fetches some standardized repository
index or database file from that location, which then lists the packages,
etc, in a way that apt-get can read them and fetch specific packages when
necessary.

Now *here* you might need to go diving into apt-get's workings a bit
deeper, but presumably there's a manpage and/or other repository layout
documentation available, so you don't need to read the actual sources
unless you want to.

Meanwhile, we already know the package name, runescape-launcher, from the
above instructions. And the package will be a deb file.

What we don't know yet is the version information part of the filename,
and if there's any subdirs, like gentoo's categories, between the root of
the repo and the package file we're actually trying to download.

To use a gentoo example, suppose the package we were looking for was gcc.
We know the package name, gcc, and the likely extension, .ebuild, but we
don't know that it's in a subdir named sys-devel, yet, instead of
possibly just a g (first letter of gcc) subdir, or perhaps a build or
devel subdir/category instead of sys-devel, or maybe sorted by some other
means like first letter of say a 256-bit hash value of the package,
expressed in hexadecimal form.[1] And we don't know the version part,
say -5.3.0 of the gcc-5.3.0 that I have installed here, either.

You may have to either take an educated guess at the missing parts (maybe
you know the version info or can find it in google), or get them from the
repo database after reading up on its documentation or the like.

But before that, it's also possible that you can find a reference to the
specific path, or find the *.deb file elsewhere.

You can also very likely take valuable hints from the older overlay ebuild
that Mark linked, despite it being the old java-based launcher. Looks
like the homepage is a github repo, with the latest 4.3.5 releases tagged
on Sep 21, 2015, with the latest commit on master on Feb 2, changing the
downloads to https from http, so it seems active still.

Meanwhile, a dumb search on "runescape" at github reveals nearly 700
repos. Of course many look to be runescape bots or the like, and many of
them will no doubt be for other platforms, but a smarter search could
probably narrow it down. Anyway, 50 of those projects have been updated
in the last 30 days, a reasonable activity metric. A perhaps smarter
search on runescape launcher lists 70-some projects, tho most appear to
use the old launcher or at least be written in java. Unfortunately, no
github hits on runescape nxt yet. =:^(

> Just wondering if anyone has anything helpful to shorten the process of
> figuring it out.
> I'm planning to create a cut down apt-get which just fetches the files,
> but don't have much time most days.

Well, this doesn't do all the work, but it should get you well beyond the
figuring out what apt-get does with the signature file stage, at least.
=:^)

---
[1] Back in the day, myspace was using a scheme similar to this to index
and store the myspace user images, including so-called "private" images,
and someone figured out the scheme and brute-forced the entire namespace,
resulting in an archive some 17 gigs or so in size of all those pictures,
that was torrented out for anyone interested. Of course this was in an
era where 100 GiB hard drives were still considered huge and connections
were normally sub-megabit, so this was no small undertaking, even just
doing the torrent, let alone the work to actually mine the entire
namespace in question. I still have a copy around somewhere, and have
actually looked thru IIRC about 1/8 of 1/16 of it (all the 000* thru 01f*
images).

--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
Re: simulating apt-get on gentoo [ In reply to ]
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
Re: Re: simulating apt-get on gentoo [ In reply to ]
Thanks very much for that. I managed to get the fetch & unpack
working, but nothing
I tried for src_install worked, and your code is much neater than mine.

On Thu, Apr 21, 2016 at 9:59 AM, Jonathan Callen <jcallen@gentoo.org> wrote:
> 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
Re: Re: simulating apt-get on gentoo [ In reply to ]
Got src_install working except for mysterious (to me) problem:
src_install () {
into /opt
dobin usr/bin/runescape-launcher

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

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

insinto /usr/share/applications
doins usr/share/applications/runescape-launcher.desktop

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

dodoc usr/share/doc/runescape-launcher/changelog.gz

# usr/share/doc/runescape-launcher/copyright

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
}

Everything works fine except for the 2 protocol files:
# find /var/tmp/portage/games-rpg/RuneScape-2.2.2/image -name "*.protocol"
/var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/rs-launchs.protocol
/var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/rs-launch.protocol

Despite saying insinto kde4 services, they go into applications, which
is the previous location.

On Thu, Apr 21, 2016 at 12:58 PM, Daiajo Tibdixious <daiajo@gmail.com> wrote:
> Thanks very much for that. I managed to get the fetch & unpack
> working, but nothing
> I tried for src_install worked, and your code is much neater than mine.
>
> On Thu, Apr 21, 2016 at 9:59 AM, Jonathan Callen <jcallen@gentoo.org> wrote:
>> 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
Re: Re: simulating apt-get on gentoo [ In reply to ]
I found (buy running with --debug) that its not running my changed ebuild.
I had to do ebuild clean phase & run from the beginning each time to
make it see any changes.

On Fri, Apr 22, 2016 at 1:28 PM, Daiajo Tibdixious <daiajo@gmail.com> wrote:
> Got src_install working except for mysterious (to me) problem:
> src_install () {
> into /opt
> dobin usr/bin/runescape-launcher
>
> exeinto /opt/${PN}
> doexe usr/share/games/runescape-launcher/runescape
>
> insinto /opt/${PN}
> doins usr/share/games/runescape-launcher/runescape.png
>
> insinto /usr/share/applications
> doins usr/share/applications/runescape-launcher.desktop
>
> insinto /usr/share/kde4/services
> doins usr/share/kde4/services/*.protocol
>
> dodoc usr/share/doc/runescape-launcher/changelog.gz
>
> # usr/share/doc/runescape-launcher/copyright
>
> 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
> }
>
> Everything works fine except for the 2 protocol files:
> # find /var/tmp/portage/games-rpg/RuneScape-2.2.2/image -name "*.protocol"
> /var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/rs-launchs.protocol
> /var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/rs-launch.protocol
>
> Despite saying insinto kde4 services, they go into applications, which
> is the previous location.
>
> On Thu, Apr 21, 2016 at 12:58 PM, Daiajo Tibdixious <daiajo@gmail.com> wrote:
>> Thanks very much for that. I managed to get the fetch & unpack
>> working, but nothing
>> I tried for src_install worked, and your code is much neater than mine.
>>
>> On Thu, Apr 21, 2016 at 9:59 AM, Jonathan Callen <jcallen@gentoo.org> wrote:
>>> 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
Re: simulating apt-get on gentoo [ In reply to ]
Daiajo Tibdixious posted on Fri, 22 Apr 2016 20:01:24 +1000 as excerpted:

> I found (buy running with --debug) that its not running my changed
> ebuild.
> I had to do ebuild clean phase & run from the beginning each time to
> make it see any changes.

Yeah. Once you're working with ebuild, not emerge, you normally need to
run ebuild <ebuild> clean to start over. IIRC emerge has a keep-work
feature that will normally do the same thing, and of course if an ebuild
fails it usually keeps it for you to look at, but by default emerge will
clean up old work before it starts a new merge of the same package, while
with ebuild you have to tell it to do so.

With ebuild it is also possible to delete individual ebuild phase tracker
files (like .unpacked, .setuped, .prepared, .configured, .compiled,
.installed, etc, in the ebuild's tmpdir) in ordered to have it back up
part way, not starting completely over, but starting over at a particular
phase.

I suppose most gentooers used to troubleshooting their own ebuild
problems and sometimes generating their own patches get familiar with
this sort of stuff over time. I know I have.

--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
Re: Re: simulating apt-get on gentoo [ In reply to ]
On Thu, Apr 21, 2016 at 8:28 PM, Daiajo Tibdixious <daiajo@gmail.com> wrote:
>
> Got src_install working except for mysterious (to me) problem:
> src_install () {
> into /opt
> dobin usr/bin/runescape-launcher
>
> exeinto /opt/${PN}
> doexe usr/share/games/runescape-launcher/runescape
>
> insinto /opt/${PN}
> doins usr/share/games/runescape-launcher/runescape.png
>
> insinto /usr/share/applications
> doins usr/share/applications/runescape-launcher.desktop
>
> insinto /usr/share/kde4/services
> doins usr/share/kde4/services/*.protocol

The insinto is the "to", the doins is the "from" - since the files are
installed in the image at:

/var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/*.protocol

they're not being found by your doins, as it's looking for them at:

/var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/kde4/services/*.protocol

IOW, try:

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

>
> dodoc usr/share/doc/runescape-launcher/changelog.gz
>
> # usr/share/doc/runescape-launcher/copyright
>
> 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
> }
>
> Everything works fine except for the 2 protocol files:
> # find /var/tmp/portage/games-rpg/RuneScape-2.2.2/image -name "*.protocol"
> /var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/rs-launchs.protocol
> /var/tmp/portage/games-rpg/RuneScape-2.2.2/image/usr/share/applications/rs-launch.protocol
>
> Despite saying insinto kde4 services, they go into applications, which
> is the previous location.
>
> On Thu, Apr 21, 2016 at 12:58 PM, Daiajo Tibdixious <daiajo@gmail.com> wrote:
> > Thanks very much for that. I managed to get the fetch & unpack
> > working, but nothing
> > I tried for src_install worked, and your code is much neater than mine.
> >
> > On Thu, Apr 21, 2016 at 9:59 AM, Jonathan Callen <jcallen@gentoo.org> wrote:
> >> 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
>
Re: Re: simulating apt-get on gentoo [ In reply to ]
Sorry to come back to this.
I have a working ebuild, in the sense that I can install/remove using
emerge, however the NXT client crashes a few second after starting
with no error message.
I don't expect you to help with the crash.

The links you gave for Packages & the .deb file are still working but
the Release one is not.
I've tried
wget http://content.runescape.com/a=946/downloads/ubuntu/trusty/Release
wget https://content.runescape.com/a=946/downloads/ubuntu/trusty/Release
wget https://content.runescape.com/downloads/ubuntu/trusty/non-free/Release
All give 404 not found.

I'm after a way to tell if they have bumped the version number,
because its not on their download page.

On Tue, Apr 19, 2016 at 10:56 AM, Jonathan Callen <jcallen@gentoo.org> wrote:
> On 04/18/2016 08:49 AM, Mark Knecht wrote:
>> On Mon, Apr 18, 2016 at 5:40 AM, Daiajo Tibdixious
>> <daiajo@gmail.com> wrote:
>>
>>> A package I wish to download has these instructions:
>>>
>>> wget -O -
>>> http://content.runescape.com/a=946/downloads/ubuntu/runescape.gpg.key
>>>
>>>
> | apt-key add -
>>> mkdir -p /etc/apt/sources.list.d echo "deb
>>> http://content.runescape.com/a=946/downloads/ubuntu trusty
>>> non-free" > /etc/apt/sources.list.d/runescape.list apt-get
>>> update apt-get install -y runescape-launcher
>>>
>>> I have downloaded the apt sources and have been reading it.
>>> However its fairly large & complex which will take me a while to
>>> figure out. The gpg key was fairly easy, but I don't see how
>>> apt-get uses it yet. I also don't see how apt gets the list of
>>> files to download, since there is only a directory given. I can't
>>> displayhttp://content.runescape.com/a=946/downloads/ubuntu in a
>>> browser.
>>>
>>> Just wondering if anyone has anything helpful to shorten the
>>> process of figuring it out. I'm planning to create a cut down
>>> apt-get which just fetches the files, but don't have much time
>>> most days.
>>>
>>>
>> In my experience if you're running Gentoo you're better off staying
>> in the Gentoo package framework and finding the app you want in a
>> portage overlay:
>>
>> https://gpo.zugaina.org/games-rpg/unix-runescape-client
>>
>
> To approximate what the apt-get client actually does; first download
> "http://content.runescape.com/a=946/downloads/ubuntu/trusty/Release"
> (URL given + distversion + "/Release); note the MD5/SHA1/SHA256 checksums.
>
> Download the 64-bit Packages file from
> "http://content.runescape.com/a=946/downloads/ubuntu/dists/trusty/non-free/binary-amd64/Packages",
> this will give the name/version/dependencies for every package
> distributed from that repo.
>
> From that file, find the "Filename:" field, append that directly to
> the URL they gave, so
> "http://content.runescape.com/a=946/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.2_amd64.deb".
>
> This file declares the following dependencies:
>
> Ubuntu
> Gentoo Equivalent
> libsdl2-2.0-0 (>= 2.0.2+dfsg1-3ubuntu1.1)
> >=media-libs/libsdl2-2.0.2
> [This doesn't appear to actually be used by the executable]
> libglew1.10 (>= 1.10.0-3)
> >=media-libs/glew-1.10.0:0/1.10
> [This doesn't appear to actually be used by the executable]
> libc6 (>= 2.19-0ubuntu6.6)
> >=sys-libs/glibc-2.19
> libcurl3-gnutls (>= 7.35.0-1ubuntu2.5)
> >=net-misc/curl-7.35.0
> libstdc++6 (>= 4.8.4-2ubuntu1~14.04)
> >=sys-devel/gcc-4.8.4[cxx]
> libgcc1 (>= 1:4.9.1-0ubuntu1)
> >=sys-devel/gcc-4.9.1
> libvorbisenc2 (>= 1.3.2-1.3ubuntu1)
> >=media-libs/libvorbis-1.3.2
> [This doesn't appear to actually be used by the executable]
> libwebkitgtk-1.0-0 (>= 2.4.8-1ubuntu1~ubuntu14.04.1)
> >=net-libs/webkit-gtk-2.4.8:2 (I think)
>
> The package also depends on the following shared libraries, not
> exposed above:
>
> dev-libs/glib:2
> libglib-2.0.so.0
> libgobject-2.0.so.0
> media-libs/libpng:1.2
> libpng12.so.0
> x11-libs/libXxf86vm
> libXxf86vm.so.1
> x11-libs/gtk+:2
> libgdk-x11-2.0.so.0
> libgtk-x11-2.0.so.0
> x11-libs/gdk-pixbuf:2
> libgdk_pixbuf-2.0.so.0
> x11-libs/libX11
> libX11.so.6
> x11-libs/cairo
> libcairo.so.2
> x11-libs/libSM
> libSM.so.6
> x11-libs/pango
> libpango-1.0.so.0
> libpangocairo-1.0.so.0
>
> To extract the .deb, if you don't have dpkg installed, you can use `ar
> x ./runescape-launcher_2.2.2_amd64.deb data.tar.xz` to get a tarball
> named "data.tar.xz" that contains the actual binary package.
>
> Note that the only thing that was really Gentoo-specific in the above
> was the mapping of libraries to package names/slots/versions.
> Everything else is "Generic Linux amd64" :).
>
> --
> Jonathan Callen
>
Re: simulating apt-get on gentoo [ In reply to ]
On 05/02/2016 07:00 PM, Daiajo Tibdixious wrote:
> Sorry to come back to this.
> I have a working ebuild, in the sense that I can install/remove using
> emerge, however the NXT client crashes a few second after starting
> with no error message.
> I don't expect you to help with the crash.
>
> The links you gave for Packages & the .deb file are still working but
> the Release one is not.
> I've tried
> wget http://content.runescape.com/a=946/downloads/ubuntu/trusty/Release
> wget https://content.runescape.com/a=946/downloads/ubuntu/trusty/Release
> wget https://content.runescape.com/downloads/ubuntu/trusty/non-free/Release
> All give 404 not found.
>
> I'm after a way to tell if they have bumped the version number,
> because its not on their download page.
>


As the instructions they gave changed, the method to get the initial
"Release" file also changed. The new file is at:

<https://content.runescape.com/downloads/ubuntu/dists/trusty/Release>

This then points to a Packages file at:

<https://content.runescape.com/downloads/ubuntu/dists/trusty/non-free/binary-amd64/Packages>

This in turn points to the new location of the (hopefully) same .deb
archive, at:

<https://content.runescape.com/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.2_amd64.deb>

To construct these URLs, I took the line given for the configuration of
apt, which is:

deb https://content.runescape.com/downloads/ubuntu/ trusty non-free

Starting with the URL given
(<https://content.runescape.com/downloads/ubuntu/>), add
<dists/{dist}/Release> (in this case <dists/trusty/Release>) to get the
Release file. The Release file points to Packages files located in
subdirectories of the directory containing Release; the appropriate file
would be under <{component}/binary-{arch}> (so <non-free/binary-amd64>).
Each Packages file then lists the metadata for each version of each
package that is currently available as part of that dist/component/arch,
all of which reside under <pool/{component}> under the main URL. The
actual directory structure is always
<pool/{component}/{first-letter-of-src-pkg}/{src-pkg}/{binary-pkg}_{version}_{arch}.deb>,
unless {src-pkg} begins with the letters "lib", in which case it uses a
subdirectory named after the first four characters in {src-pkg} instead.

For a more complete view of how the repository is structured, you may
want to browse http://ftp.debian.org/debian/ or
http://archive.ubuntu.org/ubuntu/, which are the roots of Debian and
Ubuntu's repositories, respectively. Note that in some cases, the
Packages files are only available compressed (as Packages.gz or
Packages.bz2).

--
Jonathan Callen