sipX on Gentoo
We have created the Gentoo Linux ebuilds to install
sipX on Gentoo Linux.
The following pages document the process.
Note: this is work in progress.
Anatomy of a Gentoo Linux Ebuild
For every package in Gentoo there is at least one ebuild.
Ebuilds are scripts that build packages from source.
Header
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
Ebuild setup
KEYWORDS
This package has KEYWORDS=~86 which means it is marked
unstable for the x86 platform. It will not be emerged unless either an entry in
/etc/portage/package.keywords is added or the environment variable
ACCEPT_KEYWORDS is set to
"~x86".
Note: Use of ACCEPT_KEYWORDS is not recommended.
Add this line to
/etc/portage/package.keywords to build the masked package from the overlay Portage directory.
=net-misc/sipxportlib-3.0.1 ~x86
RESTRICT
RESTRICT="nomirror" instructs Portage not to download the source traball from the configured Gentoo Linux mirrors, but to use the URL defined in the ebuild. For ebuilds in Portage, this value is normally not set and the source tarballs are downloaded from the standard mirrors.
inherit eutils subversion kde-functions
DESCRIPTION="A native SIP communications system for voice, presence, messaging and collaboration - sipXportLib"
HOMEPAGE="http://www.sipfoundry.org/"
SRC_URI="http://www.sipfoundry.org/temp/sipX/tars/${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc latex"
#IUSE="doc latex ssl"
RESTRICT="nomirror"
Dependencies
DEPEND="
doc? ( >=app-doc/doxygen-1.3.8 )
>=dev-util/cppunit-1.10.2
>=sys-devel/libtool-1.4.3
>=dev-util/pkgconfig-0.15
>=net-libs/libwww-5.4
>=dev-libs/libpcre-5.0
"
#ssl? ( >=dev-libs/openssl-0.9.7d )
RDEPEND="
>=dev-libs/libpcre-5.0
>=net-libs/libwww-5.4
"
#ssl? ( >=dev-libs/openssl-0.9.7c )
Unpack the source
src_unpack() {
unpack ${A}
}
Compile the source
src_compile() {
econf \
`use_enable doc doxygen` \
`use_enable latex latex-docs` \
--prefix=/usr/sipx \
--localstatedir=/var \
--with-sipxportinc=/usr/sipx/include \
--with-sipxportlib=/usr/sipx/lib \
--with-sipxmediainc=/usr/sipx/include \
--with-sipxmedialib=/usr/sipx/lib \
--with-sipxtackinc=/usr/sipx/include \
--with-sipxtacklib=/usr/sipx/lib \
|| die "Error: econf failed"
#`use_enable ssl sip-tls` \
emake || die "Error: emake failed"
}
Install
src_install() {
make DESTDIR=${D} install || die "Error: install failed."
}
Build from an Ebuild
During the debug phase of an ebuild it might be useful to test the different steps one by one.
Digest
Every ebuild contains a digest file with MD5 hashes for all source tarballs. For ebuilds in Portage there is no need to rebuild this file. For ebuilds created or changed locally (in a Portage overlay), you need to re-hash in order to be able to use the ebuild.
ebuild /usr/local/portage/net-misc/sipxportlib/sipxportlib-3.0.1.ebuild digest
Unpack
To just unpack the package and apply any patches.
ebuild /usr/local/portage/net-misc/sipxportlib/sipxportlib-3.0.1.ebuild unpack
Note: patches are usually applied in the
unpack phase, but this can be handled differently by every ebuild. Check the ebuild itself to make sure what unpack actually does.
Compile
Unpack and compile the ebuild without actually installing it.
ebuild /usr/local/portage/net-misc/sipxportlib/sipxportlib-3.0.1.ebuild compile
Install
Unpack, compile and install, but do not execute the post-installation hooks.
ebuild /usr/local/portage/net-misc/sipxportlib/sipxportlib-3.0.1.ebuild install
Emerge
Normal emerge (by exact version match).
emerge -av =net-misc/sipxportlib-3.0.1
Create Ebuild Overlay
In order to build from custom ebuilds, you need to setup a Portage overlay.
Ebuilds in this directory will have precedence over ebuilds from the standard ebuild directory (
/usr/portage).
We have created our overlay in
/usr/local/portage. The corresponding entry in
/etc/make.conf looks like this:
PORTDIR_OVERLAY=/usr/local/portage