Upload
donnie-berkholz
View
1.095
Download
2
Embed Size (px)
DESCRIPTION
This talk is designed for developers and users of other Linux distributions to gain an understanding of the Gentoo approach and philosophy to package management. The goal isn't to get people using Gentoo but rather for attendees to walk away thinking about how they might be able to apply that to their own distributions or other projects. We'll cover how the package manager (Portage) works, what packages (ebuilds) look like, our focus on ease of use for package authors, how we've iterated on our package format over time, etc.
Citation preview
Package management and creation in Gentoo Linux
Donnie BerkholzCouncil Member & Sr. Developer
Gentoo Linux
@dberkholz
Me in Gentoo
The old me The new me
Blah, blah, blah..
History
Overview
Flickr: Liam Quinn
Gentoo PM goals
• Beautiful and colorful despite CLI
• Fully automated software installation
• Extremely easy maintenance• Available in most architectures and OS's
Gentoo PM goals(con't)
• Configuration file protection and automerge
• Advantages of compiling from source
• Multiple versions/implementations handling
• Binary package support
Portage features
• Customization of CFLAGS, LDFLAGS• USE flags (more on that later)• Various optional FEATURES• Protection for live system• FEATURES sandbox, collision-protect, protect-owned
• Compilation acceleration• FEATURES ccache, distcc
• System trimming• FEATURES nodoc, noman, noinfo• INSTALL_MASK
Portage features (con't)
• Parallelization support• --jobs=JOBS --load-average=LOAD• MAKEOPTS='-jN'• FEATURES parallel-fetch
• Auto resuming after failure• --keep-going
• Blocker automatic solving• com_err and ss V.S. e2fsprogs-libs
• Debugging support• CFLAGS "-g3 -ggdb3 -gdwarf-2"• FEATURES keepwork, nostrip, splitdebug, installsources
Portage features (con't)
• Embedded system support• Features in portage 2.2• License filtering• Generic package sets• FEATURES preserve-libs
Portage tree
• Gentoo's software repository• One of the largest• Branches• Overlays
Ebuild file
• Defines variables and functions used to build/install software
• KEYWORDS• SLOT• DEPEND, RDEPEND, PDEPEND• LICENSE, SRC_URI• Functions - src_unpack(), src_compile(), src_install()
• Eclasses
USE flags
• Map onto ./configure options• Defaults defined by profile• Define your own in addition to defaults
• Install only what you want• Example:• USE="-gnome kde qt -arts -nls"
EAPI: Ebuild API
• EAPI 0: Forever...• EAPI 1: Nov 2007• EAPI 2: Sept 2008• EAPI 3: Jan 2010• EAPI 4: Jan 2011• EAPI 5: Sept 2012
EAPI 0
• dev-libs/mpc/mpc-0.8.2.ebuild
EAPI 1
• IUSE defaults• IUSE=+foo
• SLOT dependencies• DEPEND=dev-libs/foo:slotname
• dev-vcs/statcvs/statcvs-0.4.0-r1.ebuild
EAPI 2
• SRC_URI arrows• http://bar/foo.tar → foo.tar.gz
• USE dependencies• DEPEND=dev-libs/foo[flag]
• [flag]• [-flag]• [flag=]• [?flag=]• [flag?]• [!flag?]
• sci-biology/arb/arb-5.1.ebuild
EAPI 2
• Blocker syntax• !dev-libs/foo• !!dev-libs/foo
• Granular builds• src_configure() from compile• src_prepare() from unpack
• Defaults for phase functions• e.g. default_src_unpack()• Also default()
• x11-libs/cairo/cairo-1.8.10.ebuild
EAPI 3
• Prefix support• Unpacking of .xz archives• media-gfx/graphviz/graphviz-2.26.3-r3.ebuild
EAPI 4
• pkg_pretend()• src_install() not empty by default
• pkg_info() on uninstalled pkgs• USE dependency defaults• flag+ flag-• For flags not in IUSE
• nonfatal prefix for commands• PROPERTIES (=interactive)• dev-vcs/git/git-1.8.1.ebuild
EAPI 4 (cont.)
• REQUIRED_USE: DEPEND for USE• flag1? (!flag2)• flag1? ( || ( flag2 flag3 ) )• ^^ ( flag1 flag2 )
• MERGE_TYPE=(source|binary|etc)• REPLACING_VERSIONS, REPLACED_BY_VERSION
• dev-db/mongodb/mongodb-2.2.2-r1.ebuild
• x11-libs/cairo/cairo-1.12.8.ebuild
EAPI 5
• Sub-slots• Upgrade requires downstream package rebuilds
• SLOT=2/2.30
• Slot operator dependencies• DEPEND=dev-libs/foo:*• DEPEND=dev-libs/foo:=
• Profile IUSE injection• At-most-one-of USE groups• ?? ( flag1 flag2 )
• x11-wm/xmonad/xmonad-0.11.ebuild
EAPI 5
• usex [true1] [false1] [true2] [false2]• true1, false1 default to yes, no
• (do|new)header• new* read from stdin• EBUILD_PHASE_FUNC• Current ebuild phase
• Stable USE masking/forcing
EAPI 6?
bugs.gentoo.org/174380 Gentoo Hosted Projects → PMS/EAPI Summary: [Future EAPI] Blocks: future-eapi
Package management and creation in Gentoo Linux
Donnie BerkholzCouncil Member & Sr. Developer
Gentoo Linux
@dberkholz
<http://dev.gentoo.org/~dberkholz/IntroToGentoo.odp>
Copyright 2006–2013 Rajiv Manglani, Zhang Le, Donnie Berkholz. Some rights reserved.
The Gentoo Linux logo is Copyright 2002 Gentoo Foundation, used with permission.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit <http://creativecommons.org/licenses/by-nc-sa/2.0> or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.