Part 6 Basic Installation

WARNING:
THESE ARE MY PERSONAL NOTES ON MY FIRST EBUILD.
THIS IS BY NO MEANS A USEFUL GUIDE OR ANYTHING SIMILAR TO ANYONE.
RTFM

I’ll try to write an ebuild from scratch and document the progress here.

Ebuild from scratch: Part 6: Basic installation

We successfully compiled the code in the last part, but nothing was installed yet.

Emerge: 1st Attempt

Just to see what happens, cleanup and emerge the package:
cd /usr/local/portage/dev-lang/peg-multimarkdown
ebuild peg-multimarkdown-9999.ebuild clean
emerge -av dev-lang/peg-multimarkdown

We are warned about keyword changes …
emerge -av --autounmask-write dev-lang/peg-multimarkdown
etc-update
emerge -av dev-lang/peg-multimarkdown

… something about empty dirs, let’s look for the binary:
find / -name 'multimarkdown'
it’s nowhere!

==> This doesn’t work straight away …

Unsuccessful Installation attempts

Gentoo Development Guide – src_install says the default function is a simple return-statement – it does nothing.

The mentioned “Sample src_install” is also no help, the Makefiledoes not contain an install-target.

I tried the copy-method in the first of the “Trivial Installs”-examples and ended up with my binary in the root-folder (/multimarkdown).

Successful Installation

The last example needs some further explanation, I found help here:
Gentoo Development Guide – Install Functions Reference.

So this is not so hard:

  • insinto /usr/bin : is where the binary shall go
  • dobin multimarkdown : install the binary multimarkdown

The modified ebuild file “/usr/local/portage/dev-lang/peg-multimarkdown/peg-multimarkdown-9999.ebuild” looks like this:

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=0

# project is hosted on github.com, so git-2 is needed (git is deprecated)
inherit git-2

DESCRIPTION="MMD is a superset of the Markdown syntax (more syntax features & output formats)"
HOMEPAGE="http://http://fletcherpenney.net/multimarkdown"
EGIT_REPO_URI="git://github.com/fletcher/peg-multimarkdown.git"
SRC_URI=""

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

src_install()
{
	insinto /usr/bin
	dobin multimarkdown || die "Install failed"
}

Recreate the manifest, clean up and retry emerging:
ebuild peg-multimarkdown-9999.ebuild manifest
ebuild peg-multimarkdown-9999.ebuild clean
emerge -av peg-multimarkdown
ls -alh /usr/bin/multimarkdown

… cool, the binary was installed.

Time to test the installation in the next part ….

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: