SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Painless Perl Ports
  with cpan2port
    Benny Siegert ‹bsiegert@gmail.com›
The MirOS Project (http://www.mirbsd.org)

             FOSDEM 2009
Contents
1. Introduction
  Perl, MirPorts
2. Presenting cpan2port
  with live demo
3. Implementation notes
4. Conclusion
Perl and CPAN
‣ Comprehensive Perl Archive Network
‣ 15 000 modules by >7000 authors
 ➡ lots of ports to create


‣ CPAN module and shell
  (perl -MCPAN -eshell)
  does not know about ports and packages
Ports
‣ mechanism to install 3rd-party software in
  BSD operating systems
‣ ports are used to create binary packages
‣ installation “recipe” in a Makefile + metadata




↪What is required to create a port?
# $MirOS: ports/devel/svk/Makefile,v 1.4 2008/10/04 19:46:50 bsiegert Exp $

                                                         one-line description
COMMENT=         distributed version control system

VERSION=         2.2.0
                                    distribution name, version
DASH_VER=        0
DISTNAME=        SVK-v${VERSION}
PKGNAME=         svk-${VERSION}-${DASH_VER}
                                               category
CATEGORIES=      devel net

HOMEPAGE=        http://svk.bestpractical.com/
MASTER_SITES=    ${MASTER_SITE_PERL_CPAN:=../by-authors/id/C/CL/CLKAO/}
                                                         where to download
RESPONSIBLE=     Benny Siegert <bsiegert@gmx.de>

# LGPL
PERMIT_PACKAGE_CDROM=     Yes
PERMIT_PACKAGE_FTP=       Yes
PERMIT_DISTFILES_CDROM=   Yes
PERMIT_DISTFILES_FTP=     Yes

B_R_DEPENDS+=    ::archivers/p5-PerlIO-via-Bzip2
[...]
                                                      dependencies!
CONFIGURE_STYLE= perl
CONFIGURE_ARGS+= --defaultdeps

.include <bsd.port.mk>
Other metadata


‣ DESCR: long description (about 100 words)
‣ PLIST: packing list (automatically created)
‣ distinfo: checksums for distfile
  (automatically created)
Introducing cpan2port
‣ Perl script allowing the rapid creation
  of Perl module ports
  ‣ using the CPAN module


‣ creates a stub port which may be refined
  and drops you to a shell
‣ only a few more commands needed
  in the ideal case
… live demo …
Log::Dispatch module
Implementation notes
How does it work?

‣ CPAN.pm discovers most of the information
  needed
‣ finds the distribution name for a module
  (e.g.   D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz)



‣ for more info, “make“ the module inside cpan
How does it work?

‣ CPAN.pm discovers most of the information
  needed
‣ finds the distribution name for a module
  (e.g.   D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz)
            download dir


‣ for more info, “make“ the module inside cpan
How does it work?

‣ CPAN.pm discovers most of the information
  needed
‣ finds the distribution name for a module
  (e.g.   D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz)
                           DISTNAME


‣ for more info, “make“ the module inside cpan
How does it work?

‣ CPAN.pm discovers most of the information
  needed
‣ finds the distribution name for a module
  (e.g.   D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz)
                                     EXTRACT_SUFX


‣ for more info, “make“ the module inside cpan
Before “make“
Module id = Log::Dispatch
    DESCRIPTION Log messages to multiple outputs
    CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>)
    CPAN_VERSION 2.22
    CPAN_FILE    D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz
    DSLI_STATUS RdpO (released,developer,perl,object-oriented)
    INST_FILE    (not installed)



Distribution id = D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz
    CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>)
    CONTAINSMODS Log::Dispatch::File::Locked [...]
After “make“
Distribution id = D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz
    CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>)
    CALLED_FOR   Log::Dispatch
    CONTAINSMODS Log::Dispatch::File::Locked [...]
    MD5_STATUS   OK
    archived     tar
    build_dir    /Users/bsiegert/.cpan/build/Log-Dispatch-2.22
    localfile    /Users/bsiegert/.cpan/sources/authors/id/D/DR/
                 DROLSKY/Log-Dispatch-2.22.tar.gz
    make         YES
    prereq_pm    Test::More Params::Validate File::Temp Module::Build
    prereq_pm_detected 1
    unwrapped    YES
    writemakefile YES
Dependencies
‣ prereq_pm is a hash with
  module => minversion

‣ expand module to distname
‣ static table of modules in the base system,
  with “unsystematic“ names or non-CPAN
