SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
mGAR
             Producing complex packages for Solaris the easy way


                            OpenCSW Technical Wintercamp
                                    Dublin 2011

                                 Dagobert Michelsen
                                 dam@opencsw.org


Samstag, 19. Februar 2011                                          1
Once upon a time
               find /usr/local/pkg -print > /tmp/files
               cat /tmp/files | pkgproto > /tmp/Prototype
               vim /tmp/Prototype

               PKG=FOOtree
               NAME=tree - A recursive directory listing program
               ARCH=sparc
               VERSION=1.5.3,REV=2010.02.02
               CATEGORY=application
               VENDOR=http://mama.indstate.edu/users/ice/tree/
               EMAIL=joe@example.com
               PSTAMP=joe@darkstar-20100202140539
               CLASSES=none
               HOTLINE=http://www.example.com/

               pkgmk -o -r / -d /tmp -f Prototype
               pkgtrans . tree.pkg FOOtree
               gzip tree.pkg


Samstag, 19. Februar 2011                                          2
What is missing? What‘s wrong?

           Compilation
           Packaging standards
           Checking for errors
           Hardcoded prototypes
           Hardcoded pkginfo


Samstag, 19. Februar 2011                      3
Enter mGAR




                            gmake package
Samstag, 19. Februar 2011                   4
What is mGAR?

           A system to build packages for
           Solaris
           Origins are „GAR“
           LNX-BBC and GARNOME
           m = modulated
           ➜ multiple similar builds
           Files written in GNU Make

                                  5
Samstag, 19. Februar 2011                   5
The simplest case
    The minimal information to build a package:
    1. What should the package be named
    2. Where to get the sources
    3. What the dependencies are




Samstag, 19. Februar 2011                         6
Example: gperf
                NAME = gperf
                VERSION = 3.0.3
                CATEGORIES = devel

                DESCRIPTION = A perfect hash function generator

                MASTER_SITES = $(GNU_MIRROR)
                DISTFILES = $(NAME)-$(VERSION).tar.gz

                CONFIGURE_ARGS = $(DIRPATHS)

                TEST_TARGET = check

                include gar/category.mk




Samstag, 19. Februar 2011                                         7
Categories
      include gar/category.mk
              Should be really named 'profiles'
              Contains settings common to a
              class of builds
                       Generic
                       Perl Modules
                       Ruby Gems
                       Python Eggs



Samstag, 19. Februar 2011                          8
Typical customization needs
            Code needs to be patched to compile or run on Solaris
            Code doesn‘t honor information passed via ./configure
            Files need to placed at specific locations in the package
Samstag, 19. Februar 2011                                               9
Phases




    prerequisites fetch checksum exract patch configure build test install merge package checkpkg

                                          ...and custom targets:
                                                 pre-fetch
                                                post-fetch
                                               pre-extract
                                                    (...)
Samstag, 19. Februar 2011                                                                           10
Modulations
                     „A Modulation is the process of varying
                       one waveform in relation to another
                                  waveform“
                             For soft ware builds that means:

          „A Modulation is the process of varying a build in
                 relation to certain parameters“




Samstag, 19. Februar 2011                                       11
Phases and modulations
                            Prerequisites                Executed
                                               One
                            Fetch           modulation
                                                          globally
                            Checksum
                            Extract
                            Patch
                            Configure           Executed inside
                            Build
                            Test                   modulation
                            Install
                            Merge
                            Package          Executed globally


Samstag, 19. Februar 2011                                            12
What can be used
                                 as modulator?
                            ISA for build architecture
                            For 32/64 bit versions and optimized binaries.
                            See lame

                            Package version
                            Useful when multiple versions of a library should be included
                            See automake

                            ...anything that controls the build
                               Static vs. dynamic linked versions
                               See wget

                               Parameter size
                               See nrpe

                               Wide vs. narrow characters
                               See ncurses
Samstag, 19. Februar 2011                                                                   13
Modulation
                                            over ISA
                            Allows easy building of multiple ISAs
                            Built-in special case of modulation
                              No merge needed also


                            Simplest case
                            BUILD64 = 1


                            Advanced
                            EXTRA_BUILD_ISAS = sparcv8plus+vis pentium_pro




