SlideShare a Scribd company logo
Package management and
creation in Gentoo Linux

          Donnie Berkholz
   Council Member & Sr. Developer
            Gentoo Linux

          dberkholz@gentoo.org
               @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 Berkholz
    Council Member & Sr. Developer
             Gentoo Linux

           dberkholz@gentoo.org
               @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.

More Related Content

PDF
Gentoo Linux, or Why in the World You Should Compile Everything
PDF
How to be a distribution-friendly project
PDF
Making Gentoo Tick
PDF
Intro To Gentoo Embedded Cclug
PPTX
Easy Installation and Setup of PostgreSQL on Linux, OSX, & Windows
PPT
linux minimal os tutorial - by shatrix
PPT
001 linux revision
PPT
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS...
Gentoo Linux, or Why in the World You Should Compile Everything
How to be a distribution-friendly project
Making Gentoo Tick
Intro To Gentoo Embedded Cclug
Easy Installation and Setup of PostgreSQL on Linux, OSX, & Windows
linux minimal os tutorial - by shatrix
001 linux revision
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS...

What's hot (20)

PPT
Building Embedded Linux
PPT
BayLISA - FreeNAS 10 by Jordan Hubbard
ODP
Linux basics (part 2)
PPT
NeXTBSD aka FreeBSD X
PDF
SELF 2014: PBI v10: Application Management Made Easy
PDF
005 skyeye
PDF
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
PDF
BusyBox for Embedded Linux
PDF
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
PDF
Introduction to FreeNAS development by John Hixson
PDF
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
PDF
Python on FreeBSD
PPTX
The True Story of FreeNAS
PDF
Sweden11
ODP
See Hudson Run, Run Hudson, Run [SELF 2010]
PPTX
Qt5 (minimal) on beaglebone, with Yocto
ODP
Hosting Open Source Projects at the OSUOSL
PDF
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PDF
Building Embedded Linux Systems Introduction
ODP
Embedded Systems
Building Embedded Linux
BayLISA - FreeNAS 10 by Jordan Hubbard
Linux basics (part 2)
NeXTBSD aka FreeBSD X
SELF 2014: PBI v10: Application Management Made Easy
005 skyeye
Marco Cavallini @ LinuxLab 2018 : Workshop Yocto Project, an automatic genera...
BusyBox for Embedded Linux
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
Introduction to FreeNAS development by John Hixson
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
Python on FreeBSD
The True Story of FreeNAS
Sweden11
See Hudson Run, Run Hudson, Run [SELF 2010]
Qt5 (minimal) on beaglebone, with Yocto
Hosting Open Source Projects at the OSUOSL
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
Building Embedded Linux Systems Introduction
Embedded Systems
Ad

Similar to Package management and creation in Gentoo Linux (20)