‣ rest: glob for /usr/ports/*/p5-NAME
‣ output dependency string in our format
Descriptions

‣ For some modules, cpan knows a one-line
  description (COMMENT), not for others
‣ readmes are useless for getting a longer one


‣ parse the manpage, i.e. the POD
POD parsing
‣ “NAME“ section contains one-line comment
  ‣   Log::Dispatch - Dispatches messages to one or
      more outputs

‣ longer description: first few paragraphs from
  “DESCRIPTION“ section
  ‣ up to first control command
  ‣ plain-text conversion is easy
 my $parser = Pod::Text->new(indent => 0, width
 => 72);
finally …
‣ ask user for category, create directory
‣ variable substitution in Makefile template
‣ write DESCR
‣ copy distfile to Distfiles directory
‣ run “make checksum“
‣ drop user to a shell, needs to run regress,
  update-plist, install targets
Porting to other systems
‣ right now, cpan2port is available for MirPorts


‣ easily portable
‣ adapt perlmod.Makefile template
‣ change base module list accordingly
‣ adapt dependency output to your syntax
Conclusion
‣ cpan2port does the routine work
  in porting Perl modules

‣ available in MirPorts, easy to port

‣ pkgsrc, FreeBSD, OpenBSD people: try it!

‣ Sources available at
  http://cvs.mirbsd.de/ports/infrastructure/scripts/cpan2port
  http://cvs.mirbsd.de/ports/infrastructure/templates/
  perlmod.Makefile
Thank you for your attention!

         Questions?

Más contenido relacionado

La actualidad más candente

PHP: The Beginning and the Zend
PHP: The Beginning and the ZendPHP: The Beginning and the Zend
PHP: The Beginning and the Zenddoublecompile
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Combell NV
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commandsswtjerin4u
 
NDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOTNDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOTAshwin Pawar
 
Pursue container architecture with mincs
Pursue container architecture with mincsPursue container architecture with mincs
Pursue container architecture with mincsYuki Nishiwaki
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes Zhichao Liang
 
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017Ranjith Rajaram
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commandsHanan Nmr
 
Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"Avash Mulmi
 
Hyperledger composer
Hyperledger composerHyperledger composer
Hyperledger composerwonyong hwang
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerJeff Anderson
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)dantleech
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programmingsudhir singh yadav
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commandstmavroidis
 
How to see the event and audit logs through ( gui and cli) in cluster ontap n...
How to see the event and audit logs through ( gui and cli) in cluster ontap n...How to see the event and audit logs through ( gui and cli) in cluster ontap n...
How to see the event and audit logs through ( gui and cli) in cluster ontap n...Saroj Sahu
 

La actualidad más candente (20)

Fluentd and WebHDFS
Fluentd and WebHDFSFluentd and WebHDFS
Fluentd and WebHDFS
 
PHP: The Beginning and the Zend
PHP: The Beginning and the ZendPHP: The Beginning and the Zend
PHP: The Beginning and the Zend
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
NDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOTNDMPCOPY lun from 7-mode NetApp to cDOT
NDMPCOPY lun from 7-mode NetApp to cDOT
 
Pursue container architecture with mincs
Pursue container architecture with mincsPursue container architecture with mincs
Pursue container architecture with mincs
 
Snaps on open suse
Snaps on open suseSnaps on open suse
Snaps on open suse
 
Docker practice
Docker practiceDocker practice
Docker practice
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes
 
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
 
Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"
 
Hyperledger composer
Hyperledger composerHyperledger composer
Hyperledger composer
 
Statyczna analiza kodu PHP
Statyczna analiza kodu PHPStatyczna analiza kodu PHP
Statyczna analiza kodu PHP
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
 
How to see the event and audit logs through ( gui and cli) in cluster ontap n...
How to see the event and audit logs through ( gui and cli) in cluster ontap n...How to see the event and audit logs through ( gui and cli) in cluster ontap n...
How to see the event and audit logs through ( gui and cli) in cluster ontap n...
 

Similar a Painless Perl Ports with cpan2port

DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabMichelle Holley
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDocker, Inc.
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Bastian Feder
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn WorkshopBastian Feder
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDTBastian Feder
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Composeraccoony
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_trainingvideos
 
7 hands on
7 hands on7 hands on
7 hands onvideos
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationKanwar Batra
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2Hell19
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 

Similar a Painless Perl Ports with cpan2port (20)

DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 
7 hands on
7 hands on7 hands on
7 hands on
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replication
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 

Último

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Painless Perl Ports with cpan2port

  • 1. Painless Perl Ports with cpan2port Benny Siegert ‹bsiegert@gmail.com› The MirOS Project (http://www.mirbsd.org) FOSDEM 2009
  • 2. Contents 1. Introduction Perl, MirPorts 2. Presenting cpan2port with live demo 3. Implementation notes 4. Conclusion
  • 3. Perl and CPAN ‣ Comprehensive Perl Archive Network ‣ 15 000 modules by >7000 authors ➡ lots of ports to create ‣ CPAN module and shell (perl -MCPAN -eshell) does not know about ports and packages
  • 4. Ports ‣ mechanism to install 3rd-party software in BSD operating systems ‣ ports are used to create binary packages ‣ installation “recipe” in a Makefile + metadata ↪What is required to create a port?
  • 5. # $MirOS: ports/devel/svk/Makefile,v 1.4 2008/10/04 19:46:50 bsiegert Exp $ one-line description COMMENT= distributed version control system VERSION= 2.2.0 distribution name, version DASH_VER= 0 DISTNAME= SVK-v${VERSION} PKGNAME= svk-${VERSION}-${DASH_VER} category CATEGORIES= devel net HOMEPAGE= http://svk.bestpractical.com/ MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=../by-authors/id/C/CL/CLKAO/} where to download RESPONSIBLE= Benny Siegert <bsiegert@gmx.de> # LGPL PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes B_R_DEPENDS+= ::archivers/p5-PerlIO-via-Bzip2 [...] dependencies! CONFIGURE_STYLE= perl CONFIGURE_ARGS+= --defaultdeps .include <bsd.port.mk>
  • 6. Other metadata ‣ DESCR: long description (about 100 words) ‣ PLIST: packing list (automatically created) ‣ distinfo: checksums for distfile (automatically created)
  • 7. Introducing cpan2port ‣ Perl script allowing the rapid creation of Perl module ports ‣ using the CPAN module ‣ creates a stub port which may be refined and drops you to a shell ‣ only a few more commands needed in the ideal case
  • 8. … live demo … Log::Dispatch module
  • 10. How does it work? ‣ CPAN.pm discovers most of the information needed ‣ finds the distribution name for a module (e.g. D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz) ‣ for more info, “make“ the module inside cpan
  • 11. How does it work? ‣ CPAN.pm discovers most of the information needed ‣ finds the distribution name for a module (e.g. D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz) download dir ‣ for more info, “make“ the module inside cpan
  • 12. How does it work? ‣ CPAN.pm discovers most of the information needed ‣ finds the distribution name for a module (e.g. D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz) DISTNAME ‣ for more info, “make“ the module inside cpan
  • 13. How does it work? ‣ CPAN.pm discovers most of the information needed ‣ finds the distribution name for a module (e.g. D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz) EXTRACT_SUFX ‣ for more info, “make“ the module inside cpan
  • 14. Before “make“ Module id = Log::Dispatch DESCRIPTION Log messages to multiple outputs CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>) CPAN_VERSION 2.22 CPAN_FILE D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz DSLI_STATUS RdpO (released,developer,perl,object-oriented) INST_FILE (not installed) Distribution id = D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>) CONTAINSMODS Log::Dispatch::File::Locked [...]
  • 15. After “make“ Distribution id = D/DR/DROLSKY/Log-Dispatch-2.22.tar.gz CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>) CALLED_FOR Log::Dispatch CONTAINSMODS Log::Dispatch::File::Locked [...] MD5_STATUS OK archived tar build_dir /Users/bsiegert/.cpan/build/Log-Dispatch-2.22 localfile /Users/bsiegert/.cpan/sources/authors/id/D/DR/ DROLSKY/Log-Dispatch-2.22.tar.gz make YES prereq_pm Test::More Params::Validate File::Temp Module::Build prereq_pm_detected 1 unwrapped YES writemakefile YES
  • 16. Dependencies ‣ prereq_pm is a hash with module => minversion ‣ expand module to distname ‣ static table of modules in the base system, with “unsystematic“ names or non-CPAN ‣ rest: glob for /usr/ports/*/p5-NAME ‣ output dependency string in our format
  • 17. Descriptions ‣ For some modules, cpan knows a one-line description (COMMENT), not for others ‣ readmes are useless for getting a longer one ‣ parse the manpage, i.e. the POD
  • 18. POD parsing ‣ “NAME“ section contains one-line comment ‣ Log::Dispatch - Dispatches messages to one or more outputs ‣ longer description: first few paragraphs from “DESCRIPTION“ section ‣ up to first control command ‣ plain-text conversion is easy my $parser = Pod::Text->new(indent => 0, width => 72);
  • 19. finally … ‣ ask user for category, create directory ‣ variable substitution in Makefile template ‣ write DESCR ‣ copy distfile to Distfiles directory ‣ run “make checksum“ ‣ drop user to a shell, needs to run regress, update-plist, install targets
  • 20. Porting to other systems ‣ right now, cpan2port is available for MirPorts ‣ easily portable ‣ adapt perlmod.Makefile template ‣ change base module list accordingly ‣ adapt dependency output to your syntax
  • 22. ‣ cpan2port does the routine work in porting Perl modules ‣ available in MirPorts, easy to port ‣ pkgsrc, FreeBSD, OpenBSD people: try it! ‣ Sources available at http://cvs.mirbsd.de/ports/infrastructure/scripts/cpan2port http://cvs.mirbsd.de/ports/infrastructure/templates/ perlmod.Makefile
  • 23. Thank you for your attention! Questions?

Notas del editor