Samstag, 19. Februar 2011                                                    14
Modulation
                             over ISA requirements
                            Certain ISAs require specific platforms
                            x64 requires Solaris 10, but integrated package for Solaris 8-10


                            Parallelizing modulation builds
                            May require builds on multiple hosts


                            Build platform for each modulation can
                            be specified in the package manifest
                            How does ISAEXEC relate to multi-ISA?


Samstag, 19. Februar 2011                                                                      15
Modulation
                 over static/dynamic linking
                                                        Adds modulator with
                        GARNAME = wget                       this name
                        ...                                                                     Cool trick:
                        EXTRA_MODULATORS = STATIC                                   Use dynamically expanded variables
                                                                                          to set per-modulation
                        MODULATIONS_STATIC = disable enable

                        EXTRA_CONFIGURE_STATIC-disable = --with-ssl
                        EXTRA_CONFIGURE_STATIC-enable = --disable-shared
                        EXTRA_CONFIGURE_STATIC-enable += --enable-static
                        EXTRA_CONFIGURE_STATIC-enable += --without-ssl
                        ...
                        CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC))

                        MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all
                         MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only
                            MERGE_DIRS_isa-sparcv8-static-enable = $(bindir)

                            MERGE_SCRIPTS_isa-i386-static-disable = copy-all
                             MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only
                                MERGE_DIRS_isa-i386-static-enable = $(bindir)

                        merge-rename-wget:
                                @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static
                        ...
                        include gar/category.mk




Samstag, 19. Februar 2011                                                                                                16
Modulation
                                 over parameter size
                                                    Ok, I guess you understood
                        GARNAME = nrpe                    how this works
                        ...
                        EXTRA_MODULATORS = SIZE                                   Use patchfiles on a
                        MODULATIONS_SIZE = 1k 8k                                 per-modulation basis
                        ...
                        PATCHFILES_isa-sparcv8-size-8k = common.h.diff
                        PATCHFILES_isa-i386-size-8k = common.h.diff
                        ...
                        MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
                        MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

                        MERGE_SCRIPTS_isa-i386-size-1k = copy-all
                        MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

                        include gar/category.mk
                        ...
                        merge-copy-nrpe-only:
                                cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
                                cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
                                @$(MAKECOOKIE)




Samstag, 19. Februar 2011                                                                                           17
Modulations
                                  and their names
                            The name of a modulation is
                                <modulator1>-<value1>-<modulator2>-<value2>-...

                            Call each phase from a modulation manually with
                                <phase>-<modulation>

                            Example:
                                gmake build-isa-sparcv8

                            This results in a sub-make-invocation
                                <phase>-modulated   MODULATION=<MODULATION>
                                                    <MODULATOR1>=<value1> ...
                            Example:
                                gmake build-modulated MODULATION=isa-sparcv8
                                                      ISA=sparcv8

Samstag, 19. Februar 2011                                                         18
Merging
                               Why is this needed?
                            Optimized binaries with isaexec
                            Libraries may be located elsewhere in
                            the package than they were configured
                              …/lib/32 -> .
                              …/lib/64 -> sparcv9 | amd64
                              Pathes stored in pkgconfig-files




Samstag, 19. Februar 2011                                           19
Merging
                                 Why is this needed?
                32 and 64 bit need different install locations
                to have sane pkgconfig-files


                            build-isa-sparcv8/opt/csw/bin/myapp
         Install            build-isa-sparcv9/opt/csw/bin/64/myapp



                                        pkgroot/opt/csw/bin/myapp
                              Merge
                                        pkgroot/opt/csw/bin/sparcv9/myapp




                                                   /opt/csw/bin/myapp -> isaexec
                                        Package    /opt/csw/bin/sparcv8/myapp
                                                   /opt/csw/bin/sparcv9/myapp




Samstag, 19. Februar 2011                                                          20
Merging
                                 Builtin rules
                                     Copy all      Copy only some
                                                    MERGE_DIRS_<mod>



              Do not relocate      copy-all        copy-only




                   Do relocate     copy-relocate   copy-relocated-only




