Successfully reported this slideshow.
Package management andcreation in Gentoo Linux          Donnie Berkholz   Council Member & Sr. Developer            Gentoo...
Me in GentooThe 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• ...
Gentoo PM goals(cont)• Configuration file protection  and automerge• Advantages of compiling from  source• Multiple  versi...
Portage features• Customization of CFLAGS, LDFLAGS• USE flags (more on that later)• Various optional FEATURES• Protection ...
Portage features                (cont)• Parallelization support  • --jobs=JOBS --load-average=LOAD  • MAKEOPTS=-jN  • FEAT...
Portage features                (cont)• Embedded system support• Features in portage 2.2   • License filtering   • Generic...
Portage tree• Gentoos software repository• One of the largest• Branches• Overlays
Ebuild file• Defines variables and functions    used to build/install software•   KEYWORDS•   SLOT•   DEPEND, RDEPEND, PDE...
USE flags• Map onto ./configure options• Defaults defined by profile• Define your own in addition  to defaults• Install on...
EAPI: Ebuild API• EAPI 0: Forever...• EAPI 1: Nov 2007• EAPI 2: Sept 2008• EAPI 3: Jan 2010• EAPI 4: Jan 2011• EAPI 5: Sep...
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.e...
EAPI 2• SRC_URI arrows   • http://bar/foo.tar → foo.tar.gz• USE dependencies   • DEPEND=dev-libs/foo[flag]       • [flag] ...
EAPI 2• Blocker syntax  • !dev-libs/foo  • !!dev-libs/foo• Granular builds  • src_configure() from compile  • src_prepare(...
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...
EAPI 4 (cont.)• REQUIRED_USE: DEPEND for USE  • flag1? (!flag2)  • flag1? ( || ( flag2 flag3 ) )  • ^^ ( flag1 flag2 )• ME...
EAPI 5• Sub-slots  • Upgrade requires downstream    package rebuilds  • SLOT=2/2.30• Slot operator dependencies  • DEPEND=...
EAPI 5• usex [true1] [false1] [true2] [false2]  • true1, false1 default to yes, no• (do|new)header• new* read from stdin• ...
EAPI 6?bugs.gentoo.org/174380 Gentoo Hosted Projects →PMS/EAPI Summary: [Future EAPI] Blocks: future-eapi
Package management andcreation in Gentoo Linux            Donnie Berkholz    Council Member & Sr. Developer             Ge...
<http://dev.gentoo.org/~dberkholz/IntroToGentoo.odp>Copyright 2006–2013 Rajiv Manglani, Zhang Le, DonnieBerkholz. Some rig...
Upcoming SlideShare
Loading in …5
×

Package management and creation in Gentoo Linux

1,605 views

Published on

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.

Published in: Technology
  • Be the first to comment

Package management and creation in Gentoo Linux

  1. 1. Package management andcreation in Gentoo Linux Donnie Berkholz Council Member & Sr. Developer Gentoo Linux dberkholz@gentoo.org @dberkholz
  2. 2. Me in GentooThe old me The new me Blah, blah, blah..
  3. 3. History
  4. 4. Overview Flickr: Liam Quinn
  5. 5. Gentoo PM goals• Beautiful and colorful despite CLI• Fully automated software installation• Extremely easy maintenance• Available in most architectures and OSs
  6. 6. Gentoo PM goals(cont)• Configuration file protection and automerge• Advantages of compiling from source• Multiple versions/implementations handling• Binary package support
  7. 7. 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
  8. 8. Portage features (cont)• 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
  9. 9. Portage features (cont)• Embedded system support• Features in portage 2.2 • License filtering • Generic package sets • FEATURES preserve-libs
  10. 10. Portage tree• Gentoos software repository• One of the largest• Branches• Overlays
  11. 11. 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
  12. 12. 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"
  13. 13. 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
  14. 14. EAPI 0• dev-libs/mpc/mpc-0.8.2.ebuild
  15. 15. EAPI 1• IUSE defaults • IUSE=+foo• SLOT dependencies • DEPEND=dev-libs/foo:slotname• dev-vcs/statcvs/ statcvs-0.4.0-r1.ebuild
  16. 16. 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
  17. 17. 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
  18. 18. EAPI 3• Prefix support• Unpacking of .xz archives• media-gfx/graphviz/graphviz- 2.26.3-r3.ebuild
  19. 19. 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
  20. 20. 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
  21. 21. 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
  22. 22. 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
  23. 23. EAPI 6?bugs.gentoo.org/174380 Gentoo Hosted Projects →PMS/EAPI Summary: [Future EAPI] Blocks: future-eapi
  24. 24. Package management andcreation in Gentoo Linux Donnie Berkholz Council Member & Sr. Developer Gentoo Linux dberkholz@gentoo.org @dberkholz
  25. 25. <http://dev.gentoo.org/~dberkholz/IntroToGentoo.odp>Copyright 2006–2013 Rajiv Manglani, Zhang Le, DonnieBerkholz. 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 thislicense, visit <http://creativecommons.org/licenses/by-nc-sa/2.0> or send aletter to Creative Commons, 559 Nathan Abbott Way, Stanford,California 94305, USA.

×