PDF
The State of Rootless Containers
PDF
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
PDF
Docking postgres
PDF
Continuous Integration and DevOps with Open Build Service(OBS)
PDF
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
PPTX
Cloud Foundry V2 | Intermediate Deep Dive
PDF
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
PDF
Rootless Containers
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
KEY
20100425 Configuration Management With Puppet Lfnw
PDF
Introduction to OpenBricks: an Embedded Linux Framework
PDF
Docker 102 - Immutable Infrastructure
PDF
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
PDF
WTF my container just spawned a shell!
PDF
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
PPTX
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
PPT
An introduction to maven gradle and sbt
PDF
Road to Opscon (Pisa '15) - DevOoops
PDF
Docker在豆瓣的实践 刘天伟-20160709
PPTX
Attack on the Core
The State of Rootless Containers
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Docking postgres
Continuous Integration and DevOps with Open Build Service(OBS)
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Cloud Foundry V2 | Intermediate Deep Dive
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Rootless Containers
Dependencies Managers in C/C++. Using stdcpp 2014
20100425 Configuration Management With Puppet Lfnw
Introduction to OpenBricks: an Embedded Linux Framework
Docker 102 - Immutable Infrastructure
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
WTF my container just spawned a shell!
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
Nagios Conference 2014 - Mike Merideth - The Art and Zen of Managing Nagios w...
An introduction to maven gradle and sbt
Road to Opscon (Pisa '15) - DevOoops
Docker在豆瓣的实践 刘天伟-20160709
Attack on the Core
Ad

More from Donnie Berkholz (20)

PPTX
Pricing and Packaging in Covid-19 Times - Heavybit
PDF
Open Source & Open Community at a 100-Year-Old Company
PPTX
Open Source & Open Community at a 100-Year-Old Company
PPTX
Discovering rivers & building bridges: DevOps @ CWT
ODP
Assholes are killing your project (MDC 2017)
PPTX
Reality Check: How much influence do developers really have?
PPTX
DevOps 101
PPTX
Cloud Native: A dose of reality
PPTX
Cloud Native in the Enterprise: Real-World Data on Container and Microservice...
PPTX
Mining the Go Developer Community
PPTX
DevOps 101+: From collaboration to microservices
PPTX
How the rise of DevOps and containers is transforming IT service delivery
PPTX
How IT will disrupt in 2016: The ITaaS imperative
PPTX
The OpenStack Pulse: Containers and Platforms
PPTX
Commit yourself already: Contributing to open source
PDF
Microservices 101: From DevOps to Docker and beyond
PPTX
Can we compare communities or are they all unique snowflakes?
PDF
How microservices are redefining modern application architecture
PPTX
DevOps, containers & microservices: Separating the hype from the reality
PPTX
Emerging trends in software development: The next generation of storage
Pricing and Packaging in Covid-19 Times - Heavybit
Open Source & Open Community at a 100-Year-Old Company
Open Source & Open Community at a 100-Year-Old Company
Discovering rivers & building bridges: DevOps @ CWT
Assholes are killing your project (MDC 2017)
Reality Check: How much influence do developers really have?
DevOps 101
Cloud Native: A dose of reality
Cloud Native in the Enterprise: Real-World Data on Container and Microservice...
Mining the Go Developer Community
DevOps 101+: From collaboration to microservices
How the rise of DevOps and containers is transforming IT service delivery
How IT will disrupt in 2016: The ITaaS imperative
The OpenStack Pulse: Containers and Platforms
Commit yourself already: Contributing to open source
Microservices 101: From DevOps to Docker and beyond
Can we compare communities or are they all unique snowflakes?
How microservices are redefining modern application architecture
DevOps, containers & microservices: Separating the hype from the reality
Emerging trends in software development: The next generation of storage

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
cuic standard and advanced reporting.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
cuic standard and advanced reporting.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction

Package management and creation in Gentoo Linux

  • 1. Package management and creation in Gentoo Linux Donnie Berkholz Council Member & Sr. Developer Gentoo Linux dberkholz@gentoo.org @dberkholz
  • 2. Me in Gentoo The old me The new me Blah, blah, blah..
  • 4. Overview Flickr: Liam Quinn
  • 5. Gentoo PM goals • Beautiful and colorful despite CLI • Fully automated software installation • Extremely easy maintenance • Available in most architectures and OS's
  • 6. Gentoo PM goals(con't) • Configuration file protection and automerge • Advantages of compiling from source • Multiple versions/implementations handling • Binary package support
  • 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. 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
  • 9. Portage features (con't) • Embedded system support • Features in portage 2.2 • License filtering • Generic package sets • FEATURES preserve-libs
  • 10. Portage tree • Gentoo's software repository • One of the largest • Branches • Overlays
  • 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. 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. 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
  • 15. EAPI 1 • IUSE defaults • IUSE=+foo • SLOT dependencies • DEPEND=dev-libs/foo:slotname • dev-vcs/statcvs/ statcvs-0.4.0-r1.ebuild
  • 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. 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. EAPI 3 • Prefix support • Unpacking of .xz archives • media-gfx/graphviz/graphviz- 2.26.3-r3.ebuild
  • 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. 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. 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. 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. EAPI 6? bugs.gentoo.org/174380 Gentoo Hosted Projects → PMS/EAPI Summary: [Future EAPI] Blocks: future-eapi
  • 24. Package management and creation in Gentoo Linux Donnie Berkholz Council Member & Sr. Developer Gentoo Linux dberkholz@gentoo.org @dberkholz
  • 25. <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.