Samstag, 19. Februar 2011                                                21
Merging
                                    with custom rules
                Only merge specific files
                                                                               This is the default build
                        GARNAME = nrpe                                       Just copy everything over
                        ...
                        MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
                        MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only
                                                                             We want to control exactly what is used
                                                                                from the additional modulation
                        MERGE_SCRIPTS_isa-i386-size-1k = copy-all
                        MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only
                                                                      Merging copies from the install
                        include gar/category.mk                          location to PKGROOT
                        ...
                        merge-copy-nrpe-only:
                                cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
                                cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
                                @$(MAKECOOKIE)




Samstag, 19. Februar 2011                                                                                              22
Class Action Scripts
        They mean more or less 'hooks'
                   f cswinitsmf /opt/csw/etc/init.d/cswpuppetd
                   i.<class> scripts handle the files
                         i.cswinitsmf
                         r.cswinitsmf
        GAR integration:
                   INITSMF = $(prefix)/init.d/cswpuppetd
        Fully automated:
                   Texinfo registration
                   Configuration file preser vation
                   Placement of README.CSW in package docs
                   ...

Samstag, 19. Februar 2011                                        23
checkpkg and overrides
           Examines a set of .pkg files
           Looks for common issues
           Written mostly in Python, with lintian in mind
                                allows to override checks




Samstag, 19. Februar 2011                                   24
Your package is ready!




Samstag, 19. Februar 2011                            25
Questions?




                            Bueller? Anybody?
Samstag, 19. Februar 2011                       26

Contenu connexe

En vedette

план урока
план урокаплан урока
план урокаkillaruns
 
Cortes forest-petition-delivery.1.12.12
Cortes forest-petition-delivery.1.12.12Cortes forest-petition-delivery.1.12.12
Cortes forest-petition-delivery.1.12.12wildstands
 
De lach door de jaren heen
De lach door de jaren heen De lach door de jaren heen
De lach door de jaren heen thijsvanraak
 
Jesus the Christ in ITALIAN
Jesus the Christ in ITALIANJesus the Christ in ITALIAN
Jesus the Christ in ITALIANdearl1
 
помогите буратино
помогите буратинопомогите буратино
помогите буратиноkillaruns
 
JavaScript as Development Platform
JavaScript as Development PlatformJavaScript as Development Platform
JavaScript as Development PlatformAlexei Skachykhin
 
Communication final
Communication finalCommunication final
Communication finalIam Varien
 
Pa yessy
Pa yessyPa yessy
Pa yessySJM
 
польша
польшапольша
польшаpolemic
 
May 2013 Newsletter
May 2013 NewsletterMay 2013 Newsletter
May 2013 NewsletterJOHNLEACH
 
Abdulkalam team 10
Abdulkalam team 10Abdulkalam team 10
Abdulkalam team 10Nikhil Tanni
 
Superant obstacles
Superant obstaclesSuperant obstacles
Superant obstaclescarmeo
 
Movi moves
Movi movesMovi moves
Movi movesmiloherr
 
Persecució amb parkour
Persecució amb parkourPersecució amb parkour
Persecució amb parkourcarmeo
 
1.cw analysis
1.cw analysis1.cw analysis
1.cw analysisgia1995
 
Плакаты ЕГЭ 2015
Плакаты ЕГЭ 2015 Плакаты ЕГЭ 2015
Плакаты ЕГЭ 2015 killaruns
 

En vedette (20)

план урока
план урокаплан урока
план урока
 
Emily new
Emily newEmily new
Emily new
 
Cortes forest-petition-delivery.1.12.12
Cortes forest-petition-delivery.1.12.12Cortes forest-petition-delivery.1.12.12
Cortes forest-petition-delivery.1.12.12
 
De lach door de jaren heen
De lach door de jaren heen De lach door de jaren heen
De lach door de jaren heen
 
Jesus the Christ in ITALIAN
Jesus the Christ in ITALIANJesus the Christ in ITALIAN
Jesus the Christ in ITALIAN
 
помогите буратино
помогите буратинопомогите буратино
помогите буратино
 
Digital security
Digital securityDigital security
Digital security
 
JavaScript as Development Platform
JavaScript as Development PlatformJavaScript as Development Platform
JavaScript as Development Platform
 
Communication final
Communication finalCommunication final
Communication final
 
