Perl Policy - ArchWiki - Arch Linux
文章推薦指數: 80 %
0 perl packaging conventions included: The current Arch Linux default perl installation installs site and vendor packages into the same ...
HomePackagesForumsWikiBugsSecurityAURDownload
Jumptocontent
Namespaces
PageDiscussion
English
expanded
collapsed
Views
ReadViewsourceViewhistory
More
expanded
collapsed
Navigation
MainpageTableofcontentsGettinginvolvedWikinewsRandompage
Interaction
HelpContributingRecentchangesRecenttalksNewpagesStatisticsRequests
Tools
WhatlinkshereRelatedchangesSpecialpagesPrintableversionPermanentlinkPageinformation
Thispagecoversthepolicyforhowperlitselfisconfiguredandpackaged.ForPerlmodulepackagingguidelines,seePerlpackageguidelines.
Contents
1Introduction
1.15.10caveats
1.2Reasoning
1.3Pitfalls
2Perlversions
3Modulepaths
4Documents
5Binariesandscripts
6Core
6.1Coredirectories
6.2Coreperlpackages
7Site
7.1Sitedirectories
7.2Siteinstallation
8Vendor
8.1Packagenaming
8.2Vendordirectories
8.3Vendorinstallation
8.4SamplevendorPKGBUILD
8.5Dependencies
8.5.1Binarymodules
8.5.2Architecture-independentmodules
9Perl6
Introduction
Thispolicydocumentwasproposed,accepted,andimplementedinversion5.10.0oftheperlpackage.Itisthestandardregardingtotheperlpackage,relatedPerlpackages,andcreatingPerlmodulepackages(bothinbinaryformandintheformofPKGBUILDs).PortionsarederivedfromtheDebianPerlPolicydocumentandfromvariousportionsofthePerlmanpages.
5.10caveats
NOTTRUE:ThedirectoriesforscriptsdonotconformtotheFilesystemHierarchyStandard(FHS).
Note:TheFHSdescribeswhatdirectoriesmustbein/usr/binanddoesnotprohibitaddingotherdirectories.
Reasoning
Apparentproblemswithpre-5.10.0perlpackagingconventionsincluded:
ThecurrentArchLinuxdefaultperlinstallationinstallssiteandvendorpackagesintothesamedirectorytree,whichfrequentlycausesconflictsiftheenduserinstallsandupgradesArchLinuxperl(vendor)packagesontopofsitepackages.
ThecurrentArchLinuxdefaultperlinstallationinstallsupdatestocoremodulesintotheperlcoredirectories,creatingfileconflicts.ExamplesincludemodulessuchasData::Dumperandversion.
Asymlink-farmiscreatedin/usr/lib/perl5/and/usr/lib/perl5/site_perlwhichisun-necessaryandconfusing.
Anumberofstandardmodulesseemtobemissing,orwereneglectedtobeaddedasprovidesintheperlpackageitself,causingconfusionandredundantentriesinAURandCommunityasuserstryandfixtheapparentproblemofmissingmodules,whichareprovidedbyperl.Thisisprobablyamatterofeducation.
Currentperl-modulePKGBUILD'scouldbesimplifiedandstandardizedquiteabit.
Thispolicywouldeliminatealltheseproblems.
Pitfalls
Current(apparent)downsidestoadoptingapolicysuchasthisone:
AnupdateofeveryperlmodulePKGBUILDsothatitinstallsintothecorrect(vendor)directorytree.Itremainssomewhatbackwards-compatiblewiththeoldstructure,inthatoldPKGBUILD'swouldtechnicallywork.
Introduceschangesintotheperlpackage,whichlivesinthecorerepository,andproposesanewperl-modulespackage,whichwouldliveintheextrarepository.
Non-perlpackageswhichcompilestaticcopiesoftheperlinterpreterwillnotoperatecorrectlyuntilrecompiledonanArchLinuxPCwhichadherestothisdocument.Examplesofsuchpackagesincludevim,subversion,andirssi.Manysuchexamplesexist.
Perlversions
Atanygiventime,thepackageperlshouldrepresentthecurrentstableupstreamversionofPerlrevision5.(seePerl6).
Onlyonepackagemaycontainthe/usr/bin/perlbinaryandthatpackagemusteitherbeperloradependencyofthatpackage.InordertoprovideaminimalinstallationofPerlforusebyapplicationswithoutrequiringthewholeofPerltobeinstalled,theperlpackagecontainsthebinaryandabasicsetofmodules.Theperlpackageshoulddeclareprovidestatementsforeverymoduleprovidedbythebaseperlpackage.
Modulepaths
Perlsearchesthreedifferentlocationsformodules,referredtointhisdocumentascoreinwhichmodulesdistributedwithPerlareinstalled,vendorforpackagedmodules,andsiteformodulesinstalledbythelocaladministrator.
Themodulesearchpath(@INC)intheArchLinuxpackageshasbeenorderedtoincludetheselocationsinthefollowingorder:
site
ModulesinstalledbythelocaladministratorforthecurrentversionofPerl.Typically,thesemodulesareinstalledusingthecpanorcpanptool,oraredownloadedinsourceformandinstalledviamake.
/usr/lib/perl5/site_perl/version
/usr/share/perl5/site_perl/version
vendor
Packagedmodules,installedviathepacmantoolfromthecore,extra,orcommunityrepositories,orbuiltintoproperArchLinuxpackagesfromABS/AURPKGBUILDs.
/usr/lib/perl5/vendor_perl
/usr/share/perl5/vendor_perl
core
ModulesincludedinthecorePerldistribution.
/usr/lib/perl5/core_perl
/usr/share/perl5/core_perl
obsolete
Obsoleteisthepathnametomodulesinstalledpriortotheestablishmentofthisdocument.Thesepathshavebeenremovedfrom@INCinperl5.12.2.
/usr/lib/perl5/site_perl/current/arch
/usr/lib/perl5/site_perl/current
/usr/lib/perl5/current
Ineachofthedirectorypairsabove,thelibcomponentisforbinary,architecturedependent(XS)modules,andshareforarchitecture-independent(pure-perl)modules.Undernocircumstancesshouldcurrentbeusedasareplacementforversion.CoreandVendormodulesshouldbematchedtothecurrentinstallationofperl.
Documents
ThePODfilesandmanualpagesandHTMLdocumentationwhichdonotrefertoprogramsmaybestrippedfromthepackage,whichisnormalformostArchLinuxpackagesingeneral.Thisisoptional.
ManualpagesdistributedwithPerlpackagesmustbeinstalledintothestandarddirectories:
Programs
Manualpagesforprogramsandscriptsareinstalledinto/usr/man/man1withtheextension.1perl.
Modules
Manualpagesformodulesareinstalledinto/usr/man/man3withtheextension.3perl.
Binariesandscripts
Inordertopreventfilecollisions,itisimportanttokeepbinariesgeneratedbycore,vendor,andsiteinstallsseparate.ItisalsoimportantthatthedefaultPATHenvironmentvariablesetineachusersprofiletosearchforbinariesinthesameorderasperl'[email protected],binariesshouldbeinstalledintothefollowingdirectories:
Core
Binariesandscriptsforallcorepackagesshouldbeinstalledinto/usr/bin/core_perl.
Vendor
Binariesandscriptsforallvendorpackagesshouldbeinstalledinto/usr/bin/vendor_perl.
Site
Binariesandscriptsforallsiteshoulddefaulttobeinstalledinto/usr/bin/site_perl.
Theperlpackageshouldincludeamechanismtoadjustend-usersPATHentriesaccordinglysothatperlbinariesaresearchedforinthefollowingorder:site,vendor,core.
Core
CoremodulesarePerlmodules"typically"includedinthecorePerldistribution.
Coredirectories
ModulesincludedinthecorePerldistributionshouldbeinstalledinto/usr/lib/perl5and/usr/share/perl5.
Onlymodulescontainedintheperlpackageshouldbeinstalledintothisdirectorytree.
Noversionsubdirectoryexistsinthesepathsasthedependenciesforpackagedmodulesshouldensurethatallworkwiththecurrentperlpackage.
Coreperlpackages
Theperlpackageshouldcontainthe/usr/bin/perlbinary,andaminimalsetofmodulesneededinorderforsimpleperlscriptstorunandforabasesystemtooperate.Itshouldbemaintainedinthecorerepository.
Thefollowingisalistofafewmodules(forexample),whichareprovidedintheperlpackage.(SeethePKGBUILDfortheofficiallist).
'perl-checktree''perl-collate''perl-config''perl-cwd''perl-dynaloader''perl-english''perl-env''perl-exporter''perl-fnctl''perl-filehandle''perl-find''perl-finddepth''perl-getopt''perl-makemaker''perl-socket''perl-sys-syslog''perl-db-file''perl-storable''perl-data-dumper''perl-digest-md5'.
EverymodulesuppliedintheperlpackageshallbeaddedintotheprovidesarrayinthePKGBUILD.ModulesinthisarrayshouldNOTappearintheperlpackagesconflictsorreplacesarrays.Endusersshouldbeabletoinstallnewerversionsofcoremodules,eitherinvendororsitedirectorieswithoutfilecollisions.
Site
SitemodulesareperlmodulesinstalledbythelocaladministratorforthecurrentversionofPerl.Typically,thesemodulesareinstalledusingthecpantool,oraredownloadedinsourceformandinstalledviamake(orMakeMaker).
Sitedirectories
ThePerlpackagesmustprovideamechanismforthelocaladministratortoinstallmodulesunder/usr/lib/perl5/site_perlbutmustnotcreateorremovethosedirectories.
ModulesshouldbeinstalledtothedirectoriesdescribedaboveinModulePathsite,programsto/usr/bin/site_perlandmanualpagesunder/usr/man.
Siteinstallation
Thefollowingcommandsshouldbesufficientinthemajorityofcasesforthelocaladministratortoinstallmodulesandmustcreatedirectoriesasrequired:
perlMakefile.PL
makeinstall
or
cpanFoo::Bar
Vendor
Vendormodulesarepackagedmodules,installedviathepacmantool,ormoduleswhichhavebeenbuiltintoproperArchLinuxpackagesfromaPKGBUILDandmakepkg.
Packagenaming
Perlmodulepackagesshouldbenamedfortheprimarymoduleprovided.ThenamingconventionformoduleFoo::Barisperl-foo-bar.Packageswhichincludemultiplemodulesmayadditionallyincludeprovidesforthosemodulesusingthesameconvention.
Vendordirectories
TheinstallationdirectoryforArchLinuxmodulesmustbedifferentfromthatforsitemodules.Someguidelinesinclude:
ThecurrentPerlpackagingusesthevendordirectoriesforthispurpose,whichareatpresentasdescribedinaboveasvendor.
Noversionsubdirectoryexistsonthesedirectoriesasthedependenciesforpackagedmodulesshouldensurethatallworkwiththecurrentperlpackage.
ThePerldistributionincludesmanymodulesavailableseparatelyfromCPAN,whichmayhaveanewerversion.Theintentofthe@INCordering(describedabove)istoallowsuchmodulestobepackagedtovendorwhichtakeprecedenceovertheversionincore.Apackagedmodulewhichshadowsacoremoduleinthiswaymustbeanewerversion.
Modulepackagesmustinstallmanualpagesintothestandarddirectoriesusingtheextensions.1pand.3pmtoensurethatnoconflictariseswhereapackagedmoduleduplicatesacoremodule.
.packlist(usedformoduleuninstalls)andperllocal.pod(usedtorecordlocal/siteinstallations)filesshouldnotbeinstalled,andshouldberemovedfromthepackageiffound.
Emptydirectoriesshouldbepruned.
Vendorinstallation
AmoduleshouldusethefollowinglinesinthePKGBUILDbuildtarget.
perlMakefile.PLINSTALLDIRS=vendor
andthisonetoinstalltheresultsintothetemporarytree...
makeinstallDESTDIR="${pkgdir}"install
Adependsonperl(>=5.10.0)isrequiredinorderensurethatthemoduleiscorrectlyinstalledintothenew@INCpath.
SamplevendorPKGBUILD
#$Id$
#Contributor:BarryUser
延伸文章資訊
- 1Perl Policy - ArchWiki - Arch Linux
0 perl packaging conventions included: The current Arch Linux default perl installation installs ...
- 2Perl - ArchWiki
The Comprehensive Perl Archive Network (CPAN) is a repository of over 250,000 software modules an...
- 3perl-net-ssleay 1.92-1 (x86_64) - Arch Linux
The Arch Linux name and logo are recognized trademarks. Some rights reserved. The registered trad...
- 4perl-io-socket-ssl 2.075-1 (any) - Arch Linux
- 5perl-uri 5.15-1 (any) - Arch Linux