Chemical bonding
Chemical bondingChemical bonding
Chemical bonding
 
Pa yessy
Pa yessyPa yessy
Pa yessy
 
польша
польшапольша
польша
 
May 2013 Newsletter
May 2013 NewsletterMay 2013 Newsletter
May 2013 Newsletter
 
Abdulkalam team 10
Abdulkalam team 10Abdulkalam team 10
Abdulkalam team 10
 
John institution q
John institution qJohn institution q
John institution q
 
Superant obstacles
Superant obstaclesSuperant obstacles
Superant obstacles
 
Movi moves
Movi movesMovi moves
Movi moves
 
Persecució amb parkour
Persecució amb parkourPersecució amb parkour
Persecució amb parkour
 
1.cw analysis
1.cw analysis1.cw analysis
1.cw analysis
 
Плакаты ЕГЭ 2015
Плакаты ЕГЭ 2015 Плакаты ЕГЭ 2015
Плакаты ЕГЭ 2015
 

Similaire à An introductionto mGAR (Dublin 2011)

An introduction to OSGi
An introduction to OSGi An introduction to OSGi
An introduction to OSGi Andrea Chiodoni
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishArun Gupta
 
OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishArun Gupta
 
OSGi & Java EE in GlassFish - Best of both worlds
OSGi & Java EE in GlassFish - Best of both worldsOSGi & Java EE in GlassFish - Best of both worlds
OSGi & Java EE in GlassFish - Best of both worldsArun Gupta
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010Arun Gupta
 
Oracle Solaris 11 - Best for Enterprise Applications
Oracle Solaris 11 - Best for Enterprise ApplicationsOracle Solaris 11 - Best for Enterprise Applications
Oracle Solaris 11 - Best for Enterprise Applicationsglynnfoster
 
SOUG - Experiences with Oracle Solaris 11.4
SOUG - Experiences with Oracle Solaris 11.4SOUG - Experiences with Oracle Solaris 11.4
SOUG - Experiences with Oracle Solaris 11.4JomaSoft
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011Arun Gupta
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBayTony Ng
 
every-day-automation
every-day-automationevery-day-automation
every-day-automationAmir Barylko
 
Mercurial: Modern Source Control Management
Mercurial: Modern Source Control ManagementMercurial: Modern Source Control Management
Mercurial: Modern Source Control ManagementJohn Paulett
 
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise PlatformBIOVIA
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Projectrossburton
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and VirgoHristo Iliev
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdatedoscon2007
 
Building a Large Java Codebase with Bazel - Natan Silnitsky
Building a Large Java Codebase with Bazel - Natan Silnitsky Building a Large Java Codebase with Bazel - Natan Silnitsky
Building a Large Java Codebase with Bazel - Natan Silnitsky Wix Engineering
 
BP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoBP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoSerdar Basegmez
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGiIlya Rybak
 
Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom UsageJoshua Long
 

Similaire à An introductionto mGAR (Dublin 2011) (20)

An introduction to OSGi
An introduction to OSGi An introduction to OSGi
An introduction to OSGi
 
OpenEmbedded
OpenEmbeddedOpenEmbedded
OpenEmbedded
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFish
 
OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFish
 
OSGi & Java EE in GlassFish - Best of both worlds
OSGi & Java EE in GlassFish - Best of both worldsOSGi & Java EE in GlassFish - Best of both worlds
OSGi & Java EE in GlassFish - Best of both worlds
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
 
Oracle Solaris 11 - Best for Enterprise Applications
Oracle Solaris 11 - Best for Enterprise ApplicationsOracle Solaris 11 - Best for Enterprise Applications
Oracle Solaris 11 - Best for Enterprise Applications
 
SOUG - Experiences with Oracle Solaris 11.4
SOUG - Experiences with Oracle Solaris 11.4SOUG - Experiences with Oracle Solaris 11.4
SOUG - Experiences with Oracle Solaris 11.4
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBay
 
every-day-automation
every-day-automationevery-day-automation
every-day-automation
 
Mercurial: Modern Source Control Management
Mercurial: Modern Source Control ManagementMercurial: Modern Source Control Management
Mercurial: Modern Source Control Management
 
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Project
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and Virgo
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Building a Large Java Codebase with Bazel - Natan Silnitsky
Building a Large Java Codebase with Bazel - Natan Silnitsky Building a Large Java Codebase with Bazel - Natan Silnitsky
Building a Large Java Codebase with Bazel - Natan Silnitsky
 
BP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM DominoBP207 - Meet the Java Application Server You Already Own – IBM Domino
BP207 - Meet the Java Application Server You Already Own – IBM Domino
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 
Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom Usage
 

Dernier

OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 

Dernier (20)

OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 

An introductionto mGAR (Dublin 2011)

  • 1. mGAR Producing complex packages for Solaris the easy way OpenCSW Technical Wintercamp Dublin 2011 Dagobert Michelsen dam@opencsw.org Samstag, 19. Februar 2011 1
  • 2. Once upon a time find /usr/local/pkg -print > /tmp/files cat /tmp/files | pkgproto > /tmp/Prototype vim /tmp/Prototype PKG=FOOtree NAME=tree - A recursive directory listing program ARCH=sparc VERSION=1.5.3,REV=2010.02.02 CATEGORY=application VENDOR=http://mama.indstate.edu/users/ice/tree/ EMAIL=joe@example.com PSTAMP=joe@darkstar-20100202140539 CLASSES=none HOTLINE=http://www.example.com/ pkgmk -o -r / -d /tmp -f Prototype pkgtrans . tree.pkg FOOtree gzip tree.pkg Samstag, 19. Februar 2011 2
  • 3. What is missing? What‘s wrong? Compilation Packaging standards Checking for errors Hardcoded prototypes Hardcoded pkginfo Samstag, 19. Februar 2011 3
  • 4. Enter mGAR gmake package Samstag, 19. Februar 2011 4
  • 5. What is mGAR? A system to build packages for Solaris Origins are „GAR“ LNX-BBC and GARNOME m = modulated ➜ multiple similar builds Files written in GNU Make 5 Samstag, 19. Februar 2011 5
  • 6. The simplest case The minimal information to build a package: 1. What should the package be named 2. Where to get the sources 3. What the dependencies are Samstag, 19. Februar 2011 6
  • 7. Example: gperf NAME = gperf VERSION = 3.0.3 CATEGORIES = devel DESCRIPTION = A perfect hash function generator MASTER_SITES = $(GNU_MIRROR) DISTFILES = $(NAME)-$(VERSION).tar.gz CONFIGURE_ARGS = $(DIRPATHS) TEST_TARGET = check include gar/category.mk Samstag, 19. Februar 2011 7
  • 8. Categories include gar/category.mk Should be really named 'profiles' Contains settings common to a class of builds Generic Perl Modules Ruby Gems Python Eggs Samstag, 19. Februar 2011 8
  • 9. Typical customization needs Code needs to be patched to compile or run on Solaris Code doesn‘t honor information passed via ./configure Files need to placed at specific locations in the package Samstag, 19. Februar 2011 9
  • 10. Phases prerequisites fetch checksum exract patch configure build test install merge package checkpkg ...and custom targets: pre-fetch post-fetch pre-extract (...) Samstag, 19. Februar 2011 10
  • 11. Modulations „A Modulation is the process of varying one waveform in relation to another waveform“ For soft ware builds that means: „A Modulation is the process of varying a build in relation to certain parameters“ Samstag, 19. Februar 2011 11
  • 12. Phases and modulations Prerequisites Executed One Fetch modulation globally Checksum Extract Patch Configure Executed inside Build Test modulation Install Merge Package Executed globally Samstag, 19. Februar 2011 12
  • 13. What can be used as modulator? ISA for build architecture For 32/64 bit versions and optimized binaries. See lame Package version Useful when multiple versions of a library should be included See automake ...anything that controls the build Static vs. dynamic linked versions See wget Parameter size See nrpe Wide vs. narrow characters See ncurses Samstag, 19. Februar 2011 13
  • 14. Modulation over ISA Allows easy building of multiple ISAs Built-in special case of modulation No merge needed also Simplest case BUILD64 = 1 Advanced EXTRA_BUILD_ISAS = sparcv8plus+vis pentium_pro Samstag, 19. Februar 2011 14
  • 15. Modulation over ISA requirements Certain ISAs require specific platforms x64 requires Solaris 10, but integrated package for Solaris 8-10 Parallelizing modulation builds May require builds on multiple hosts Build platform for each modulation can be specified in the package manifest How does ISAEXEC relate to multi-ISA? Samstag, 19. Februar 2011 15
  • 16. Modulation over static/dynamic linking Adds modulator with GARNAME = wget this name ... Cool trick: EXTRA_MODULATORS = STATIC Use dynamically expanded variables to set per-modulation MODULATIONS_STATIC = disable enable EXTRA_CONFIGURE_STATIC-disable = --with-ssl EXTRA_CONFIGURE_STATIC-enable = --disable-shared EXTRA_CONFIGURE_STATIC-enable += --enable-static EXTRA_CONFIGURE_STATIC-enable += --without-ssl ... CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC)) MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only MERGE_DIRS_isa-sparcv8-static-enable = $(bindir) MERGE_SCRIPTS_isa-i386-static-disable = copy-all MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only MERGE_DIRS_isa-i386-static-enable = $(bindir) merge-rename-wget: @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static ... include gar/category.mk Samstag, 19. Februar 2011 16
  • 17. Modulation over parameter size Ok, I guess you understood GARNAME = nrpe how this works ... EXTRA_MODULATORS = SIZE Use patchfiles on a MODULATIONS_SIZE = 1k 8k per-modulation basis ... PATCHFILES_isa-sparcv8-size-8k = common.h.diff PATCHFILES_isa-i386-size-8k = common.h.diff ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE) Samstag, 19. Februar 2011 17
  • 18. Modulations and their names The name of a modulation is <modulator1>-<value1>-<modulator2>-<value2>-... Call each phase from a modulation manually with <phase>-<modulation> Example: gmake build-isa-sparcv8 This results in a sub-make-invocation <phase>-modulated MODULATION=<MODULATION> <MODULATOR1>=<value1> ... Example: gmake build-modulated MODULATION=isa-sparcv8 ISA=sparcv8 Samstag, 19. Februar 2011 18
  • 19. Merging Why is this needed? Optimized binaries with isaexec Libraries may be located elsewhere in the package than they were configured …/lib/32 -> . …/lib/64 -> sparcv9 | amd64 Pathes stored in pkgconfig-files Samstag, 19. Februar 2011 19
  • 20. Merging Why is this needed? 32 and 64 bit need different install locations to have sane pkgconfig-files build-isa-sparcv8/opt/csw/bin/myapp Install build-isa-sparcv9/opt/csw/bin/64/myapp pkgroot/opt/csw/bin/myapp Merge pkgroot/opt/csw/bin/sparcv9/myapp /opt/csw/bin/myapp -> isaexec Package /opt/csw/bin/sparcv8/myapp /opt/csw/bin/sparcv9/myapp Samstag, 19. Februar 2011 20
  • 21. Merging Builtin rules Copy all Copy only some MERGE_DIRS_<mod> Do not relocate copy-all copy-only Do relocate copy-relocate copy-relocated-only Samstag, 19. Februar 2011 21
  • 22. Merging with custom rules Only merge specific files This is the default build GARNAME = nrpe Just copy everything over ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only We want to control exactly what is used from the additional modulation MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only Merging copies from the install include gar/category.mk location to PKGROOT ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE) Samstag, 19. Februar 2011 22
  • 23. Class Action Scripts They mean more or less 'hooks' f cswinitsmf /opt/csw/etc/init.d/cswpuppetd i.<class> scripts handle the files i.cswinitsmf r.cswinitsmf GAR integration: INITSMF = $(prefix)/init.d/cswpuppetd Fully automated: Texinfo registration Configuration file preser vation Placement of README.CSW in package docs ... Samstag, 19. Februar 2011 23
  • 24. checkpkg and overrides Examines a set of .pkg files Looks for common issues Written mostly in Python, with lintian in mind allows to override checks Samstag, 19. Februar 2011 24
  • 25. Your package is ready! Samstag, 19. Februar 2011 25
  • 26. Questions? Bueller? Anybody? Samstag, 19. Februar 2011 26