bsd.port.mk 194 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626
  1. #-*- tab-width: 4; -*-
  2. # ex:ts=4
  3. #
  4. # bsd.port.mk - 940820 Jordan K. Hubbard.
  5. # This file is in the public domain.
  6. #
  7. # Please view me with 4 column tabs!
  8. # This is the master file for the most common elements to all port
  9. # Makefile in the ports system. For a more general overview of its
  10. # use and importance, see the Porter's Handbook.
  11. # There are two different types of "maintainers" in the ports framework.
  12. # The maintainer alias of the bsd.port.mk file is listed below in the
  13. # FreeBSD_MAINTAINER entry. You should consult them if you have any
  14. # questions/suggestions regarding this file.
  15. #
  16. # DO NOT COMMIT CHANGES TO THIS FILE BY YOURSELF, EVEN IF YOU DID NOT GET
  17. # A RESPONSE FROM THE MAINTAINER(S) WITHIN A REASONABLE TIMEFRAME! ALL
  18. # UNAUTHORISED CHANGES WILL BE UNCONDITIONALLY REVERTED!
  19. FreeBSD_MAINTAINER= portmgr@FreeBSD.org
  20. # For each port, the MAINTAINER variable is what you should consult for
  21. # contact information on the person(s) to contact if you have questions/
  22. # suggestions about that specific port. By default (if no MAINTAINER
  23. # is listed), a port is maintained by the subscribers of the ports@FreeBSD.org
  24. # mailing list, and any correspondence should be directed there.
  25. #
  26. # MAINTAINER - The e-mail address of the contact person for this port.
  27. # Default: ports@FreeBSD.org
  28. #
  29. # These are meta-variables that are automatically set to the system
  30. # you are running on. These are provided in case you need to take
  31. # different actions for different values.
  32. #
  33. # ARCH - The architecture of the target machine, such as would be
  34. # returned by "uname -p".
  35. # OPSYS - Portability clause. This is the operating system the
  36. # makefile is being used on. Automatically set to
  37. # "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
  38. # OSREL - The release version of the operating system as a text
  39. # string (e.g., "12.4").
  40. # OSVERSION - The operating system version as a comparable integer;
  41. # the value of __FreeBSD_version (e.g., 1302000).
  42. #
  43. # This is the beginning of the list of all variables that need to be
  44. # defined in a port, listed in order that they should be included
  45. # to fit in with existing conventions. (Exception: MAINTAINER actually
  46. # should appear after EXTRACT_ONLY and before MASTER_SITE_BACKUP).
  47. #
  48. # These variables are used to identify your port.
  49. #
  50. # PORTNAME - Name of software. Mandatory.
  51. # PORTVERSION - Version of software. Mandatory when no DISTVERSION is given.
  52. # PORTREVISION - Version of port. Optional. Commonly used to indicate
  53. # that an update has happened that affects the port
  54. # framework itself, but not the distributed software
  55. # (e.g., local patches or Makefile changes).
  56. # PORTEPOCH - Optional. In certain odd cases, the PORTREVISION logic
  57. # can be fooled by ports that appear to go backwards
  58. # numerically (e.g. if port-0.3 is newer than port-1998).
  59. # In this case, incrementing PORTEPOCH forces the revision.
  60. # Default: 0 (no effect).
  61. # PKGNAME - Always defined as
  62. # ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}.
  63. # Do not define this in your Makefile.
  64. # PKGNAMEPREFIX - Prefix to specify that port is language-specific, etc.
  65. # Optional.
  66. # PKGNAMESUFFIX - Suffix to specify compilation options or a version
  67. # designator (in case there are different versions of
  68. # one port as is the case for Tcl).
  69. # Optional.
  70. # PKGVERSION - Version of package.
  71. # Do not define this in your Makefile.
  72. # DISTVERSION - Vendor version of the distribution.
  73. # Default: ${PORTVERSION}
  74. # DISTNAME - Name of port or distribution used in generating
  75. # WRKSRC and DISTFILES below.
  76. # Default:
  77. # ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
  78. # CATEGORIES - A list of descriptive categories into which this port falls.
  79. # Mandatory.
  80. #
  81. # These variable describe how to fetch files required for building the port.
  82. #
  83. # DISTFILES - Name(s) of archive file(s) containing distribution.
  84. # Set this to an empty string if the port doesn't require it.
  85. # Default: ${DISTNAME}${EXTRACT_SUFX}
  86. # EXTRACT_SUFX - Suffix for archive names
  87. # You never have to set both DISTFILES and EXTRACT_SUFX.
  88. # Default: .tar.bz2 if USES=tar:bzip2 is set, .tar.xz if
  89. # USES=tar:xz USE_XZ is set, .tar.gz otherwise).
  90. # MASTER_SITES - Primary location(s) for distribution files if not found
  91. # locally. See bsd.sites.mk for common choices for
  92. # MASTER_SITES.
  93. # MASTER_SITE_SUBDIR
  94. # - Subdirectory of MASTER_SITES. Will sometimes need to be
  95. # set to ${PORTNAME} for (e.g.) MASTER_SITE_SOURCEFORGE.
  96. # Only guaranteed to work for choices of ${MASTER_SITES}
  97. # defined in bsd.sites.mk.
  98. # Default: not set.
  99. # PATCHFILES - Name(s) of additional files that contain distribution
  100. # patches. Make will look for them at PATCH_SITES (see below).
  101. # They will automatically be uncompressed before patching if
  102. # the names end with ".gz", ".bz2" or ".Z".
  103. # For each file you can optionally specify a strip
  104. # flag of patch(1) after a colon if it has a different
  105. # base directory, e.g. "file1 file2:-p1 file3".
  106. # You can also use a :group at the end for matching up to
  107. # dist file groups. See Porters Handbook for more information.
  108. # Syntax: PATCHFILES= patch[:-pX][:group]
  109. # Default: not set.
  110. # PATCH_SITES - Primary location(s) for distribution patch files
  111. # if not found locally.
  112. # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} and
  113. # ${PATCHFILES} will be put in this subdirectory of
  114. # ${DISTDIR} (see below). Also they will be fetched in this
  115. # subdirectory from FreeBSD mirror sites.
  116. # ALLFILES - All of ${DISTFILES} and ${PATCHFILES}.
  117. # EXTRACT_ONLY - If set, a subset of ${DISTFILES} you want to
  118. # actually extract.
  119. #
  120. # (NOTE: by convention, the MAINTAINER entry (see above) should go here.)
  121. #
  122. # COMMENT - A short description of the package (less than 70 characters)
  123. # WWW - URL users can get more information on the provided package
  124. # was previously part of pkg-descr
  125. #
  126. # The following variables are typically set in /etc/make.conf to indicate
  127. # the user's preferred location to fetch files from. You should rarely
  128. # need to set these.
  129. #
  130. # MASTER_SITE_BACKUP
  131. # - Backup location(s) for distribution files and patch
  132. # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}.
  133. # This should *not* be changed.
  134. # Default:
  135. # http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
  136. # MASTER_SITE_OVERRIDE
  137. # - If set, prepend the MASTER_SITES setting with this value.
  138. # MASTER_SITE_FREEBSD
  139. # - If set, prepend ${MASTER_SITE_BACKUP} in MASTER_SITES.
  140. #
  141. # Set these if your port should not be built under certain circumstances.
  142. # These are string variables; you should set them to the reason why
  143. # they are necessary.
  144. #
  145. # RESTRICTED - Prevent the distribution of distfiles and packages to
  146. # the FTP sites or on CDROM (e.g. forbidden by license
  147. # considerations).
  148. # NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must
  149. # not be re-sold) but can go on FTP sites.
  150. # NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs,
  151. # but distfiles can be put on ftp sites and CDROMs.
  152. # FORBIDDEN - Package build should not be attempted because of
  153. # security vulnerabilities.
  154. # IGNORE - Package build should be skipped entirely (e.g.
  155. # because of serious unfixable problems in the build,
  156. # because it cannot be manually fetched, etc). Error
  157. # logs will not appear on pointyhat, so this should be
  158. # used sparingly.
  159. # IGNORE_${ARCH} - Port should be ignored on ${ARCH}.
  160. # IGNORE_${OPSYS} - Port should be ignored on ${OPSYS}.
  161. # IGNORE_${OPSYS}_${OSREL:R} - Port should be ignored on a single
  162. # release of ${OPSYS}, e.g IGNORE_FreeBSD_13
  163. # would affect all point releases of FreeBSD 13.
  164. # IGNORE_${OPSYS}_${OSREL:R}_${ARCH} - Port should be ignored on a
  165. # single release of ${OPSYS} and specific architecture,
  166. # e.g IGNORE_FreeBSD_13_i386 would affect all point
  167. # releases of FreeBSD 13 in i386.
  168. # BROKEN - Port is believed to be broken. Package builds can
  169. # still be attempted using TRYBROKEN to test this
  170. # assumption.
  171. # BROKEN_${ARCH} - Port is believed to be broken on ${ARCH}. Package builds
  172. # can still be attempted using TRYBROKEN to
  173. # test this assumption.
  174. # BROKEN_${OPSYS} - Port is believed to be broken on ${OPSYS}. Package builds
  175. # can still be attempted using TRYBROKEN to
  176. # test this assumption.
  177. # BROKEN_${OPSYS}_${OSREL:R} - Port is believed to be broken on a single
  178. # release of ${OPSYS}, e.g BROKEN_FreeBSD_13
  179. # would affect all point releases of FreeBSD 13
  180. # unless TRYBROKEN is also set.
  181. # BROKEN_${OPSYS}_${OSREL:R}_${ARCH} - Port is believed to be broken on a
  182. # single release of ${OPSYS} and specific architecture,
  183. # e.g BROKEN_FreeBSD_13 would affect all point
  184. # releases of FreeBSD 13 in i386
  185. # unless TRYBROKEN is also set.
  186. # DEPRECATED - Port is deprecated to install. Advisory only.
  187. # EXPIRATION_DATE
  188. # - If DEPRECATED is set, determines a date when
  189. # the port is planed to remove. The date format is
  190. # ISO 8601 (YYYY-MM-DD).
  191. #
  192. # DISABLE_VULNERABILITIES
  193. # - If set, do not check if the port is listed in the
  194. # vulnerabilities database.
  195. #
  196. # In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles
  197. # or patchfiles have redistribution restrictions, set the following
  198. # to the list of such files.
  199. #
  200. # RESTRICTED_FILES
  201. # - List of files that cannot be redistributed.
  202. # Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED
  203. # or NO_CDROM is set, empty otherwise.
  204. #
  205. # These variables are booleans, so you don't need to set them to the reason.
  206. #
  207. # IS_INTERACTIVE
  208. # - Set this if your port needs to interact with the user
  209. # during any step in a package build. User can then decide
  210. # to skip this port by setting ${BATCH}, or compiling only
  211. # the interactive ports by setting ${INTERACTIVE}.
  212. # Default: not set.
  213. # USE_SUBMAKE - Set this if you want that each of the port's main 7 targets
  214. # (extract, patch, configure, build, stage, install and
  215. # package) to be executed in a separate make(1) process.
  216. # Useful when one of the stages needs to influence make(1)
  217. # variables of the later stages using ${WRKDIR}/Makefile.inc
  218. # generated on the fly.
  219. # Default: not set.
  220. #
  221. # NO_ARCH - Set this if port is architecture neutral.
  222. #
  223. # NO_ARCH_IGNORE - Set this to a list files to ignore when NO_ARCH is checked
  224. # in stage-qa (i.e. architecture specific files that are
  225. # 'bundled' with the port).
  226. #
  227. # Set these if your port only makes sense to certain architectures.
  228. # They are lists containing names for them (e.g., "amd64 i386").
  229. # (Defaults: not set.)
  230. #
  231. # ONLY_FOR_ARCHS
  232. # - Only build ports if ${ARCH} matches one of these.
  233. # NOT_FOR_ARCHS - Only build ports if ${ARCH} doesn't match one of these.
  234. # ONLY_FOR_ARCHS_REASON
  235. # ONLY_FOR_ARCHS_REASON_${ARCH}
  236. # - Reason why it's only for ${ONLY_FOR_ARCHS}s
  237. # NOT_FOR_ARCHS_REASON
  238. # NOT_FOR_ARCHS_REASON_${ARCH}
  239. # - Reason why it's not for ${NOT_FOR_ARCHS}s
  240. # IA32_BINARY_PORT
  241. # - Set this instead of ONLY_FOR_ARCHS if the given port
  242. # fetches and installs compiled i386 binaries.
  243. #
  244. # Dependency checking. Use these if your port requires another port
  245. # not in the list below. (Default: empty.)
  246. #
  247. # EXTRACT_DEPENDS
  248. # - A list of "path:dir[:target]" tuples of other ports this
  249. # package depends on in the "extract" stage. "path" is
  250. # the name of a file if it starts with a slash (/), an
  251. # executable otherwise. make will test for the existence
  252. # (if it is a full pathname) or search for it in your
  253. # $PATH (if it is an executable) and go into "dir" to do
  254. # a "make all install" if it's not found. If the third
  255. # field ("target") exists, it will be used instead of
  256. # ${DEPENDS_TARGET}. The first field also supports a
  257. # package name with a version range, in the form package>=1.2
  258. # if a particular version is desired.
  259. # PATCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
  260. # package depends on in the "patch" stage. "path" is the
  261. # name of a file if it starts with a slash (/), an
  262. # executable otherwise. make will test for the existence
  263. # (if it is a full pathname) or search for it in your
  264. # $PATH (if it is an executable) and go into "dir" to do
  265. # a "make all install" if it's not found. If the third
  266. # field ("target") exists, it will be used instead of
  267. # ${DEPENDS_TARGET}. The first field also supports a
  268. # package name with a version range, in the form package>=1.2
  269. # if a particular version is desired.
  270. # FETCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
  271. # package depends in the "fetch" stage. "path" is the
  272. # name of a file if it starts with a slash (/), an
  273. # executable otherwise. make will test for the
  274. # existence (if it is a full pathname) or search for
  275. # it in your $PATH (if it is an executable) and go
  276. # into "dir" to do a "make all install" if it's not
  277. # found. If the third field ("target") exists, it will
  278. # be used instead of ${DEPENDS_TARGET}. The first field
  279. # also supports a package name with a version range, in
  280. # the form package>=1.2 if a particular version is desired.
  281. # BUILD_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
  282. # package depends to build (between the "extract" and
  283. # "build" stages, inclusive). The test done to
  284. # determine the existence of the dependency is the
  285. # same as FETCH_DEPENDS. If the third field ("target")
  286. # exists, it will be used instead of ${DEPENDS_TARGET}.
  287. # RUN_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
  288. # package depends to run. The test done to determine
  289. # the existence of the dependency is the same as
  290. # FETCH_DEPENDS. This will be checked during the
  291. # "install" stage and the name of the dependency will
  292. # be put into the package as well. If the third field
  293. # ("target") exists, it will be used instead of
  294. # ${DEPENDS_TARGET}. The first field also supports a
  295. # package name with a version range, in the form package>=1.2
  296. # if a particular version is desired.
  297. # LIB_DEPENDS - A list of "lib:dir[:target]" tuples of other ports this
  298. # package depends on. "lib" is the name of a shared library.
  299. # TEST_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
  300. # package depends on in the "test" stage. "path" is the
  301. # name of a file if it starts with a slash (/), an
  302. # executable otherwise. make will test for the existence
  303. # (if it is a full pathname) or search for it in your
  304. # $PATH (if it is an executable) and go into "dir" to do
  305. # a "make all install" if it's not found. If the third
  306. # field ("target") exists, it will be used instead of
  307. # ${DEPENDS_TARGET}. The first field also supports a
  308. # package name with a version range, in the form package>=1.2
  309. # if a particular version is desired.
  310. # DEPENDS_TARGET
  311. # - The default target to execute when a port is calling a
  312. # dependency.
  313. # Default: install
  314. #
  315. # These variables control options about how a port gets built and/or
  316. # are shorthand notations for common sets of dependencies.
  317. # Use these if your port uses some of the common software packages. By
  318. # convention these should be set to 'yes', although they only need to be
  319. # defined. Defaults: not set, unless explicitly indicated below.
  320. #
  321. # Note: the distinction between the USE_* and WANT_* variables, and the
  322. # WITH_* and WITHOUT_* variables, are that the former are restricted to
  323. # usage inside the ports framework, and the latter are reserved for user-
  324. # settable options. (Setting USE_* in /etc/make.conf is always wrong).
  325. #
  326. # WITH_DEBUG_PORTS - A list of origins for which WITH_DEBUG will be set
  327. #
  328. # WITHOUT_SSP - Disable SSP.
  329. #
  330. # SSP_CFLAGS - Defaults to -fstack-protector. This value
  331. # is added to CFLAGS and the necessary flags
  332. # are added to LDFLAGS. Note that SSP_UNSAFE
  333. # can be used in Makefiles by port maintainers
  334. # if a port breaks with it (it should be
  335. # extremely rare).
  336. # PIE_CFLAGS - Defaults to -fPIE -fPIC. This value
  337. # is added to CFLAGS and the necessary flags
  338. # are added to LDFLAGS. Note that PIE_UNSAFE
  339. # can be used in Makefiles by port maintainers
  340. # if a port breaks with it.
  341. ##
  342. # USE_LOCALE - LANG and LC_ALL are set to the value of this variable in
  343. # CONFIGURE_ENV and MAKE_ENV. Example: USE_LOCALE=en_US.UTF-8
  344. ##
  345. # USE_GCC - If set, this port requires this version of gcc, either in
  346. # the system or installed from a port.
  347. # USE_CSTD - Override the default C language standard (gnu89, gnu99)
  348. # USE_CXXSTD Override the default C++ language standard
  349. # USE_BINUTILS - Use binutils suite from port instead of the version in base.
  350. # CFLAGS_${ARCH} Append the cflags to CFLAGS only on the specified architecture
  351. # CXXFLAGS_${ARCH}
  352. # Append the cxxflags to CXXFLAGS only on the specified architecture
  353. ##
  354. # LDFLAGS_${ARCH} Append the ldflags to LDFLAGS only on the specified architecture
  355. ##
  356. # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries.
  357. # Implies: WANT_OPENLDAP_VER?=24
  358. # WANT_OPENLDAP_VER
  359. # - Legal values are: 24
  360. # If set to an unknown value, the port is marked BROKEN.
  361. ##
  362. # USE_JAVA - If set, this port relies on the Java language.
  363. # Implies inclusion of bsd.java.mk. (Also see
  364. # that file for more information on USE_JAVA_*).
  365. # USE_OCAML - If set, this port relies on the OCaml language.
  366. # Implies inclusion of bsd.ocaml.mk. (Also see
  367. # that file for more information on USE_OCAML*).
  368. ##
  369. # USE_GECKO - If set, this port uses the Gecko/Mozilla product.
  370. # See bsd.gecko.mk for more details.
  371. ##
  372. # USE_WX - If set, this port uses the WxWidgets library and related
  373. # components. See bsd.wx.mk for more details.
  374. ##
  375. # USE_LINUX_PREFIX
  376. # - Controls the action of PREFIX (see above). Only use this
  377. # if the port is a Linux infrastructure port (e.g. contains libs
  378. # or a sound server which supports the FreeBSD native one),
  379. # use the default prefix if it's a leaf port (e.g. a game or
  380. # program).
  381. # Implies NO_LICENSES_INSTALL=yes, NO_MTREE=yes, and causes
  382. # Linux ldconfig to be used when USE_LDCONFIG is defined.
  383. ##
  384. # USE_TEX - A list of the TeX dependencies the port has.
  385. #
  386. ##
  387. # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
  388. # routines found in /etc/rc.subr.
  389. # If this is set to a list of files, these files will be
  390. # automatically added to ${SUB_FILES}, some %%VAR%%'s will
  391. # automatically be expanded, they will be installed in
  392. # ${PREFIX}/etc/rc.d if ${PREFIX} is not /usr, otherwise they
  393. # will be installed in /etc/rc.d/ and added to the packing list.
  394. ##
  395. # Conflict checking. Use if your port cannot be installed at the same time as
  396. # another package.
  397. #
  398. # CONFLICTS - A list of package name patterns that the port conflicts
  399. # with, separated by blanks. The names may include shell
  400. # pattern meta-characters "*", "?", "[", "]", and "!".
  401. # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
  402. #
  403. # CONFLICTS_BUILD
  404. # - Check conflict prior to the build.
  405. #
  406. # CONFLICTS_INSTALL
  407. # - Check conflict prior to the installation stage.
  408. #
  409. # Various directory definitions and variables to control them.
  410. # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
  411. #
  412. # LOCALBASE - Where ports install things.
  413. # Default: /usr/local
  414. # LINUXBASE - Where Linux ports install things.
  415. # Default: /compat/linux
  416. # PREFIX - Where *this* port installs its files.
  417. # Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
  418. # otherwise ${LOCALBASE}
  419. #
  420. # IGNORE_PATH_CHECKS
  421. # - There are some sanity checks against PREFIX.
  422. # You can disable these checks with defining
  423. # this variable, but this is not recommended!
  424. # Only do this if you really know what you are
  425. # doing. These sanity checks are the following:
  426. # - PREFIX has to be an absolute path.
  427. # - PREFIX can't have a trailing slash.
  428. #
  429. # BUNDLE_LIBS Teach pkg(8) to not automatically add all shared libraries
  430. # installed by a port as shared libraries "provided" for
  431. # other packages (i.e., do not expose them in the solver).
  432. # This has to be used for ports that bundle third party
  433. # libraries for internal usage.
  434. # MASTERDIR - Where the port finds patches, package files, etc. Define
  435. # this is you have two or more ports that share most of the
  436. # files.
  437. # Default: ${.CURDIR}
  438. # PORTSDIR - The root of the ports tree.
  439. # Default: /usr/ports
  440. # DISTDIR - Where to search for and store copies of original sources
  441. # Default: ${PORTSDIR}/distfiles
  442. # PACKAGES - A top level directory where all packages go (rather than
  443. # going locally to each port).
  444. # Default: ${PORTSDIR}/packages
  445. # WRKDIRPREFIX - The place to root the temporary working directory
  446. # hierarchy. This path must *not* end in '/'.
  447. # Default: none
  448. # WRKDIR - A temporary working directory that gets *clobbered* on clean
  449. # Default: ${WRKDIRPREFIX}${.CURDIR}/work
  450. # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
  451. # unpacks to.
  452. # Default: ${WRKDIR}/${DISTNAME}
  453. # WRKSRC_SUBDIR - A subdirectory of ${WRKSRC} where the distribution actually
  454. # builds in.
  455. # Default: not set
  456. # NO_WRKSUBDIR - Assume port unpacks without a subdirectory, and extract it in
  457. # ${WRKSRC} instead of ${WRKDIR}.
  458. # PATCHDIR - A directory containing any additional patches you made
  459. # to port this software to FreeBSD.
  460. # Default: ${MASTERDIR}/files
  461. # SCRIPTDIR - A directory containing any auxiliary scripts
  462. # Default: ${MASTERDIR}/scripts
  463. # FILESDIR - A directory containing any miscellaneous additional files.
  464. # Default: ${MASTERDIR}/files
  465. # PKGDIR - A directory containing any package creation files.
  466. # Default: ${MASTERDIR}
  467. # SRC_BASE - The root of the src tree. (Some ports require this to get
  468. # kernel sources). Default: /usr/src
  469. # UID_FILES - A list of files containing information about registered UIDs.
  470. # Note that files have decreasing priority.
  471. # GID_FILES - A list of files containing information about registered GIDs.
  472. # Note that files have decreasing priority.
  473. #
  474. # Variables that serve as convenient "aliases" for your *-install targets.
  475. # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
  476. #
  477. # INSTALL_PROGRAM
  478. # - A command to install binary executables. (By
  479. # default, also strips them, unless ${STRIP} is
  480. # overridden to be the empty string).
  481. # INSTALL_KLD - As INSTALL_PROGRAM, but without the STRIP.
  482. # INSTALL_LIB - As INSTALL_DATA, but also strips the file.
  483. # INSTALL_SCRIPT
  484. # - A command to install executable scripts.
  485. # INSTALL_DATA - A command to install sharable data and static libs.
  486. # INSTALL_MAN - A command to install manpages and documentation.
  487. # COPYTREE_BIN
  488. # COPYTREE_SHARE
  489. # - Similiar to INSTALL_PROGRAM and INSTALL_DATA commands but
  490. # working on whole trees of directories, takes 3 arguments,
  491. # last one is find(1) arguments and optional.
  492. # Example use:
  493. # cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR} "! -name *\.bak"
  494. #
  495. # Installs all directories and files from ${WRKSRC}/doc
  496. # to ${DOCSDIR} except sed(1) backup files.
  497. #
  498. # Set the following to specify all .info files your port installs.
  499. #
  500. # INFO - A list of .info files (omitting the trailing ".info");
  501. # only one entry per document! These files are listed in
  502. # the path relative to ${INFO_PATH}.
  503. # INFO_PATH - Path, where all .info files will be installed by your
  504. # port, relative to ${PREFIX}
  505. #
  506. # Set the following to specify all documentation your port installs into
  507. # ${DOCSDIR}
  508. #
  509. # PORTDOCS - A list of files and directories relative to DOCSDIR.
  510. # Shell glob patterns can be used, directories include
  511. # the entire subtree of contained files and directories.
  512. # Should not be set when no documentation files are
  513. # installed.
  514. # Useful for dynamically generated documentation.
  515. #
  516. # Set the following to specify all documentation your port installs into
  517. # ${EXAMPLESDIR}
  518. #
  519. # PORTEXAMPLES - A list of files and directories relative to EXAMPLESDIR.
  520. # Shell glob patterns can be used, directories include
  521. # the entire subtree of contained files and directories.
  522. # Should not be set when no examples files are
  523. # installed.
  524. # Useful for dynamically generated examples.
  525. #
  526. # Set the following to specify all files and directories your port installs into
  527. # ${DATADIR}
  528. #
  529. # PORTDATA - A list of files and directories relative to DATADIR.
  530. # Shell glob patterns can be used, directories include
  531. # the entire subtree of contained files and directories.
  532. # Should not be set when no data files are
  533. # installed.
  534. # Useful for dynamically generated data files.
  535. #
  536. # Default targets and their behaviors:
  537. #
  538. # fetch - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
  539. # port.
  540. # fetch-list - Show list of commands to retrieve missing ${DISTFILES} and
  541. # ${PATCHFILES} for this port.
  542. # fetch-recursive
  543. # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
  544. # port and dependencies.
  545. # fetch-recursive-list
  546. # - Show list of commands to retrieve missing ${DISTFILES} and
  547. # ${PATCHFILES} for this port and dependencies.
  548. # fetch-required
  549. # - Retrieves missing ${DISTFILES} and ${PATCHFILES} for this
  550. # port and dependencies.
  551. # fetch-required-list
  552. # - Show list of commands to retrieve missing ${DISTFILES} and
  553. # ${PATCHFILES} for this port and dependencies.
  554. # fetch-url-list
  555. # - Show list of URLS to retrieve missing ${DISTFILES} and
  556. # ${PATCHFILES} for this port.
  557. # fetch-url-recursive-list
  558. # - Show list of URLS to retrieve missing ${DISTFILES} and
  559. # ${PATCHFILES} for this port and dependencies.
  560. # fetch-urlall-list
  561. # - Show list of URLS to retrieve ${DISTFILES} and
  562. # ${PATCHFILES} for this port.
  563. # fetch-urlall-recursive-list
  564. # - Show list of URLS to retrieve ${DISTFILES} and
  565. # ${PATCHFILES} for this port and dependencies.
  566. # all-depends-list
  567. # - Show all directories which are dependencies
  568. # for this port.
  569. # build-depends-list
  570. # - Show all directories which are build-dependencies
  571. # for this port.
  572. # package-depends-list
  573. # - Show all directories which are package-dependencies
  574. # for this port. This is based upon the dependency
  575. # tree as recorded in the Makefiles of the ports
  576. # collection, not as recorded in the currently
  577. # installed ports.
  578. # actual-package-depends
  579. # - Like package-depends-list but with the difference
  580. # that the dependencies of the currently installed
  581. # ports are used instead of the dependencies as
  582. # recorded in the ports collection.
  583. # run-depends-list
  584. # - Show all directories which are run-dependencies
  585. # for this port.
  586. # test-depends-list
  587. # - Show all directories which are test-dependencies
  588. # for this port.
  589. # install-missing-packages
  590. # - Install missing dependencies from package and mark
  591. # them as automatically installed.
  592. # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
  593. # patch - Apply any provided patches to the source.
  594. # configure - Runs either GNU configure, one or more local configure
  595. # scripts or nothing, depending on what's available.
  596. # build - Actually compile the sources.
  597. # install - Install the results of a build.
  598. # reinstall - Install the results of a build, deinstalling any previous
  599. # installation if needed.
  600. # deinstall - Remove the installation.
  601. # deinstall-all - Remove all installations with the same PKGORIGIN.
  602. # test - Run tests for the port.
  603. # package - Create a package from an _installed_ port.
  604. # package-recursive
  605. # - Create a package for a port and _all_ of its dependencies.
  606. # describe - Try to generate a one-line description for each port for
  607. # use in INDEX files and the like.
  608. # describe-json - Generate a JSON-compliant representation of each port.
  609. # check-plist - Checks for files missing from the plist, and files in the
  610. # plist that are not installed by the port.
  611. # check-sanity - Perform some basic checks of the port layout.
  612. # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
  613. # give incorrect results if multiple patches deal with
  614. # the same file.
  615. # checksum - Use distinfo to ensure that your distfiles are valid.
  616. # checksum-recursive
  617. # - Run checksum in this port and all dependencies.
  618. # makesum - Generate distinfo (only do this for your own ports!).
  619. # clean - Remove ${WRKDIR} and other temporary files used for building.
  620. # clean-depends - Do a "make clean" for all dependencies.
  621. # config - Configure options for this port (using ${DIALOG}).
  622. # Automatically run prior to extract, patch, configure, build,
  623. # install, and package.
  624. # config-recursive
  625. # - Configure options for this port for a port and all its
  626. # dependencies.
  627. # showconfig - Display options config for this port.
  628. # showconfig-recursive
  629. # - Display options config for this port and all its
  630. # dependencies.
  631. # rmconfig - Remove the options config for this port.
  632. # rmconfig-recursive
  633. # - Remove the options config for this port and all its
  634. # dependencies.
  635. #
  636. # Default sequence for "all" is:
  637. #
  638. # check-sanity fetch checksum extract patch configure build
  639. #
  640. # Please read the comments in the targets section below; you
  641. # should be able to use the pre-* or post-* targets/scripts
  642. # (which are available for every stage except checksum) or
  643. # override the do-* targets to do pretty much anything you want.
  644. #
  645. # The TARGET_ORDER_OVERRIDE variable can be set to multiple <priority>:<target>
  646. # to change the ordering of targets, have a look at the _SEQ variables at the
  647. # end of this file for the default order and priorities.
  648. #
  649. # NEVER override the "regular" targets unless you want to open
  650. # a major can of worms.
  651. #
  652. # Set these variables if your port doesn't need some of the steps.
  653. # Note that there are no NO_PATCH or NO_CONFIGURE variables because
  654. # those steps are empty by default. NO_EXTRACT is not allowed anymore
  655. # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
  656. # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
  657. #
  658. # NO_BUILD - Use a dummy (do-nothing) build target.
  659. # NO_INSTALL - Use a dummy (do-nothing) install target.
  660. # NO_TEST - Use a dummy (do-nothing) test target.
  661. #
  662. # Here are some variables used in various stages.
  663. #
  664. # For options see bsd.options.mk
  665. #
  666. # WRK_ENV - Environment used when running the upstream build system.
  667. # Target-specific environment variables can be defined using
  668. # CONFIGURE_ENV, MAKE_ENV, TEST_ENV, and similar variables.
  669. #
  670. # For fetch:
  671. #
  672. # FETCH_BINARY - Path to ftp/http fetch command if not in $PATH.
  673. # Default: "/usr/bin/fetch"
  674. # FETCH_ARGS - Arguments to ftp/http fetch command.
  675. # Default: "-Fpr"
  676. # FETCH_CMD - ftp/http fetch command.
  677. # Default: ${FETCH_BINARY} ${FETCH_ARGS}
  678. # FETCH_BEFORE_ARGS
  679. # - Arguments to ${FETCH_CMD} before filename.
  680. # Default: none
  681. # FETCH_AFTER_ARGS
  682. # - Arguments to ${FETCH_CMD} following filename.
  683. # Default: none
  684. # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
  685. # Default: none
  686. # FETCH_REGET - Times to retry fetching of files on checksum errors.
  687. # Default: 1
  688. # CLEAN_FETCH_ENV
  689. # - Disable package dependency in fetch target for mass
  690. # fetching. User settable.
  691. #
  692. # For extract:
  693. #
  694. # EXTRACT_CMD - Command for extracting archive
  695. # Default: ${TAR}
  696. # EXTRACT_BEFORE_ARGS
  697. # - Arguments to ${EXTRACT_CMD} before filename.
  698. # Default: "-xf"
  699. # EXTRACT_AFTER_ARGS
  700. # - Arguments to ${EXTRACT_CMD} following filename.
  701. # Default: "--no-same-owner --no-same-permissions"
  702. # For patch:
  703. #
  704. # EXTRA_PATCHES - Define this variable if you have patches not in
  705. # ${PATCHDIR}. This usually happens when you need to
  706. # do some pre-processing before some distribution
  707. # patches can be applied. In that case, fetch them as
  708. # extra distfiles, put the processed results in
  709. # ${WRKDIR}, then point EXTRA_PATCHES to them.
  710. # The patches specified by this variable will be
  711. # applied after the normal distribution patches but
  712. # before those in ${PATCHDIR}. This can also contain
  713. # directories, all the files named patch-* in those directories
  714. # will be applied.
  715. # EXTRA_PATCH_TREE - where to find extra 'out-of-tree' patches
  716. # Points to a directory hierarchy with the same layout
  717. # as the ports tree, where local patches can be found.
  718. # This allows a third party to keep their patches in
  719. # some other source control system if needed.
  720. # PATCH_WRKSRC - Directory to apply patches in.
  721. # Default: ${WRKSRC}
  722. #
  723. # For configure:
  724. #
  725. # HAS_CONFIGURE - If set, this port has its own configure script. The
  726. # configure stage will not do anything if this is not set.
  727. # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
  728. # HAS_CONFIGURE.
  729. # CONFIGURE_OUTSOURCE - If set, this port builds in an empty ${CONFIGURE_WRKSRC}
  730. # not being under ${WRKSRC}.
  731. # CONFIGURE_WRKSRC
  732. # - Directory to run configure in.
  733. # Default: ${WRKSRC}
  734. # CONFIGURE_SCRIPT
  735. # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
  736. # Default: "Makefile.PL" if USES=perl5 and USE_PERL5=configure
  737. # are set, "configure" otherwise.
  738. # CONFIGURE_TARGET
  739. # - The name of target to call when GNU_CONFIGURE is
  740. # defined.
  741. # Default: ${ARCH}-portbld-${OPSYS:tl}${OSREL}
  742. # GNU_CONFIGURE_PREFIX
  743. # - The directory passed as prefix to the configure script if
  744. # GNU_CONFIGURE is set.
  745. # Default: ${PREFIX}
  746. # CONFIGURE_ARGS
  747. # - Pass these args to configure if ${HAS_CONFIGURE} is set.
  748. # Default: "--prefix=${GNU_CONFIGURE_PREFIX}
  749. # --infodir=${PREFIX}/${INFO_PATH} --localstatedir=/var
  750. # --mandir=${PREFIX}/share/man --build=${CONFIGURE_TARGET}" if
  751. # GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
  752. # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
  753. # INSTALLARCHLIB=${PREFIX}/lib" if USES=perl5 and
  754. # USE_PERL5=configure are set, empty otherwise.
  755. # CONFIGURE_ENV - Pass these env (shell-like) to configure if
  756. # ${HAS_CONFIGURE} is set.
  757. # CONFIGURE_LOG - The name of configure log file. It will be printed to
  758. # the screen if configure fails.
  759. # Default: config.log
  760. # CONFIGURE_FAIL_MESSAGE
  761. # - A message displayed to users when configure
  762. # fails (note: this assumes the do-configure
  763. # target has not been overwritten). This message
  764. # will be passed through /usr/bin/fmt before
  765. # being shown to the user.
  766. #
  767. # WITHOUT_FBSD10_FIX Disable FreeBSD 10.0 autotools workaround.
  768. #
  769. # For build and install:
  770. #
  771. # MAKEFILE - Name of the makefile.
  772. # Default: Makefile
  773. # ALL_TARGET - Default target for sub-make in build stage.
  774. # Default: all
  775. # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
  776. # MAKE_ENV - Additional environment vars passed to sub-make in build
  777. # and install stages.
  778. # Default: see below
  779. # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
  780. # Default: none
  781. ##
  782. # MAKE_JOBS_UNSAFE
  783. # - Disallow multiple jobs even when user set a global override.
  784. # To be used with known bad ports.
  785. # DISABLE_MAKE_JOBS
  786. # - Set to disable the multiple jobs feature. User settable.
  787. # MAKE_JOBS_NUMBER
  788. # - Override the number of make jobs to be used. User settable.
  789. # MAKE_JOBS_NUMBER_LIMIT
  790. # - Set a limit for maximum number of make jobs allowed to be
  791. # used.
  792. ## ccache
  793. #
  794. # WITH_CCACHE_BUILD
  795. # - Enable CCACHE support (devel/ccache). User settable.
  796. # CCACHE_DIR
  797. # - Which directory to use for ccache (default: $HOME/.ccache)
  798. # NO_CCACHE
  799. # - Disable CCACHE support for example for certain ports if
  800. # CCACHE is enabled. User settable.
  801. #
  802. # For test:
  803. #
  804. # TEST_TARGET - Target for sub-make in test stage. If not defined,
  805. # no default test target is provided.
  806. # Default: (none)
  807. # TEST_WRKSRC - Directory to do test in (default: ${WRKSRC}).
  808. # TEST_ENV - Additional environment vars passed to sub-make in test
  809. # stage
  810. # Default: ${MAKE_ENV}
  811. # TEST_ARGS - Any extra arguments to sub-make in test stage
  812. # Default: ${MAKE_ARGS}
  813. #
  814. # For install:
  815. #
  816. # INSTALL_TARGET
  817. # - Default target for sub-make in install stage.
  818. # Default: install
  819. # INSTALL_WRKSRC
  820. # - Directory to install from
  821. # Default: ${WRKSRC}
  822. # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
  823. # the "install" target.
  824. # MTREE_FILE - The name of the mtree file.
  825. # Default: ${PORTSDIR}/Templates/BSD.local.dist or
  826. # /etc/mtree/BSD.usr.dist if ${PREFIX} == "/usr".
  827. # PLIST_DIRS - Directories to be added to packing list
  828. # PLIST_FILES - Files and symbolic links to be added to packing list
  829. #
  830. # PLIST - Name of the `packing list' file.
  831. # Change this to ${WRKDIR}/PLIST or something if you
  832. # need to write to it. (It is not a good idea for a port
  833. # to write to any file outside ${WRKDIR} during a normal
  834. # build.)
  835. # Default: ${PKGDIR}/pkg-plist
  836. # TMPPLIST - Name of the `packing list' file after processing
  837. # Default: ${WRKDIR}/.PLIST.mktmp
  838. # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
  839. # Default: see below
  840. #
  841. # SUB_FILES - Files that should be passed through sed(1) and redirected to
  842. # ${WRKDIR}.
  843. # - For each file specified in SUB_FILES, there must be a
  844. # corresponding file in ${FILESDIR} whose suffix is ".in". For
  845. # instance, if the Makefile specifies "SUB_FILES= pkg-message"
  846. # then there must be a file called pkg-message.in in
  847. # ${FILESDIR}.
  848. # - The substitution process is the same as PLIST_FILES, as
  849. # described below except that any line beginning with @comment
  850. # is deleted.
  851. # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
  852. # Some pairs are added by default: e.g. PREFIX=${PREFIX}
  853. #
  854. # USE_LDCONFIG - If set to "yes", this adds ${PREFIX}/lib to the list of
  855. # directories to be searched for shared libraries.
  856. # Otherwise, this is a list of directories to be added to that
  857. # list. The directory names are written to
  858. # ${LOCALBASE}/libdata/ldconfig/${PKGBASE} which is then
  859. # used by the ldconfig startup script.
  860. # This mechanism replaces ldconfig scripts installed by some
  861. # ports, often under such names as 000.${UNQUENAME}.sh.
  862. # If USE_LINUX_PREFIX is defined, the Linux version of
  863. # ldconfig will be used instead of the native FreeBSD
  864. # version, and the directory list given will be ignored.
  865. # USE_LDCONFIG32
  866. # - Same as USE_LDCONFIG but the target file is
  867. # ${LOCALBASE}/libdata/ldconfig32/${PKGBASE} instead.
  868. # Note: that should only be used on 64-bit architectures.
  869. #
  870. # DOCSDIR - Name of the directory to install the packages docs in.
  871. # Default: ${PREFIX}/share/doc/${PORTNAME}
  872. # DOCSDIR_REL - The DOCSDIR relative to ${PREFIX}
  873. # EXAMPLESDIR - Name of the directory to install the packages examples in.
  874. # Default: ${PREFIX}/share/examples/${PORTNAME}
  875. # EXAMPLESDIR_REL
  876. # - The EXAMPLESDIR relative to ${PREFIX}
  877. # DATADIR - Name of the directory to install the packages shared data in.
  878. # Default: ${PREFIX}/share/${PORTNAME}
  879. # DATADIR_REL - The DATADIR relative to ${PREFIX}
  880. #
  881. # WWWDIR - Name of the directory to install the packages www data in.
  882. # Default: ${PREFIX}/www/${PORTNAME}
  883. # WWWDIR_REL - The WWWDIR relative to ${PREFIX}
  884. #
  885. # USERS - List of users to create at install time. Each login must
  886. # have a corresponding entry in ${UID_FILES}.
  887. # GROUPS - List of groups to create at install time. Each group must
  888. # have a corresponding entry in ${GID_FILES}.
  889. #
  890. # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
  891. # Default: ${PREFIX}/share/applications
  892. # DESKTOP_ENTRIES
  893. # - List of desktop entry files to generate and install in
  894. # ${DESKTOPDIR}. The format is
  895. # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
  896. # Rules:
  897. # * Only add desktop entries for applications which do not
  898. # require a terminal (i.e. X11 applications).
  899. # * If the upstream distribution already installs .desktop
  900. # files, you do not need to use this.
  901. # * If you require a more elaborate .desktop file than this
  902. # variable permits, write it yourself and install it
  903. # in ${DESKTOPDIR}.
  904. # Notes:
  905. # * Comment, Icon and StartupNotify may be empty
  906. # strings (""). Categories may be an empty string in some
  907. # cases (see below). The other fields are mandatory.
  908. # * If Comment is an empty string, port ${COMMENT} will be
  909. # used.
  910. # * If set, Icon must be either absolute path (usually
  911. # ${PREFIX}/share/pixmaps/${PORTNAME}.png) or icon name
  912. # without extension if installed icons follow Icon Theme
  913. # Specification.
  914. # * If Categories is an empty string, bsd.port.mk will try
  915. # to deduce a default value using the CATEGORIES variable.
  916. # If the deduction fails, you will have to set Categories
  917. # manually. You should check the generated value using
  918. # "make desktop-categories", and override it if necessary.
  919. # * Exec will also be used to name the .desktop file.
  920. # * StartupNotify may be true, false or empty (see Desktop
  921. # Entry Specification for details).
  922. # * The files will be automatically added to ${PLIST}.
  923. # Example:
  924. # "X Window Information" \
  925. # "Get information about X windows" \
  926. # "${PREFIX}/share/pixmaps/wininfo.png" \
  927. # "${PREFIX}/bin/wininfo" \
  928. # "System;" \
  929. # ""
  930. # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
  931. # for an explanation of the fields. If you need to create more
  932. # than one file, just chain them into a single variable.
  933. #
  934. # Note that the install target will automatically add manpages (see
  935. # above) and also substitute special sequences of characters (delimited
  936. # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
  937. # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
  938. # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
  939. # ${TMPPLIST} is generated before the do-install stage. If you are
  940. # generating the packing list on-the-fly, make sure it's generated before
  941. # do-install is called!
  942. #
  943. # This is used in all stages:
  944. #
  945. # SCRIPTS_ENV - Additional environment vars passed to scripts in
  946. # ${SCRIPTDIR} executed by bsd.port.mk.
  947. # Default: see below
  948. #
  949. # Finally, variables to change if you want a special behavior. These
  950. # are for debugging purposes. Don't set them in your Makefile.
  951. #
  952. # ECHO_MSG - Used to print all the '===>' style prompts - override this
  953. # to turn them off.
  954. # Default: ${ECHO_CMD}
  955. # PATCH_DEBUG - If set, print out more information about the patches as
  956. # it attempts to apply them.
  957. # PKG_DBDIR - Where package installation is recorded; this directory
  958. # must not contain anything else.
  959. # Default: /var/db/pkg
  960. # PORT_DBDIR - Where port configuration options are recorded.
  961. # Default: /var/db/ports
  962. # NO_PKG_REGISTER
  963. # - Don't register a port installation as a package.
  964. # FORCE_PKG_REGISTER
  965. # - If set, it will overwrite any existing package
  966. # registration information in ${PKG_DBDIR}/${PKGNAME}.
  967. # NO_DEPENDS - Don't verify build of dependencies.
  968. # STRICT_DEPENDS
  969. # - Verify dependencies but consider missing dependencies as
  970. # fatal.
  971. # CHECKSUM_ALGORITHMS
  972. # - Different checksum algorithms to check for verifying the
  973. # integrity of the distfiles. The absence of the algorithm
  974. # in distinfo doesn't make it fail.
  975. # Default: sha256
  976. # NO_CHECKSUM - Don't verify the checksum. Typically used when
  977. # when you noticed the distfile you just fetched has
  978. # a different checksum and you intend to verify if
  979. # the port still works with it.
  980. # USE_PACKAGE_DEPENDS
  981. # - Try to install dependencies from existing packages instead
  982. # of building the port from scratch. Fallback on source
  983. # if an existing package is not present.
  984. # USE_PACKAGE_DEPENDS_ONLY
  985. # - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
  986. # INSTALL_AS_USER
  987. # - Define this to install as the current user, intended
  988. # for systems where you have no root access.
  989. # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
  990. # has been specified in distinfo. This is useful
  991. # when using an alternate FETCH_CMD.
  992. # PKG_CREATE_VERBOSE
  993. # - If set, pass the -v option to pkg create which
  994. # ensures periodic output during packaging and
  995. # will help prevent timeouts by build monitors
  996. # PKG_COMPRESSION_FORMAT
  997. # - the compression format used when creating a package, see
  998. # pkg-create(8) for valid formats
  999. # PKG_COMPRESSION_LEVEL
  1000. # - the compression level to use when creating a package, see
  1001. # pkg-create(8) for valid values
  1002. #
  1003. # End of the list of all variables that need to be defined in a port.
  1004. # Most port authors should not need to understand anything after this point.
  1005. #
  1006. LANG= C
  1007. LC_ALL= C
  1008. .export LANG LC_ALL
  1009. # These need to be absolute since we don't know how deep in the ports
  1010. # tree we are and thus can't go relative. They can, of course, be overridden
  1011. # by individual Makefiles or local system make configuration.
  1012. _LIST_OF_WITH_FEATURES= bind_now debug debuginfo lto pie relro sanitize ssp testing
  1013. _DEFAULT_WITH_FEATURES= ssp
  1014. PORTSDIR?= /usr/ports
  1015. LOCALBASE?= /usr/local
  1016. LINUXBASE?= /compat/linux
  1017. DISTDIR?= ${PORTSDIR}/distfiles
  1018. _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
  1019. INDEXDIR?= ${PORTSDIR}
  1020. SRC_BASE?= /usr/src
  1021. USESDIR?= ${PORTSDIR}/Mk/Uses
  1022. SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts
  1023. LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
  1024. STAGEDIR?= ${WRKDIR}/stage
  1025. NOTPHONY?=
  1026. FLAVORS?=
  1027. FLAVOR?=
  1028. OVERLAYS?=
  1029. REWARNFILE= ${WRKDIR}/reinplace_warnings.txt
  1030. # Disallow forced FLAVOR as make argument since we cannot change it to the
  1031. # proper default.
  1032. .if empty(FLAVOR) && !empty(.MAKEOVERRIDES:MFLAVOR)
  1033. .error FLAVOR may not be passed empty as a make argument.
  1034. .endif
  1035. # Store env FLAVOR for later
  1036. .if !defined(_FLAVOR)
  1037. _FLAVOR:= ${FLAVOR}
  1038. .endif
  1039. .if !defined(PORTS_FEATURES) && empty(${PORTS_FEATURES:MFLAVORS})
  1040. PORTS_FEATURES+= FLAVORS
  1041. .endif
  1042. MINIMAL_PKG_VERSION= 1.17.2
  1043. _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \
  1044. ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR} \
  1045. ${PKGCONFIG_LINKDIR}
  1046. # Ensure .CURDIR contains an absolute path without a trailing slash. Failed
  1047. # builds can occur when PORTSDIR is a symbolic link, or with something like
  1048. # make -C /usr/ports/category/port/.
  1049. .CURDIR:= ${.CURDIR:tA}
  1050. # Ensure .CURDIR doesn't contain a colon, which breaks makefile targets
  1051. .if ${.CURDIR:S/:/\:/g} != ${.CURDIR}
  1052. .error The current directory path contains ':', this is not supported
  1053. .endif
  1054. # make sure bmake treats -V as expected
  1055. .MAKE.EXPAND_VARIABLES= yes
  1056. .include "${PORTSDIR}/Mk/bsd.commands.mk"
  1057. # Do not leak flavors to childs make
  1058. .MAKEOVERRIDES:= ${.MAKEOVERRIDES:NFLAVOR}
  1059. .if defined(CROSS_TOOLCHAIN)
  1060. . if !defined(CROSS_SYSROOT)
  1061. IGNORE= CROSS_SYSROOT should be defined
  1062. . endif
  1063. .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
  1064. # Do not define CPP on purpose
  1065. . if !defined(HOSTCC)
  1066. HOSTCC:= ${CC}
  1067. HOSTCXX:= ${CXX}
  1068. . endif
  1069. . if !defined(CC_FOR_BUILD)
  1070. CC_FOR_BUILD:= ${HOSTCC}
  1071. CXX_FOR_BUILD:= ${HOSTCXX}
  1072. . endif
  1073. CONFIGURE_ENV+= HOSTCC="${HOSTCC}" HOSTCXX="${HOSTCXX}" CC_FOR_BUILD="${CC_FOR_BUILD}" CXX_FOR_BUILD="${CXX_FOR_BUILD}"
  1074. CC= ${XCC} --sysroot=${CROSS_SYSROOT}
  1075. CXX= ${XCXX} --sysroot=${CROSS_SYSROOT}
  1076. CPP= ${XCPP} --sysroot=${CROSS_SYSROOT}
  1077. . for _tool in AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
  1078. ${_tool}= ${CROSS_BINUTILS_PREFIX}${_tool:tl}
  1079. . endfor
  1080. LD+= --sysroot=${CROSS_SYSROOT}
  1081. STRIP_CMD= ${CROSS_BINUTILS_PREFIX}strip
  1082. # only bmake support the below
  1083. STRIPBIN= ${STRIP_CMD}
  1084. .export.env STRIPBIN
  1085. .endif
  1086. #
  1087. # DESTDIR section to start a chrooted process if invoked with DESTDIR set
  1088. #
  1089. .if defined(DESTDIR) && !empty(DESTDIR) && !defined(CHROOTED) && \
  1090. !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
  1091. .include "${PORTSDIR}/Mk/bsd.destdir.mk"
  1092. .else
  1093. . if !target(makepatch)
  1094. makepatch:
  1095. @${SETENV} WRKDIR=${WRKDIR} PATCHDIR=${PATCHDIR} \
  1096. PATCH_WRKSRC=${PATCH_WRKSRC} \
  1097. STRIP_COMPONENTS="${PATCH_STRIP:S/-p//}" \
  1098. ${SH} ${SCRIPTSDIR}/smart_makepatch.sh
  1099. . endif
  1100. # Start of options section
  1101. . if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
  1102. # Get the default maintainer
  1103. MAINTAINER?= ports@FreeBSD.org
  1104. # Get the architecture
  1105. . if !defined(ARCH)
  1106. ARCH!= ${UNAME} -p
  1107. . endif
  1108. HOSTARCH:= ${ARCH}
  1109. . if defined(CROSS_TOOLCHAIN)
  1110. ARCH= ${CROSS_TOOLCHAIN:C,-.*$,,}
  1111. . endif
  1112. _EXPORTED_VARS+= ARCH
  1113. . if ${ARCH} == powerpc64
  1114. . if !defined(PPC_ABI)
  1115. PPC_ABI!= ${CC} -dM -E - < /dev/null | ${AWK} '/_CALL_ELF/{print "ELFv"$$3}'
  1116. . if ${PPC_ABI} != ELFv2
  1117. PPC_ABI= ELFv1
  1118. . endif
  1119. . endif
  1120. _EXPORTED_VARS+= PPC_ABI
  1121. . endif
  1122. # Get operating system versions for a cross build
  1123. . if defined(CROSS_SYSROOT)
  1124. . if !exists(${CROSS_SYSROOT}/usr/include/sys/param.h)
  1125. .error CROSS_SYSROOT does not include /usr/include/sys/param.h.
  1126. . endif
  1127. OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${CROSS_SYSROOT}/usr/include/sys/param.h
  1128. _OSRELEASE!= ${AWK} -v version=${OSVERSION} 'END { printf("%d.%d-CROSS", version / 100000, version / 1000 % 100) }' < /dev/null
  1129. . endif
  1130. # Get the operating system type
  1131. . if !defined(OPSYS)
  1132. OPSYS!= ${UNAME} -s
  1133. . endif
  1134. _EXPORTED_VARS+= OPSYS
  1135. . if !defined(_OSRELEASE)
  1136. _OSRELEASE!= ${UNAME} -r
  1137. . endif
  1138. _EXPORTED_VARS+= _OSRELEASE
  1139. # Get the operating system revision
  1140. OSREL?= ${_OSRELEASE:C/-.*//}
  1141. _EXPORTED_VARS+= OSREL
  1142. # Get __FreeBSD_version
  1143. . if !defined(OSVERSION)
  1144. . if exists(/usr/include/sys/param.h)
  1145. OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h
  1146. . elif exists(${SRC_BASE}/sys/sys/param.h)
  1147. OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC_BASE}/sys/sys/param.h
  1148. . else
  1149. .error Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE.
  1150. . endif
  1151. . endif
  1152. _EXPORTED_VARS+= OSVERSION
  1153. . if ${OPSYS} == FreeBSD && (${OSVERSION} < 1302000 )
  1154. _UNSUPPORTED_SYSTEM_MESSAGE= Ports Collection support for your ${OPSYS} version has ended, and no ports\
  1155. are guaranteed to build on this system. Please upgrade to a supported release.
  1156. . if defined(ALLOW_UNSUPPORTED_SYSTEM)
  1157. WARNING+= "${_UNSUPPORTED_SYSTEM_MESSAGE}"
  1158. . else
  1159. show-unsupported-system-error:
  1160. @${ECHO_MSG} "/!\\ ERROR: /!\\"
  1161. @${ECHO_MSG}
  1162. @${ECHO_MSG} "${_UNSUPPORTED_SYSTEM_MESSAGE}" | ${FMT_80}
  1163. @${ECHO_MSG}
  1164. @${ECHO_MSG} "No support will be provided if you silence this message by defining ALLOW_UNSUPPORTED_SYSTEM." | ${FMT_80}
  1165. @${ECHO_MSG}
  1166. @${FALSE}
  1167. . endif
  1168. . endif
  1169. # Convert OSVERSION to major release number
  1170. _OSVERSION_MAJOR= ${OSVERSION:C/([0-9]?[0-9])([0-9][0-9])[0-9]{3}/\1/}
  1171. # Sanity checks for chroot/jail building.
  1172. # Skip if OSVERSION specified on cmdline for testing. Only works for bmake.
  1173. . if !defined(.MAKEOVERRIDES) || !${.MAKEOVERRIDES:MOSVERSION}
  1174. . if ${_OSVERSION_MAJOR} != ${_OSRELEASE:R}
  1175. . if !defined(I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE)
  1176. .error UNAME_r (${_OSRELEASE}) and OSVERSION (${OSVERSION}) do not agree on major version number.
  1177. . endif
  1178. . elif ${_OSVERSION_MAJOR} != ${OSREL:R}
  1179. .error OSREL (${OSREL}) and OSVERSION (${OSVERSION}) do not agree on major version number.
  1180. . endif
  1181. . endif
  1182. # Only define tools here (for transition period with between pkg tools)
  1183. .include "${PORTSDIR}/Mk/bsd.commands.mk"
  1184. . if !defined(_PKG_CHECKED) && !defined(PACKAGE_BUILDING) && exists(${PKG_BIN})
  1185. . if !defined(_PKG_VERSION)
  1186. _PKG_VERSION!= ${PKG_BIN} -v
  1187. . endif
  1188. # XXX hack for smooth transition towards pkg 1.17
  1189. _PKG_BEFORE_PKGEXT!= ${PKG_BIN} version -t ${_PKG_VERSION:C/-.*//g} 1.17.0
  1190. . if ${_PKG_BEFORE_PKGEXT} == "<"
  1191. _PKG_TRANSITIONING_TO_NEW_EXT= yes
  1192. _EXPORTED_VARS+= _PKG_TRANSITIONING_TO_NEW_EXT
  1193. WARNING+= "It is strongly recommended to upgrade to a newer version of pkg first"
  1194. . endif
  1195. # XXX End of hack
  1196. _PKG_STATUS!= ${PKG_BIN} version -t ${_PKG_VERSION:C/-.*//g} ${MINIMAL_PKG_VERSION}
  1197. . if ${_PKG_STATUS} == "<"
  1198. IGNORE= pkg(8) must be version ${MINIMAL_PKG_VERSION} or greater, but you have ${_PKG_VERSION}. You must upgrade the ${PKG_ORIGIN} port first
  1199. . endif
  1200. _PKG_CHECKED= 1
  1201. . endif
  1202. _EXPORTED_VARS+= _PKG_CHECKED
  1203. MASTERDIR?= ${.CURDIR}
  1204. . if ${MASTERDIR} != ${.CURDIR}
  1205. SLAVE_PORT?= yes
  1206. MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
  1207. . else
  1208. SLAVE_PORT?= no
  1209. MASTER_PORT?=
  1210. . endif
  1211. # If they exist, include Makefile.inc, then architecture/operating
  1212. # system specific Makefiles, then local Makefile.local.
  1213. . if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
  1214. .include "${.CURDIR}/../Makefile.inc"
  1215. USE_SUBMAKE= yes
  1216. . endif
  1217. . if exists(${MASTERDIR}/../Makefile.inc)
  1218. .include "${MASTERDIR}/../Makefile.inc"
  1219. USE_SUBMAKE= yes
  1220. . endif
  1221. . if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
  1222. .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
  1223. USE_SUBMAKE= yes
  1224. . elif exists(${MASTERDIR}/Makefile.${OPSYS})
  1225. .include "${MASTERDIR}/Makefile.${OPSYS}"
  1226. USE_SUBMAKE= yes
  1227. . elif exists(${MASTERDIR}/Makefile.${ARCH})
  1228. .include "${MASTERDIR}/Makefile.${ARCH}"
  1229. USE_SUBMAKE= yes
  1230. . endif
  1231. . if exists(${MASTERDIR}/Makefile.local)
  1232. .include "${MASTERDIR}/Makefile.local"
  1233. USE_SUBMAKE= yes
  1234. . elif ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/Makefile.local)
  1235. .include "${.CURDIR}/Makefile.local"
  1236. USE_SUBMAKE= yes
  1237. . endif
  1238. . for _CATEGORY in ${CATEGORIES}
  1239. PKGCATEGORY?= ${_CATEGORY}
  1240. . endfor
  1241. _PORTDIRNAME= ${.CURDIR:T}
  1242. PORTDIRNAME?= ${_PORTDIRNAME}
  1243. PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
  1244. # Now that PKGORIGIN is set, look for origin-specific variables.
  1245. # These are typically set in a make.conf, in the form:
  1246. #
  1247. # category_portname_VARS= varname=value othervar+=value novar@
  1248. #
  1249. # e.g. devel_llvm10_VARS= MAKE_JOBS_NUMBER=2
  1250. . for var in ${${PKGORIGIN:S/\//_/}_VARS:C/=.*//:O:u}
  1251. . if ${var:M*@}
  1252. . undef ${var:C/.$//}
  1253. . elif ${var:M*+}
  1254. ${var:C/.$//}+= ${${PKGORIGIN:S/\//_/}_VARS:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
  1255. . else
  1256. ${var}= ${${PKGORIGIN:S/\//_/}_VARS:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/}
  1257. . endif
  1258. . endfor
  1259. # where 'make config' records user configuration options
  1260. PORT_DBDIR?= /var/db/ports
  1261. UID_FILES?= ${PORTSDIR}/UIDs
  1262. GID_FILES?= ${PORTSDIR}/GIDs
  1263. UID_OFFSET?= 0
  1264. GID_OFFSET?= 0
  1265. # predefined accounts from src/etc/master.passwd
  1266. # alpha numeric sort order
  1267. USERS_BLACKLIST= _dhcp _pflogd _ypldap auditdistd bin bind daemon games hast kmem mailnull man news nobody operator pop proxy root smmsp sshd toor tty unbound uucp www
  1268. # predefined accounts from src/etc/group
  1269. # alpha numeric sort order
  1270. GROUPS_BLACKLIST= _dhcp _pflogd _ypldap audit authpf bin bind daemon dialer ftp games guest hast kmem mail mailnull man network news nobody nogroup operator proxy smmsp sshd staff sys tty unbound uucp wheel www
  1271. LDCONFIG_DIR= libdata/ldconfig
  1272. LDCONFIG32_DIR= libdata/ldconfig32
  1273. # At least KDE needs TMPDIR for the package building,
  1274. # so we're setting it to the known default value.
  1275. . if defined(PACKAGE_BUILDING)
  1276. TMPDIR?= /tmp
  1277. . endif # defined(PACKAGE_BUILDING)
  1278. # Enable default features unless they have been disabled by the user, and cleanup
  1279. . for feature in ${_DEFAULT_WITH_FEATURES}
  1280. . if !defined(WITHOUT_${feature:tu})
  1281. WITH_${feature:tu}= yes
  1282. .undef WITHOUT_${feature:tu}
  1283. . endif
  1284. . endfor
  1285. # For each Feature we support, process the
  1286. # WITH_FEATURE_PORTS and WITHOUT_FEATURE_PORTS variables
  1287. . for feature in ${_LIST_OF_WITH_FEATURES}
  1288. . if defined(WITHOUT_${feature:tu}_PORTS) && ${WITHOUT_${feature:tu}_PORTS:M${PKGORIGIN}}
  1289. # Feature disabled for this port, remove WITH_<feat>
  1290. .undef WITH_${feature:tu}
  1291. . elif defined(WITH_${feature:tu}_PORTS) && ${WITH_${feature:tu}_PORTS:M${PKGORIGIN}}
  1292. # Feature enabled for this port, set WITH_<feat>
  1293. WITH_${feature:tu}= yes
  1294. . endif
  1295. . endfor
  1296. . if defined(USE_LTO)
  1297. WITH_LTO= ${USE_LTO}
  1298. WARNING+= USE_LTO is deprecated in favor of WITH_LTO
  1299. . endif
  1300. .include "${PORTSDIR}/Mk/bsd.default-versions.mk"
  1301. .include "${PORTSDIR}/Mk/bsd.options.mk"
  1302. . endif
  1303. # End of options section.
  1304. # Start of pre-makefile section.
  1305. . if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
  1306. . if defined(_PREMKINCLUDED)
  1307. DEV_ERROR+= "you cannot include bsd.port[.pre].mk twice"
  1308. . endif
  1309. _PREMKINCLUDED= yes
  1310. . if defined(PORTVERSION)
  1311. . if ${PORTVERSION:M*[-_,]*}x != x
  1312. IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
  1313. . endif
  1314. . if defined(DISTVERSION)
  1315. DEV_ERROR+= "Defining both PORTVERSION and DISTVERSION is wrong, only set one, if necessary, set DISTNAME"
  1316. . endif
  1317. DISTVERSION?= ${PORTVERSION:S/:/::/g}
  1318. . elif defined(DISTVERSION)
  1319. PORTVERSION= ${DISTVERSION:tl:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
  1320. . endif
  1321. PORTREVISION?= 0
  1322. . if ${PORTREVISION} != 0
  1323. _SUF1= _${PORTREVISION}
  1324. . endif
  1325. PORTEPOCH?= 0
  1326. . if ${PORTEPOCH} != 0
  1327. _SUF2= ,${PORTEPOCH}
  1328. . endif
  1329. PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
  1330. PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
  1331. DISTVERSIONFULL= ${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
  1332. DISTNAME?= ${PORTNAME}-${DISTVERSIONFULL}
  1333. INDEXFILE?= INDEX-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}
  1334. PACKAGES?= ${PORTSDIR}/packages
  1335. TEMPLATES?= ${PORTSDIR}/Templates
  1336. KEYWORDS?= ${PORTSDIR}/Keywords
  1337. WRAPPERSDIR?= ${PORTSDIR}/Mk/Wrappers/
  1338. PATCHDIR?= ${MASTERDIR}/files
  1339. FILESDIR?= ${MASTERDIR}/files
  1340. SCRIPTDIR?= ${MASTERDIR}/scripts
  1341. PKGDIR?= ${MASTERDIR}
  1342. PREFIX?= ${LOCALBASE}
  1343. PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
  1344. . if defined(USE_LOCAL_MK)
  1345. .include "${PORTSDIR}/Mk/bsd.local.mk"
  1346. . endif
  1347. . for odir in ${OVERLAYS}
  1348. .sinclude "${odir}/Mk/bsd.overlay.mk"
  1349. . endfor
  1350. . if defined(USE_JAVA)
  1351. .include "${PORTSDIR}/Mk/bsd.java.mk"
  1352. . endif
  1353. . if defined(USE_OCAML)
  1354. .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
  1355. . endif
  1356. . if defined(USE_APACHE_BUILD)
  1357. USES+= apache:build,${USE_APACHE_BUILD:C/2([0-9])/2.\1/g}
  1358. . elif defined(USE_APACHE_RUN)
  1359. USES+= apache:run,${USE_APACHE_RUN:C/2([0-9])/2.\1/g}
  1360. . elif defined(USE_APACHE)
  1361. USE_APACHE:= ${USE_APACHE:S/common/server,/}
  1362. USES+= apache:${USE_APACHE:C/2([0-9])/2.\1/g}
  1363. . endif
  1364. . if defined(USE_GECKO)
  1365. .include "${PORTSDIR}/Mk/bsd.gecko.mk"
  1366. . endif
  1367. . if defined(USE_MYSQL)
  1368. USE_MYSQL:= ${USE_MYSQL:N[yY][eE][sS]:Nclient}
  1369. . if defined(WANT_MYSQL_VER)
  1370. . if empty(USE_MYSQL)
  1371. USE_MYSQL:=${WANT_MYSQL_VER}
  1372. . else
  1373. USE_MYSQL:=${USE_MYSQL},${WANT_MYSQL_VER}
  1374. . endif
  1375. . endif
  1376. USES+=mysql:${USE_MYSQL}
  1377. . endif
  1378. . if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
  1379. .include "${PORTSDIR}/Mk/bsd.wx.mk"
  1380. . endif
  1381. UID?= ${.MAKE.UID}
  1382. DESTDIRNAME?= DESTDIR
  1383. # setup empty variables for USES targets
  1384. . for target in sanity fetch extract patch configure build install test package stage
  1385. _USES_${target}?=
  1386. . endfor
  1387. # Loading features
  1388. . for f in ${USES}
  1389. _f:= ${f:C/\:.*//}
  1390. . if !defined(${_f}_ARGS)
  1391. ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
  1392. . endif
  1393. . endfor
  1394. . for f in ${USES}
  1395. .undef _usefound
  1396. . for udir in ${OVERLAYS:C,$,/Mk/Uses,} ${USESDIR}
  1397. _usefile= ${udir}/${f:C/\:.*//}.mk
  1398. . if exists(${_usefile}) && !defined(_usefound)
  1399. _usefound=
  1400. .include "${_usefile}"
  1401. . endif
  1402. . endfor
  1403. . if !defined(_usefound)
  1404. ERROR+= "Unknown USES=${f:C/\:.*//}"
  1405. . endif
  1406. . endfor
  1407. . if !empty(FLAVORS)
  1408. . if ${FLAVORS:Mall}
  1409. DEV_ERROR+= "FLAVORS cannot contain 'all', it is a reserved value"
  1410. . endif
  1411. . for f in ${FLAVORS}
  1412. . if ${f:C/[[:lower:][:digit:]_]//g}
  1413. _BAD_FLAVOR_NAMES+= ${f}
  1414. . endif
  1415. . endfor
  1416. . if !empty(_BAD_FLAVOR_NAMES)
  1417. DEV_ERROR+= "FLAVORS contains flavors that are not all [a-z0-9_]: ${_BAD_FLAVOR_NAMES}"
  1418. . endif
  1419. . endif
  1420. . if !empty(FLAVOR)
  1421. . if empty(FLAVORS)
  1422. IGNORE= FLAVOR is defined (to ${FLAVOR}) while this port does not have FLAVORS
  1423. . elif ! ${FLAVORS:M${FLAVOR}}
  1424. IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}
  1425. . endif
  1426. . endif
  1427. . if !empty(FLAVORS) && empty(FLAVOR)
  1428. FLAVOR= ${FLAVORS:[1]}
  1429. . endif
  1430. # Reorder FLAVORS so the default is first if set by the port.
  1431. . if empty(_FLAVOR) && !empty(FLAVORS) && !empty(FLAVOR)
  1432. FLAVORS:= ${FLAVOR} ${FLAVORS:N${FLAVOR}}
  1433. . endif
  1434. . if !empty(FLAVOR) && !defined(_DID_FLAVORS_HELPERS)
  1435. _DID_FLAVORS_HELPERS= yes
  1436. _FLAVOR_HELPERS_OVERRIDE= DESCR PLIST PKGNAMEPREFIX PKGNAMESUFFIX
  1437. _FLAVOR_HELPERS_APPEND= CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL \
  1438. PKG_DEPENDS EXTRACT_DEPENDS PATCH_DEPENDS \
  1439. FETCH_DEPENDS BUILD_DEPENDS LIB_DEPENDS \
  1440. RUN_DEPENDS TEST_DEPENDS
  1441. # These overwrite the current value
  1442. . for v in ${_FLAVOR_HELPERS_OVERRIDE}
  1443. . if defined(${FLAVOR}_${v})
  1444. ${v}= ${${FLAVOR}_${v}}
  1445. . endif
  1446. . endfor
  1447. # These append to the current value
  1448. . for v in ${_FLAVOR_HELPERS_APPEND}
  1449. . if defined(${FLAVOR}_${v})
  1450. ${v}+= ${${FLAVOR}_${v}}
  1451. . endif
  1452. . endfor
  1453. . for v in BROKEN IGNORE
  1454. . if defined(${FLAVOR}_${v})
  1455. ${v}= flavor "${FLAVOR}" ${${FLAVOR}_${v}}
  1456. . endif
  1457. . endfor
  1458. . if defined(FLAVORS_SUB)
  1459. PLIST_SUB+= ${FLAVORS:N${FLAVOR}:@v@${v:tu}="\@comment " NO_${v:tu}=""@}
  1460. PLIST_SUB+= ${FLAVOR:tu}="" NO_${FLAVOR:tu}="@comment "
  1461. SUB_LIST+= ${FLAVORS:N${FLAVOR}:@v@${v:tu}="\@comment " NO_${v:tu}=""@}
  1462. SUB_LIST+= ${FLAVOR:tu}="" NO_${FLAVOR:tu}="@comment "
  1463. . endif
  1464. . endif # defined(${FLAVOR})
  1465. EXTRACT_SUFX?= .tar.gz
  1466. . if defined(USE_LINUX_PREFIX)
  1467. PREFIX= ${LINUXBASE}
  1468. DATADIR?= ${PREFIX}/usr/share/${PORTNAME}
  1469. DOCSDIR?= ${PREFIX}/usr/share/doc/${PORTNAME}-${DISTVERSION}
  1470. NO_LICENSES_INSTALL= yes
  1471. NO_MTREE= yes
  1472. . endif
  1473. # You can force skipping these test by defining IGNORE_PATH_CHECKS
  1474. . if !defined(IGNORE_PATH_CHECKS)
  1475. . if ! ${PREFIX:M/*}
  1476. .BEGIN:
  1477. @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
  1478. @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
  1479. @${FALSE}
  1480. . endif
  1481. . endif
  1482. DATADIR?= ${PREFIX}/share/${PORTNAME}
  1483. DOCSDIR?= ${PREFIX}/share/doc/${PORTNAME}
  1484. ETCDIR?= ${PREFIX}/etc/${PORTNAME}
  1485. EXAMPLESDIR?= ${PREFIX}/share/examples/${PORTNAME}
  1486. WWWDIR?= ${PREFIX}/www/${PORTNAME}
  1487. # Owner and group of the WWW user
  1488. WWWOWN?= www
  1489. WWWGRP?= www
  1490. # Keep PKGNG_ORIGIN/WITH_PKGNG for compat with scripts which are looking for it
  1491. PKG_ORIGIN?= ports-mgmt/pkg
  1492. PKGNG_ORIGIN= ${PKG_ORIGIN}
  1493. WITH_PKGNG?= yes
  1494. WITH_PKG?= ${WITH_PKGNG}
  1495. . endif
  1496. # End of pre-makefile section.
  1497. # Start of post-makefile section.
  1498. . if !defined(BEFOREPORTMK) && !defined(INOPTIONSMK)
  1499. . if defined(_POSTMKINCLUDED)
  1500. DEV_ERROR+= "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
  1501. @${FALSE}
  1502. . endif
  1503. _POSTMKINCLUDED= yes
  1504. . if defined(BUNDLE_LIBS)
  1505. PKG_NOTES+= no_provide_shlib
  1506. PKG_NOTE_no_provide_shlib= yes
  1507. . endif
  1508. . if defined(DEPRECATED)
  1509. PKG_NOTES+= deprecated
  1510. PKG_NOTE_deprecated=${DEPRECATED}
  1511. . endif
  1512. . if defined(EXPIRATION_DATE)
  1513. PKG_NOTES+= expiration_date
  1514. PKG_NOTE_expiration_date= ${EXPIRATION_DATE}
  1515. . endif
  1516. . if !empty(FLAVOR)
  1517. PKG_NOTES+= flavor
  1518. PKG_NOTE_flavor= ${FLAVOR}
  1519. . endif
  1520. WRK_ENV+= HOME=${WRKDIR} \
  1521. PWD="$${PWD}" \
  1522. __MAKE_CONF=${NONEXISTENT}
  1523. . for e in OSVERSION PATH TERM TMPDIR \
  1524. UNAME_b UNAME_i UNAME_K UNAME_m UNAME_n \
  1525. UNAME_p UNAME_r UNAME_s UNAME_U UNAME_v
  1526. . ifdef ${e}
  1527. WRK_ENV+= ${e}=${${e}:Q}
  1528. . endif
  1529. . endfor
  1530. TEST_ARGS?= ${MAKE_ARGS}
  1531. TEST_ENV?= ${MAKE_ENV}
  1532. PKG_ENV+= PORTSDIR=${PORTSDIR}
  1533. CONFIGURE_ENV+= XDG_DATA_HOME=${WRKDIR} \
  1534. XDG_CONFIG_HOME=${WRKDIR} \
  1535. XDG_CACHE_HOME=${WRKDIR}/.cache \
  1536. HOME=${WRKDIR}
  1537. MAKE_ENV+= XDG_DATA_HOME=${WRKDIR} \
  1538. XDG_CONFIG_HOME=${WRKDIR} \
  1539. XDG_CACHE_HOME=${WRKDIR}/.cache \
  1540. HOME=${WRKDIR}
  1541. # Respect TMPDIR passed via make.conf or similar and pass it down
  1542. # to configure and make.
  1543. . if defined(TMPDIR)
  1544. MAKE_ENV+= TMPDIR="${TMPDIR}"
  1545. CONFIGURE_ENV+= TMPDIR="${TMPDIR}"
  1546. . endif # defined(TMPDIR)
  1547. QA_ENV+= STAGEDIR=${STAGEDIR} \
  1548. PREFIX=${PREFIX} \
  1549. LINUXBASE=${LINUXBASE} \
  1550. LOCALBASE=${LOCALBASE} \
  1551. REWARNFILE=${REWARNFILE} \
  1552. "STRIP=${STRIP}" \
  1553. TMPPLIST=${TMPPLIST} \
  1554. CURDIR='${.CURDIR}' \
  1555. PKGMESSAGES='${_PKGMESSAGES}' \
  1556. FLAVOR=${FLAVOR} \
  1557. FLAVORS='${FLAVORS}' \
  1558. BUNDLE_LIBS=${BUNDLE_LIBS} \
  1559. LDCONFIG_DIR="${LDCONFIG_DIR}" \
  1560. PKGORIGIN=${PKGORIGIN} \
  1561. LIB_RUN_DEPENDS='${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}' \
  1562. UNIFIED_DEPENDS=${_UNIFIED_DEPENDS:C,([^:]*:[^:]*):?.*,\1,:O:u:Q} \
  1563. WANTED_LIBRARIES='${LIB_DEPENDS:C,([^:]*):([^:]*):?.*,\1,}' \
  1564. PKGBASE=${PKGBASE} \
  1565. LICENSE="${LICENSE}" \
  1566. LICENSE_PERMS="${_LICENSE_PERMS}" \
  1567. DISABLE_LICENSES="${DISABLE_LICENSES:Dyes}" \
  1568. PORTNAME=${PORTNAME} \
  1569. NO_ARCH=${NO_ARCH} \
  1570. "NO_ARCH_IGNORE=${NO_ARCH_IGNORE}"
  1571. . if !empty(USES:Mssl)
  1572. QA_ENV+= USESSSL=yes
  1573. . endif
  1574. . if !empty(USES:Mdesktop-file-utils)
  1575. QA_ENV+= USESDESKTOPFILEUTILS=yes
  1576. . endif
  1577. . if !empty(USES:Mlibtool*)
  1578. QA_ENV+= USESLIBTOOL=yes
  1579. . endif
  1580. . if !empty(USES:Mshared-mime-info)
  1581. QA_ENV+= USESSHAREDMIMEINFO=yes
  1582. . endif
  1583. . if !empty(USES:Mterminfo)
  1584. QA_ENV+= USESTERMINFO=yes
  1585. . endif
  1586. CO_ENV+= STAGEDIR=${STAGEDIR} \
  1587. PREFIX=${PREFIX} \
  1588. LOCALBASE=${LOCALBASE} \
  1589. WRKDIR=${WRKDIR} \
  1590. WRKSRC=${WRKSRC} \
  1591. MTREE_FILE=${MTREE_FILE} \
  1592. TMPPLIST=${TMPPLIST} \
  1593. SCRIPTSDIR=${SCRIPTSDIR} \
  1594. PLIST_SUB_SED="${PLIST_SUB_SED}" \
  1595. PORT_OPTIONS="${PORT_OPTIONS}" \
  1596. PORTSDIR="${PORTSDIR}"
  1597. . if defined(CROSS_SYSROOT)
  1598. PKG_ENV+= ABI_FILE=${CROSS_SYSROOT}/bin/sh
  1599. MAKE_ENV+= NM=${NM} \
  1600. STRIPBIN=${STRIPBIN} \
  1601. PKG_CONFIG_SYSROOT_DIR="${CROSS_SYSROOT}"
  1602. CONFIGURE_ENV+= PKG_CONFIG_SYSROOT_DIR="${CROSS_SYSROOT}"
  1603. . endif
  1604. . if empty(FLAVOR)
  1605. _WRKDIR= work
  1606. . else
  1607. _WRKDIR= work-${FLAVOR}
  1608. . endif
  1609. WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/${_WRKDIR}
  1610. BINARY_LINKDIR= ${WRKDIR}/.bin
  1611. PATH:= ${BINARY_LINKDIR}:${PATH}
  1612. . if !${MAKE_ENV:MPATH=*} && !${CONFIGURE_ENV:MPATH=*}
  1613. MAKE_ENV+= PATH=${PATH}
  1614. CONFIGURE_ENV+= PATH=${PATH}
  1615. . endif
  1616. PKGCONFIG_LINKDIR= ${WRKDIR}/.pkgconfig
  1617. PKGCONFIG_BASEDIR= /usr/libdata/pkgconfig
  1618. . if !${MAKE_ENV:MPKG_CONFIG_LIBDIR=*} && !${CONFIGURE_ENV:MPKG_CONFIG_LIBDIR=*}
  1619. MAKE_ENV+= PKG_CONFIG_LIBDIR=${PKGCONFIG_LINKDIR}:${LOCALBASE}/libdata/pkgconfig:${LOCALBASE}/share/pkgconfig:${PKGCONFIG_BASEDIR}
  1620. CONFIGURE_ENV+= PKG_CONFIG_LIBDIR=${PKGCONFIG_LINKDIR}:${LOCALBASE}/libdata/pkgconfig:${LOCALBASE}/share/pkgconfig:${PKGCONFIG_BASEDIR}
  1621. . endif
  1622. . if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB) && empty(USE_GITHUB:Mnodefault)
  1623. . if defined(WRKSRC)
  1624. DEV_WARNING+= "You are using USE_GITHUB and WRKSRC is set which is wrong. Set GH_PROJECT correctly or set WRKSRC_SUBDIR and remove WRKSRC entirely."
  1625. . endif
  1626. WRKSRC?= ${WRKDIR}/${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT}
  1627. . endif
  1628. . if !default(IGNORE_MASTER_SITE_GITLAB) && defined(USE_GITLAB) && empty(USE_GITLAB:Mnodefault)
  1629. . if defined(WRKSRC)
  1630. DEV_WARNING+= "You are using USE_GITLAB and WRKSRC is set which is wrong. Set GL_PROJECT, GL_ACCOUNT correctly, and/or set WRKSRC_SUBDIR and remove WRKSRC entirely."
  1631. . endif
  1632. WRKSRC?= ${WRKDIR}/${GL_PROJECT}-${GL_TAGNAME}
  1633. . endif
  1634. # If the distname is not extracting into a specific subdirectory, have the
  1635. # ports framework force extract into a subdirectory so that metadata files
  1636. # do not get in the way of the build, and vice-versa.
  1637. . if defined(NO_WRKSUBDIR)
  1638. # Some ports have DISTNAME=PORTNAME, and USE_RC_SUBR=PORTNAME, in those case,
  1639. # the rc file will conflict with WRKSRC, as WRKSRC is artificial, make it the
  1640. # most unlikely to conflict as we can.
  1641. WRKSRC?= ${WRKDIR}/${PKGNAME}
  1642. EXTRACT_WRKDIR:= ${WRKSRC}
  1643. . else
  1644. WRKSRC?= ${WRKDIR}/${DISTNAME}
  1645. EXTRACT_WRKDIR:= ${WRKDIR}
  1646. . endif
  1647. . if defined(WRKSRC_SUBDIR)
  1648. WRKSRC:= ${WRKSRC}/${WRKSRC_SUBDIR}
  1649. . endif
  1650. . if defined(CONFIGURE_OUTSOURCE)
  1651. CONFIGURE_CMD?= ${WRKSRC}/${CONFIGURE_SCRIPT}
  1652. CONFIGURE_WRKSRC?= ${WRKDIR}/.build
  1653. BUILD_WRKSRC?= ${CONFIGURE_WRKSRC}
  1654. INSTALL_WRKSRC?= ${CONFIGURE_WRKSRC}
  1655. TEST_WRKSRC?= ${CONFIGURE_WRKSRC}
  1656. . endif
  1657. PATCH_WRKSRC?= ${WRKSRC}
  1658. CONFIGURE_WRKSRC?= ${WRKSRC}
  1659. BUILD_WRKSRC?= ${WRKSRC}
  1660. INSTALL_WRKSRC?=${WRKSRC}
  1661. TEST_WRKSRC?= ${WRKSRC}
  1662. PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} \
  1663. RESETPREFIX=${PREFIX}
  1664. SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
  1665. DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
  1666. WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
  1667. # This is used for check-stagedir.sh and check_leftover.sh to replace
  1668. # directories/files with PLIST_SUB %%KEYS%%.
  1669. # Remove VARS which values are PLIST_SUB_SED_MIN long or shorter
  1670. PLIST_SUB_SED_MIN?= 2
  1671. PLIST_SUB_SED_tmp1= ${PLIST_SUB:C/.*=.{1,${PLIST_SUB_SED_MIN}}$//g}
  1672. # Remove VARS that are too generic
  1673. # Remove empty values
  1674. # Remove @comment values
  1675. PLIST_SUB_SED_tmp2= ${PLIST_SUB_SED_tmp1:NEXTRACT_SUFX=*:NOSREL=*:NLIB32DIR=*:NPREFIX=*:NLOCALBASE=*:NRESETPREFIX=*:N*="":N*="@comment*}
  1676. # Handle VARS for which there is a _regex entry
  1677. PLIST_SUB_SED_tmp3?= ${PLIST_SUB_SED_tmp2:C/(${PLIST_SUB:M*_regex=*:C/_regex=.*/=.*/:Q:S/\\ /|/g:S/\\//g})//:C/(.*)_regex=(.*)/\1=\2/}
  1678. # Remove quotes
  1679. # Replace . with \. for later sed(1) usage
  1680. PLIST_SUB_SED?= ${PLIST_SUB_SED_tmp3:C/([^=]*)="?([^"]*)"?/s!\2!%%\1%%!g;/g:C/\./[.]/g}
  1681. # kludge to strip trailing whitespace from CFLAGS;
  1682. # sub-configure will not # survive double space
  1683. CFLAGS:= ${CFLAGS:C/ $//}
  1684. . if defined(WITHOUT_CPU_CFLAGS)
  1685. . if defined(_CPUCFLAGS)
  1686. . if !empty(_CPUCFLAGS)
  1687. CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
  1688. . endif
  1689. . endif
  1690. . endif
  1691. . for f in ${_LIST_OF_WITH_FEATURES}
  1692. . if defined(WITH_${f:tu})
  1693. .include "${PORTSDIR}/Mk/Features/$f.mk"
  1694. . endif
  1695. . endfor
  1696. # We will control debug files. Don't let builds that use /usr/share/mk
  1697. # split out debug symbols since the plist won't know to expect it.
  1698. MAKE_ENV+= MK_DEBUG_FILES=no
  1699. MAKE_ENV+= MK_KERNEL_SYMBOLS=no
  1700. # Prevent merge options from /etc/make.conf then MAKE_CMD started.
  1701. MAKE_ENV+= __MAKE_CONF=/dev/null
  1702. CONFIGURE_SHELL?= ${SH}
  1703. MAKE_SHELL?= ${SH}
  1704. CONFIGURE_ENV+= SHELL=${CONFIGURE_SHELL} CONFIG_SHELL=${CONFIGURE_SHELL}
  1705. MAKE_ENV+= SHELL=${MAKE_SHELL} NO_LINT=YES
  1706. . if defined(PATCHFILES) && ${PATCHFILES:M*.zip}
  1707. PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip:archivers/unzip
  1708. . endif
  1709. # Check the compatibility layer for amd64
  1710. . if ${ARCH} == "amd64"
  1711. . if exists(/usr/lib32)
  1712. HAVE_COMPAT_IA32_LIBS?= YES
  1713. . endif
  1714. . if !defined(HAVE_COMPAT_IA32_KERN)
  1715. HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -n compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi; echo
  1716. . if empty(HAVE_COMPAT_IA32_KERN)
  1717. .undef HAVE_COMPAT_IA32_KERN
  1718. . endif
  1719. . endif
  1720. . endif
  1721. _EXPORTED_VARS+= HAVE_COMPAT_IA32_KERN
  1722. . if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
  1723. . if ${ARCH} == "amd64"
  1724. . if !defined(HAVE_COMPAT_IA32_KERN)
  1725. IGNORE= requires a kernel with compiled-in IA32 compatibility
  1726. . elif !defined(HAVE_COMPAT_IA32_LIBS)
  1727. IGNORE= requires 32-bit libraries installed under /usr/lib32
  1728. . endif
  1729. _LDCONFIG_FLAGS=-32
  1730. LIB32DIR= lib32
  1731. . else
  1732. IGNORE= requires i386 (or compatible) platform to run
  1733. . endif
  1734. . else
  1735. LIB32DIR= lib
  1736. . endif
  1737. PLIST_SUB+= LIB32DIR=${LIB32DIR}
  1738. . if ${WITH_PKG} == devel
  1739. PKG_ORIGIN= ports-mgmt/pkg-devel
  1740. . endif
  1741. . if !defined(PKG_DEPENDS) && !defined(CLEAN_FETCH_ENV)
  1742. PKG_DEPENDS+= ${LOCALBASE}/sbin/pkg:${PKG_ORIGIN}
  1743. . endif
  1744. . if defined(USE_GCC)
  1745. .include "${PORTSDIR}/Mk/bsd.gcc.mk"
  1746. . endif
  1747. . if defined(LLD_UNSAFE) && ${/usr/bin/ld:L:tA} == /usr/bin/ld.lld
  1748. LDFLAGS+= -fuse-ld=bfd
  1749. BINARY_ALIAS+= ld=${LD}
  1750. . if !defined(USE_BINUTILS)
  1751. . if exists(/usr/bin/ld.bfd)
  1752. LD= /usr/bin/ld.bfd
  1753. CONFIGURE_ENV+= LD=${LD}
  1754. MAKE_ENV+= LD=${LD}
  1755. . else
  1756. USE_BINUTILS= yes
  1757. . endif
  1758. . endif
  1759. . endif
  1760. . if defined(USE_BINUTILS) && !defined(DISABLE_BINUTILS)
  1761. BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
  1762. BINUTILS?= ADDR2LINE AR AS CPPFILT GPROF LD NM OBJCOPY OBJDUMP RANLIB \
  1763. READELF SIZE STRINGS
  1764. BINUTILS_NO_MAKE_ENV?=
  1765. . for b in ${BINUTILS}
  1766. ${b}= ${LOCALBASE}/bin/${b:C/PP/++/:tl}
  1767. . if defined(GNU_CONFIGURE) || defined(BINUTILS_CONFIGURE)
  1768. CONFIGURE_ENV+= ${b}="${${b}}"
  1769. . endif
  1770. . if ${BINUTILS_NO_MAKE_ENV:M${b}} == ""
  1771. MAKE_ENV+= ${b}="${${b}}"
  1772. . endif
  1773. . endfor
  1774. . endif
  1775. . if defined(USE_RC_SUBR)
  1776. SUB_FILES+= ${USE_RC_SUBR}
  1777. . endif
  1778. . if defined(USE_LDCONFIG) && ${USE_LDCONFIG:tl} == "yes"
  1779. USE_LDCONFIG= ${PREFIX}/lib
  1780. . endif
  1781. . if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:tl} == "yes"
  1782. IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
  1783. . endif
  1784. . if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
  1785. . if defined(USE_LINUX_PREFIX)
  1786. PLIST_FILES+= "@ldconfig-linux ${LINUXBASE}"
  1787. . else
  1788. PLIST_FILES+= "@ldconfig"
  1789. . endif
  1790. . endif
  1791. PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
  1792. . if defined(_DESTDIR_VIA_ENV)
  1793. MAKE_ENV+= ${DESTDIRNAME}=${STAGEDIR}
  1794. . else
  1795. MAKE_ARGS+= ${DESTDIRNAME}=${STAGEDIR}
  1796. . endif
  1797. . if defined(NO_PREFIX_RMDIR)
  1798. CO_ENV+= NO_PREFIX_RMDIR=1
  1799. . else
  1800. CO_ENV+= NO_PREFIX_RMDIR=0
  1801. . endif
  1802. METADIR= ${WRKDIR}/.metadir
  1803. PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install
  1804. PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install
  1805. PKGPREDEINSTALL?= ${PKGDIR}/pkg-pre-deinstall
  1806. PKGPOSTDEINSTALL?= ${PKGDIR}/pkg-post-deinstall
  1807. . if defined(USE_LOCAL_MK)
  1808. .include "${PORTSDIR}/Mk/bsd.local.mk"
  1809. . endif
  1810. . for odir in ${OVERLAYS}
  1811. .sinclude "${odir}/Mk/bsd.overlay.mk"
  1812. . endfor
  1813. . if defined(USE_JAVA)
  1814. .include "${PORTSDIR}/Mk/bsd.java.mk"
  1815. . endif
  1816. . if defined(USE_OCAML)
  1817. .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
  1818. . endif
  1819. . if defined(USE_WX) || defined(USE_WX_NOT)
  1820. .include "${PORTSDIR}/Mk/bsd.wx.mk"
  1821. . endif
  1822. . if defined(USE_GECKO)
  1823. .include "${PORTSDIR}/Mk/bsd.gecko.mk"
  1824. . endif
  1825. . if exists(${PORTSDIR}/Makefile.inc)
  1826. .include "${PORTSDIR}/Makefile.inc"
  1827. USE_SUBMAKE= yes
  1828. . endif
  1829. # Loading features
  1830. . for f in ${_USES_POST}
  1831. _f:= ${f:C/\:.*//}
  1832. . if !defined(${_f}_ARGS)
  1833. ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
  1834. . endif
  1835. . endfor
  1836. . for f in ${_USES_POST}
  1837. .undef _usefound
  1838. . for udir in ${OVERLAYS:C,$,/Mk/Uses,} ${USESDIR}
  1839. _usefile= ${udir}/${f:C/\:.*//}.mk
  1840. . if exists(${_usefile}) && !defined(_usefound)
  1841. _usefound=
  1842. .include "${_usefile}"
  1843. . endif
  1844. . endfor
  1845. . if !defined(_usefound)
  1846. ERROR+= "Unknown USES=${f:C/\:.*//}"
  1847. . endif
  1848. . endfor
  1849. . if defined(PORTNAME)
  1850. . if !defined(PACKAGE_BUILDING) || empty(.TARGETS) || make(all) || \
  1851. make(check-sanity) || make(show*-errors) || make(show*-warnings)
  1852. .include "${PORTSDIR}/Mk/bsd.sanity.mk"
  1853. . endif
  1854. . endif
  1855. . if defined(USE_LOCALE)
  1856. WRK_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}
  1857. . endif
  1858. # Macro for doing in-place file editing using regexps. REINPLACE_ARGS may only
  1859. # be used to set or override the -i argument. Any other use is considered
  1860. # invalid.
  1861. REINPLACE_ARGS?= -i.bak
  1862. . if defined(DEVELOPER)
  1863. REINPLACE_CMD?= ${SETENV} WRKSRC=${WRKSRC} REWARNFILE=${REWARNFILE} ${SH} ${SCRIPTSDIR}/sed_checked.sh
  1864. . else
  1865. REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
  1866. . endif
  1867. FRAMEWORK_REINPLACE_CMD?= ${SED} -i.bak
  1868. # Names of cookies used to skip already completed stages
  1869. EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1870. CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1871. INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1872. BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1873. PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1874. PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1875. STAGE_COOKIE?= ${WRKDIR}/.stage_done.${PORTNAME}.${PREFIX:S/\//_/g}
  1876. # How to do nothing. Override if you, for some strange reason, would rather
  1877. # do something.
  1878. # In general, however, DO_NADA is a relic of the past in the ports
  1879. # infrastructure, and most of its usage has been removed. If you need to define
  1880. # a target with DO_NADA, then there is a high chance that the ports
  1881. # infrastructure should be fixed instead.
  1882. DO_NADA?= ${TRUE}
  1883. # Use this as the first operand to always build dependency.
  1884. NONEXISTENT?= /nonexistent
  1885. CHECKSUM_ALGORITHMS?= sha256
  1886. DISTINFO_FILE?= ${MASTERDIR}/distinfo
  1887. MAKE_FLAGS?= -f
  1888. MAKEFILE?= Makefile
  1889. MAKE_CMD?= ${BSDMAKE}
  1890. MAKE_ENV+= PREFIX=${PREFIX} \
  1891. LOCALBASE=${LOCALBASE} \
  1892. CC="${CC}" CFLAGS="${CFLAGS}" \
  1893. CPP="${CPP}" CPPFLAGS="${CPPFLAGS}" \
  1894. LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
  1895. CXX="${CXX}" CXXFLAGS="${CXXFLAGS}"
  1896. # Add -fno-strict-aliasing to CFLAGS with optimization level -O2 or higher.
  1897. # gcc 4.x enable strict aliasing optimization with -O2 which is known to break
  1898. # a lot of ports.
  1899. . if !defined(WITHOUT_NO_STRICT_ALIASING)
  1900. . if ${CC} != "icc"
  1901. . if empty(CFLAGS:M-fno-strict-aliasing)
  1902. CFLAGS+= -fno-strict-aliasing
  1903. . endif
  1904. . endif
  1905. . endif
  1906. . for lang in C CXX
  1907. . if defined(USE_${lang}STD)
  1908. ${lang}FLAGS:= ${${lang}FLAGS:N-std=*} -std=${USE_${lang}STD}
  1909. . endif
  1910. ${lang}FLAGS+= ${${lang}FLAGS_${ARCH}}
  1911. . endfor
  1912. LDFLAGS+= ${LDFLAGS_${ARCH}}
  1913. # Multiple make jobs support
  1914. . if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
  1915. _MAKE_JOBS?= #
  1916. MAKE_JOBS_NUMBER= 1
  1917. . else
  1918. . if defined(MAKE_JOBS_NUMBER)
  1919. _MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
  1920. . else
  1921. . if !defined(_SMP_CPUS)
  1922. _SMP_CPUS!= ${NPROC} 2>/dev/null || ${SYSCTL} -n kern.smp.cpus
  1923. . endif
  1924. _EXPORTED_VARS+= _SMP_CPUS
  1925. _MAKE_JOBS_NUMBER= ${_SMP_CPUS}
  1926. . endif
  1927. . if defined(MAKE_JOBS_NUMBER_LIMIT) && ( ${MAKE_JOBS_NUMBER_LIMIT} < ${_MAKE_JOBS_NUMBER} )
  1928. MAKE_JOBS_NUMBER= ${MAKE_JOBS_NUMBER_LIMIT}
  1929. . else
  1930. MAKE_JOBS_NUMBER= ${_MAKE_JOBS_NUMBER}
  1931. . endif
  1932. _MAKE_JOBS?= -j${MAKE_JOBS_NUMBER}
  1933. BUILD_FAIL_MESSAGE+= Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer.
  1934. . endif
  1935. .include "${PORTSDIR}/Mk/bsd.ccache.mk"
  1936. . if !make(makesum)
  1937. FETCH_ENV?= SSL_NO_VERIFY_PEER=1 SSL_NO_VERIFY_HOSTNAME=1
  1938. . endif
  1939. FETCH_BINARY?= /usr/bin/fetch
  1940. FETCH_ARGS?= -Fpr
  1941. FETCH_REGET?= 1
  1942. FETCH_CMD?= ${FETCH_BINARY} ${FETCH_ARGS}
  1943. . if defined(RANDOMIZE_MASTER_SITES)
  1944. . if exists(/usr/games/random)
  1945. RANDOM_CMD?= /usr/games/random
  1946. . elif exists(/usr/bin/random)
  1947. RANDOM_CMD?= /usr/bin/random
  1948. . endif
  1949. . if defined(RANDOM_CMD) && !empty(RANDOM_CMD)
  1950. RANDOM_ARGS?= -w -f -
  1951. _RANDOMIZE_SITES= ${RANDOM_CMD} ${RANDOM_ARGS}
  1952. . endif
  1953. . endif
  1954. TOUCH?= /usr/bin/touch
  1955. TOUCH_FLAGS?= -f
  1956. DISTORIG?= .bak.orig
  1957. PATCH?= /usr/bin/patch
  1958. PATCH_STRIP?= -p0
  1959. PATCH_DIST_STRIP?= -p0
  1960. . if defined(PATCH_DEBUG)
  1961. PATCH_DEBUG_TMP= yes
  1962. PATCH_ARGS?= --forward -E ${PATCH_STRIP}
  1963. PATCH_DIST_ARGS?= --suffix ${DISTORIG} --forward -E ${PATCH_DIST_STRIP}
  1964. . else
  1965. PATCH_ARGS?= --forward --quiet -E ${PATCH_STRIP}
  1966. PATCH_DIST_ARGS?= --suffix ${DISTORIG} --forward --quiet -E ${PATCH_DIST_STRIP}
  1967. . endif
  1968. . if !defined(QUIET)
  1969. PATCH_SILENT= PATCH_SILENT=yes
  1970. . endif
  1971. . if defined(BATCH)
  1972. PATCH_ARGS+= --batch
  1973. PATCH_DIST_ARGS+= --batch
  1974. . endif
  1975. # Prevent breakage with VERSION_CONTROL=numbered
  1976. PATCH_ARGS+= -V simple
  1977. PATCH_DIST_ARGS+= -V simple
  1978. . if defined(PATCH_CHECK_ONLY)
  1979. PATCH_ARGS+= -C
  1980. PATCH_DIST_ARGS+= -C
  1981. . endif
  1982. . if ${PATCH} == "/usr/bin/patch"
  1983. PATCH_ARGS+= --suffix .orig
  1984. PATCH_DIST_ARGS+= --suffix .orig
  1985. . endif
  1986. TAR?= /usr/bin/tar
  1987. # EXTRACT_SUFX is defined in .pre.mk section
  1988. EXTRACT_CMD?= ${TAR}
  1989. EXTRACT_BEFORE_ARGS?= -xf
  1990. EXTRACT_AFTER_ARGS?= --no-same-owner --no-same-permissions
  1991. # Figure out where the local mtree file is
  1992. . if !defined(MTREE_FILE) && !defined(NO_MTREE)
  1993. . if ${PREFIX} == /usr
  1994. MTREE_FILE= /etc/mtree/BSD.usr.dist
  1995. . else
  1996. MTREE_FILE= ${PORTSDIR}/Templates/BSD.local.dist
  1997. . endif
  1998. . endif
  1999. MTREE_CMD?= /usr/sbin/mtree
  2000. MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
  2001. _SHAREMODE?= 0644
  2002. # A few aliases for *-install targets
  2003. INSTALL_PROGRAM= ${INSTALL} ${COPY} ${STRIP} -m ${BINMODE}
  2004. INSTALL_KLD= ${INSTALL} ${COPY} -m ${BINMODE}
  2005. INSTALL_LIB= ${INSTALL} ${COPY} ${STRIP} -m ${_SHAREMODE}
  2006. INSTALL_SCRIPT= ${INSTALL} ${COPY} -m ${BINMODE}
  2007. INSTALL_DATA= ${INSTALL} ${COPY} -m ${_SHAREMODE}
  2008. INSTALL_MAN= ${INSTALL} ${COPY} -m ${MANMODE}
  2009. INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
  2010. BSD_INSTALL_LIB="${INSTALL_LIB}" \
  2011. BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
  2012. BSD_INSTALL_DATA="${INSTALL_DATA}" \
  2013. BSD_INSTALL_MAN="${INSTALL_MAN}"
  2014. MAKE_ENV+= ${INSTALL_MACROS}
  2015. SCRIPTS_ENV+= ${INSTALL_MACROS}
  2016. # Macro for copying entire directory tree with correct permissions
  2017. # In the -exec shell commands, we add add a . as the first argument, it would
  2018. # end up being $0 aka the script name, which is not part of $@, so we force it
  2019. # to be able to use $@ directly.
  2020. COPYTREE_BIN= ${SH} -c '(${FIND} -Ed $$1 $$3 | ${CPIO} -dumpl $$2 >/dev/null 2>&1) && \
  2021. ${FIND} -Ed $$1 $$3 \( -type d -exec ${SH} -c '\''cd '\''$$2'\'' && chmod 755 "$$@"'\'' . {} + \
  2022. -o -type f -exec ${SH} -c '\''cd '\''$$2'\'' && chmod ${BINMODE} "$$@"'\'' . {} + \)' COPYTREE_BIN
  2023. COPYTREE_SHARE= ${SH} -c '(${FIND} -Ed $$1 $$3 | ${CPIO} -dumpl $$2 >/dev/null 2>&1) && \
  2024. ${FIND} -Ed $$1 $$3 \( -type d -exec ${SH} -c '\''cd '\''$$2'\'' && chmod 755 "$$@"'\'' . {} + \
  2025. -o -type f -exec ${SH} -c '\''cd '\''$$2'\'' && chmod ${_SHAREMODE} "$$@"'\'' . {} + \)' COPYTREE_SHARE
  2026. # The user can override the NO_PACKAGE by specifying this from
  2027. # the make command line
  2028. . if defined(FORCE_PACKAGE)
  2029. .undef NO_PACKAGE
  2030. . endif
  2031. DESCR?= ${PKGDIR}/pkg-descr
  2032. PLIST?= ${PKGDIR}/pkg-plist
  2033. PKGHELP?= ${PKGDIR}/pkg-help
  2034. PKGINSTALL?= ${PKGDIR}/pkg-install
  2035. PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
  2036. PKGMESSAGE?= ${PKGDIR}/pkg-message
  2037. _PKGMESSAGES+= ${PKGMESSAGE}
  2038. TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
  2039. _PLIST?= ${WRKDIR}/.PLIST
  2040. # backward compatibility for users
  2041. . if defined(_PKG_TRANSITIONING_TO_NEW_EXT)
  2042. . if defined(PKG_NOCOMPRESS)
  2043. PKG_SUFX?= .tar
  2044. . else
  2045. PKG_SUFX?= .txz
  2046. . endif
  2047. PKG_COMPRESSION_FORMAT?= ${PKG_SUFX:S/.//}
  2048. . else
  2049. . if defined(PKG_SUFX)
  2050. PKG_COMPRESSION_FORMAT?= ${PKG_SUFX:S/.//}
  2051. WARNING+= "PKG_SUFX is defined, it should be replaced with PKG_COMPRESSION_FORMAT"
  2052. . endif
  2053. PKG_SUFX= .pkg
  2054. . endif
  2055. . if defined(PKG_NOCOMPRESS)
  2056. PKG_COMPRESSION_FORMAT?= tar
  2057. . else
  2058. . if ${OSVERSION} > 1400000
  2059. PKG_COMPRESSION_FORMAT?= tzst
  2060. . else
  2061. PKG_COMPRESSION_FORMAT?= txz
  2062. . endif
  2063. . endif
  2064. # where pkg(8) stores its data
  2065. PKG_DBDIR?= /var/db/pkg
  2066. ALL_TARGET?= all
  2067. INSTALL_TARGET?= install
  2068. INSTALL_TARGET+= ${LATE_INSTALL_ARGS}
  2069. # Popular master sites
  2070. .include "${PORTSDIR}/Mk/bsd.sites.mk"
  2071. # Empty declaration to avoid "variable MASTER_SITES recursive" error
  2072. MASTER_SITES?=
  2073. PATCH_SITES?=
  2074. _MASTER_SITES_DEFAULT?=
  2075. _PATCH_SITES_DEFAULT?=
  2076. # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
  2077. # as per grouping rules (:something)
  2078. # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
  2079. # rules (:something)
  2080. . for _S in ${MASTER_SITES}
  2081. _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://}
  2082. . if !empty(_S_TEMP)
  2083. . for _group in ${_S_TEMP:S/,/ /g}
  2084. _G_TEMP= ${_group}
  2085. . if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
  2086. check-makevars::
  2087. @${ECHO_MSG} "The ${_S} MASTER_SITES line has"
  2088. @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
  2089. @${FALSE}
  2090. . endif
  2091. . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
  2092. check-makevars::
  2093. @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
  2094. @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
  2095. @${FALSE}
  2096. . endif
  2097. _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
  2098. . endfor
  2099. . else
  2100. _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
  2101. . endif
  2102. . endfor
  2103. . for _S in ${PATCH_SITES}
  2104. _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
  2105. . if !empty(_S_TEMP)
  2106. . for _group in ${_S_TEMP:S/,/ /g}
  2107. _G_TEMP= ${_group}
  2108. . if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
  2109. check-makevars::
  2110. @${ECHO_MSG} "The ${_S} PATCH_SITES line has"
  2111. @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
  2112. @${FALSE}
  2113. . endif
  2114. . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
  2115. check-makevars::
  2116. @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
  2117. @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
  2118. @${FALSE}
  2119. . endif
  2120. _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
  2121. . endfor
  2122. . else
  2123. _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
  2124. . endif
  2125. . endfor
  2126. # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
  2127. # as per grouping rules (:something)
  2128. # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
  2129. # rules (:something)
  2130. . for _S in ${MASTER_SITE_SUBDIR}
  2131. _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
  2132. . if !empty(_S_TEMP)
  2133. . for _group in ${_S_TEMP:S/,/ /g}
  2134. _G_TEMP= ${_group}
  2135. . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
  2136. check-makevars::
  2137. @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
  2138. @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
  2139. @${FALSE}
  2140. . endif
  2141. . if defined(_MASTER_SITES_${_group})
  2142. _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
  2143. . endif
  2144. . endfor
  2145. . else
  2146. . if defined(_MASTER_SITES_DEFAULT)
  2147. _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
  2148. . endif
  2149. . endif
  2150. . endfor
  2151. . for _S in ${PATCH_SITE_SUBDIR}
  2152. _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
  2153. . if !empty(_S_TEMP)
  2154. . for _group in ${_S_TEMP:S/,/ /g}
  2155. _G_TEMP= ${_group}
  2156. . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
  2157. check-makevars::
  2158. @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
  2159. @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
  2160. @${FALSE}
  2161. . endif
  2162. . if defined(_PATCH_SITES_${_group})
  2163. _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
  2164. . endif
  2165. . endfor
  2166. . else
  2167. . if defined(_PATCH_SITES_DEFAULT)
  2168. _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
  2169. . endif
  2170. . endif
  2171. . endfor
  2172. # Substitute subdirectory names
  2173. # XXX simpler/faster solution but not the best space wise, suggestions please
  2174. . for _S in ${MASTER_SITES}
  2175. _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
  2176. . if !empty(_S_TEMP)
  2177. . for _group in ${_S_TEMP:S/,/ /g}
  2178. . if !defined(_MASTER_SITE_SUBDIR_${_group})
  2179. MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
  2180. . else
  2181. _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
  2182. . if empty(_S_TEMP_TEMP)
  2183. MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
  2184. . else
  2185. MASTER_SITES_TMP=
  2186. . for site in ${_MASTER_SITES_${_group}}
  2187. _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
  2188. . if empty(_S_TEMP_TEMP)
  2189. MASTER_SITES_TMP+= ${site}
  2190. . else
  2191. . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
  2192. MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
  2193. . endfor
  2194. . endif
  2195. . endfor
  2196. . endif
  2197. . endif
  2198. _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
  2199. . endfor
  2200. . endif
  2201. . endfor
  2202. . if defined(_MASTER_SITE_SUBDIR_DEFAULT)
  2203. _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
  2204. . if empty(_S_TEMP)
  2205. MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
  2206. . else
  2207. MASTER_SITES_TMP=
  2208. . for site in ${_MASTER_SITES_DEFAULT}
  2209. _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
  2210. . if empty(_S_TEMP_TEMP)
  2211. MASTER_SITES_TMP+= ${site}
  2212. . else
  2213. . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
  2214. MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
  2215. . endfor
  2216. . endif
  2217. . endfor
  2218. . endif
  2219. . else
  2220. MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
  2221. . endif
  2222. _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
  2223. MASTER_SITES_TMP=
  2224. . for _S in ${PATCH_SITES}
  2225. _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
  2226. . if !empty(_S_TEMP)
  2227. . for _group in ${_S_TEMP:S/,/ /g}
  2228. . if !defined(_PATCH_SITE_SUBDIR_${_group})
  2229. PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
  2230. . else
  2231. _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
  2232. . if empty(_S_TEMP_TEMP)
  2233. PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
  2234. . else
  2235. PATCH_SITES_TMP=
  2236. . for site in ${_PATCH_SITES_${_group}}
  2237. _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
  2238. . if empty(_S_TEMP_TEMP)
  2239. PATCH_SITES_TMP+= ${site}
  2240. . else
  2241. . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
  2242. PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
  2243. . endfor
  2244. . endif
  2245. . endfor
  2246. . endif
  2247. . endif
  2248. _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
  2249. . endfor
  2250. . endif
  2251. . endfor
  2252. . if defined(_PATCH_SITE_SUBDIR_DEFAULT)
  2253. _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
  2254. . if empty(_S_TEMP)
  2255. PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
  2256. . else
  2257. PATCH_SITES_TMP=
  2258. . for site in ${_PATCH_SITES_DEFAULT}
  2259. _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
  2260. . if empty(_S_TEMP_TEMP)
  2261. PATCH_SITES_TMP+= ${site}
  2262. . else
  2263. . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
  2264. PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
  2265. . endfor
  2266. . endif
  2267. . endfor
  2268. . endif
  2269. . else
  2270. PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
  2271. . endif
  2272. _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
  2273. PATCH_SITES_TMP=
  2274. # The primary backup site.
  2275. MASTER_SITE_BACKUP?= \
  2276. http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/
  2277. MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
  2278. # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
  2279. # for everything, but don't search it twice by appending it to the end.
  2280. . if defined(MASTER_SITE_FREEBSD)
  2281. _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
  2282. _MASTER_SITE_BACKUP:= # empty
  2283. . else
  2284. _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
  2285. _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
  2286. . endif
  2287. # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
  2288. # according to grouping rules (:something)
  2289. DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
  2290. _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
  2291. _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
  2292. _G_TEMP= DEFAULT
  2293. . for _D in ${DISTFILES}
  2294. _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
  2295. . if !empty(_D_TEMP)
  2296. . for _group in ${_D_TEMP:S/^://:S/,/ /g}
  2297. . if !defined(_MASTER_SITES_${_group})
  2298. _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
  2299. . if empty(_G_TEMP_TEMP)
  2300. _G_TEMP+= ${_group}
  2301. _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
  2302. . endif
  2303. . endif
  2304. . endfor
  2305. _DISTFILES+= ${_D:C/:[^:]+$//}
  2306. . else
  2307. _DISTFILES+= ${_D}
  2308. . endif
  2309. . endfor
  2310. _G_TEMP= DEFAULT
  2311. . for _P in ${PATCHFILES}
  2312. _P_TEMP= ${_P:C/:[^-:][^:]*$//}
  2313. _P_groups= ${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
  2314. _P_file= ${_P_TEMP:C/:-[^:]+$//}
  2315. _P_strip= ${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
  2316. . if !empty(_P_groups)
  2317. . for _group in ${_P_groups:S/,/ /g}
  2318. . if !defined(_PATCH_SITES_${_group})
  2319. _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
  2320. . if empty(_G_TEMP_TEMP)
  2321. _G_TEMP+= ${_group}
  2322. _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
  2323. . endif
  2324. . endif
  2325. . endfor
  2326. . endif
  2327. _PATCHFILES:= ${_PATCHFILES} ${_P_file}
  2328. . if empty(_P_strip)
  2329. _PATCHFILES2:= ${_PATCHFILES2} ${_P_file}
  2330. . else
  2331. _PATCHFILES2:= ${_PATCHFILES2} ${_P_file}:${_P_strip}
  2332. . endif
  2333. . endfor
  2334. _P_groups=
  2335. _P_file=
  2336. _P_strip=
  2337. _G_TEMP=
  2338. _G_TEMP_TEMP=
  2339. ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
  2340. #
  2341. # Sort the master site list according to the patterns in MASTER_SORT
  2342. #
  2343. MASTER_SORT?=
  2344. MASTER_SORT_REGEX?=
  2345. MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
  2346. MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
  2347. . for srt in ${MASTER_SORT_REGEX}
  2348. MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
  2349. . endfor
  2350. MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
  2351. #
  2352. # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
  2353. #
  2354. _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT=${_MASTER_SITES_DEFAULT:Q}
  2355. . for _F in ${DISTFILES}
  2356. _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
  2357. . if !empty(_F_TEMP)
  2358. . for _group in ${_F_TEMP:S/,/ /g}
  2359. . if defined(_MASTER_SITES_${_group})
  2360. _MASTER_SITES_ENV+= _MASTER_SITES_${_group}=${_MASTER_SITES_${_group}:Q}
  2361. . endif
  2362. . endfor
  2363. . endif
  2364. . endfor
  2365. _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT=${_PATCH_SITES_DEFAULT:Q}
  2366. . for _F in ${PATCHFILES}
  2367. _F_TEMP= ${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
  2368. . if !empty(_F_TEMP)
  2369. . for _group in ${_F_TEMP:S/,/ /g}
  2370. . if defined(_PATCH_SITES_${_group})
  2371. _PATCH_SITES_ENV+= _PATCH_SITES_${_group}=${_PATCH_SITES_${_group}:Q}
  2372. . endif
  2373. . endfor
  2374. . endif
  2375. . endfor
  2376. CKSUMFILES= ${ALLFILES}
  2377. # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
  2378. . if defined(DIST_SUBDIR)
  2379. . if defined(CKSUMFILES) && ${CKSUMFILES}!=""
  2380. _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
  2381. . endif
  2382. . else
  2383. _CKSUMFILES?= ${CKSUMFILES}
  2384. . endif
  2385. # This is what is actually going to be extracted, and is overridable
  2386. # by user.
  2387. EXTRACT_ONLY?= ${_DISTFILES}
  2388. . if !target(maintainer)
  2389. maintainer:
  2390. @${ECHO_CMD} "${MAINTAINER}"
  2391. . endif
  2392. . if !defined(CATEGORIES)
  2393. check-categories:
  2394. @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
  2395. @${FALSE}
  2396. . else
  2397. VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
  2398. benchmarks biology budgie cad chinese comms converters \
  2399. databases deskutils devel dns docs \
  2400. editors education elisp emulators enlightenment finance french ftp \
  2401. games geography german gnome gnustep graphics \
  2402. hamradio haskell hebrew hungarian irc japanese java \
  2403. kde ${_KDE_CATEGORIES_SUPPORTED} kld korean \
  2404. lang linux lisp \
  2405. mail mate math mbone misc multimedia \
  2406. net net-im net-mgmt net-p2p net-vpn news \
  2407. parallel pear perl5 plan9 polish ports-mgmt portuguese \
  2408. print python ruby rubygems russian \
  2409. scheme science security shells spanish sysutils \
  2410. tcl textproc tk \
  2411. ukrainian vietnamese wayland windowmaker www \
  2412. x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes \
  2413. x11-toolkits x11-wm xfce zope base
  2414. check-categories:
  2415. . for cat in ${CATEGORIES}
  2416. . if empty(VALID_CATEGORIES:M${cat})
  2417. @${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
  2418. ${FALSE};
  2419. . endif
  2420. . endfor
  2421. . endif
  2422. PKGREPOSITORYSUBDIR?= All
  2423. PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
  2424. # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
  2425. PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
  2426. PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
  2427. PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}${PKG_SUFX}
  2428. . if ${PKG_COMPRESSION_FORMAT} == txz
  2429. PKGOLDLATESTFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}.${PKG_COMPRESSION_FORMAT}
  2430. # Temporary workaround to be deleted once every supported version of FreeBSD
  2431. # have a bootstrap which handles the pkg extension.
  2432. PKGOLDSIGFILE= ${PKGLATESTREPOSITORY}/${PKGBASE}.${PKG_COMPRESSION_FORMAT}.sig
  2433. . endif
  2434. _PKGS= ${PKGBASE}
  2435. PORTS_FEATURES+= SUBPACKAGES
  2436. . if defined(SUBPACKAGES)
  2437. . if ${SUBPACKAGES:Mmain}
  2438. DEV_ERROR+= "SUBPACKAGES cannot contain 'main', it is a reserved value"
  2439. . endif
  2440. . for sp in ${SUBPACKAGES}
  2441. . if ${sp:C/[[:lower:][:digit:]_]//g}
  2442. _BAD_SUBPACKAGES_NAMES+= ${sp}
  2443. . endif
  2444. . endfor
  2445. . if !empty(_BAD_SUBPACKAGES_NAMES)
  2446. DEV_ERROR+= "SUBPACKAGES cannot subpackages that are not all [a-z0-9_]: ${_BAD_SUBPACKAGES_NAMES}"
  2447. . endif
  2448. . endif
  2449. . for sp in ${SUBPACKAGES}
  2450. # If a FRAMEWORK generated package needs to override its subpackage package name
  2451. # it can do it with this mechanism
  2452. . if !defined(_PKGS.${sp})
  2453. _PKGS.${sp}= ${PKGBASE}-${sp}
  2454. . endif
  2455. _PKGS+= ${_PKGS.${sp}}
  2456. PKGBASE.${sp}= ${_PKGS.${sp}}
  2457. _SP.${_PKGS.${sp}}=.${sp}
  2458. . endfor
  2459. . if !defined(_DID_SUBPACKAGES_HELPERS)
  2460. _DID_SUBPACKAGES_HELPERS= yes
  2461. _SUBPACKAGE_HELPERS_FILE= DESCR PKGINSTALL PKGDEINSTALL PKGMESSAGE \
  2462. PKGPREINSTALL PKGPOSTINSTALL PKGPREDEINSTALL PKGPOSTDEINSTALL \
  2463. PKGPREUPGRADE PKGPOSTUPGRADE PKGUPGRADE
  2464. . for sp in ${SUBPACKAGES}
  2465. # These overwrite the current value
  2466. . for v in ${_SUBPACKAGE_HELPERS_FILE}
  2467. ${v}.${sp}?= ${$v}.${sp}
  2468. . endfor
  2469. _PKGMESSAGES.${sp}= ${PKGMESSAGE}.${sp}
  2470. . if !exists(${DESCR.${sp}}) && ${sp} != debuginfo
  2471. DESCR.${sp}= ${DESCR}
  2472. DEV_WARNING+= "DESCR.${sp} needs to point to an existing file."
  2473. . endif
  2474. COMMENT.${sp}?= ${COMMENT} (subpkg: ${sp})
  2475. . endfor
  2476. . endif
  2477. . if exists(${PACKAGES})
  2478. PACKAGES:= ${PACKAGES:S/:/\:/g}
  2479. _HAVE_PACKAGES= yes
  2480. _PKGDIR= ${PKGREPOSITORY}
  2481. . else
  2482. _PKGDIR= ${.CURDIR}
  2483. . endif
  2484. . for sp in ${_PKGS}
  2485. PKGNAME${_SP.${sp}}= ${sp}-${PKGVERSION}
  2486. PKGNAMES+= ${PKGNAME${_SP.${sp}}}
  2487. PKGFILE${_SP.${sp}}= ${_PKGDIR}/${PKGNAME${_SP.${sp}}}${PKG_SUFX}
  2488. . endfor
  2489. _EXTRA_PACKAGE_TARGET_DEP+= ${_PKGDIR}
  2490. . for sp in ${_PKGS}
  2491. WRKDIR_PKGFILE${_SP.${sp}}= ${WRKDIR}/pkg/${PKGNAME${_SP.${sp}}}${PKG_SUFX}
  2492. . endfor
  2493. # Integrate with the license auditing framework
  2494. . if !defined (DISABLE_LICENSES)
  2495. .include "${PORTSDIR}/Mk/bsd.licenses.mk"
  2496. . endif
  2497. CONFIGURE_SCRIPT?= configure
  2498. CONFIGURE_CMD?= ./${CONFIGURE_SCRIPT}
  2499. CONFIGURE_TARGET?= ${HOSTARCH}-portbld-${OPSYS:tl}${OSREL}
  2500. CONFIGURE_TARGET:= ${CONFIGURE_TARGET:S/--build=//}
  2501. CONFIGURE_LOG?= config.log
  2502. # A default message to print if do-configure fails.
  2503. CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (e.g. a ${PKG_INFO} -Ea)."
  2504. CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
  2505. . if defined(GNU_CONFIGURE)
  2506. # Maximum command line length
  2507. . if !defined(CONFIGURE_MAX_CMD_LEN)
  2508. CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
  2509. . endif
  2510. _EXPORTED_VARS+= CONFIGURE_MAX_CMD_LEN
  2511. GNU_CONFIGURE_PREFIX?= ${PREFIX}
  2512. GNU_CONFIGURE_MANPREFIX?= ${PREFIX}/share
  2513. CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
  2514. . if defined(CROSS_TOOLCHAIN)
  2515. CROSS_HOST= ${ARCH:S/amd64/x86_64/}-unknown-${OPSYS:tl}${OSREL}
  2516. CONFIGURE_ARGS+= --host=${CROSS_HOST}
  2517. . endif
  2518. CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
  2519. HAS_CONFIGURE= yes
  2520. SET_LATE_CONFIGURE_ARGS= \
  2521. _LATE_CONFIGURE_ARGS="" ; \
  2522. if [ -z "${CONFIGURE_ARGS:M--localstatedir=*:Q}" ] && \
  2523. ${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- --localstatedir > /dev/null; then \
  2524. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --localstatedir=/var" ; \
  2525. fi ; \
  2526. if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--mandir'`" ]; then \
  2527. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --mandir=${GNU_CONFIGURE_MANPREFIX}/man" ; \
  2528. fi ; \
  2529. if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--disable-silent-rules'`" ]; then \
  2530. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --disable-silent-rules" ; \
  2531. fi ; \
  2532. if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--enable-jobserver\[.*\#\]'`" ]; then \
  2533. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --enable-jobserver=${MAKE_JOBS_NUMBER}" ; \
  2534. fi ; \
  2535. if [ ! -z "`${CONFIGURE_CMD} --help 2>&1 | ${GREP} -- '--infodir'`" ]; then \
  2536. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --infodir=${GNU_CONFIGURE_PREFIX}/${INFO_PATH}/${INFO_SUBDIR}" ; \
  2537. fi ; \
  2538. if [ -z "`${CONFIGURE_CMD} --version 2>&1 | ${EGREP} -i '(autoconf.*2\.13|Unrecognized option)'`" ]; then \
  2539. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_TARGET}" ; \
  2540. else \
  2541. _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} ${CONFIGURE_TARGET}" ; \
  2542. fi ;
  2543. . endif
  2544. # Passed to most of script invocations
  2545. SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
  2546. WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
  2547. SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
  2548. PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE}
  2549. . if defined(BATCH)
  2550. SCRIPTS_ENV+= BATCH=yes
  2551. . endif
  2552. MANDIRS+= ${PREFIX}/share/man
  2553. INFO_PATH?= share/info
  2554. . if defined(INFO)
  2555. RUN_DEPENDS+= indexinfo:print/indexinfo
  2556. . for D in ${INFO:H}
  2557. RD:= ${D}
  2558. . if ${RD} != "."
  2559. . if !defined(INFO_SUBDIR)
  2560. INFO_SUBDIR:= ${RD}
  2561. . elif ${INFO_SUBDIR} != ${RD}
  2562. BROKEN= only one subdirectory in INFO is allowed
  2563. . endif
  2564. . endif
  2565. .undef RD
  2566. . endfor
  2567. . endif
  2568. DOCSDIR_REL?= ${DOCSDIR:S,^${PREFIX}/,,}
  2569. EXAMPLESDIR_REL?= ${EXAMPLESDIR:S,^${PREFIX}/,,}
  2570. DATADIR_REL?= ${DATADIR:S,^${PREFIX}/,,}
  2571. WWWDIR_REL?= ${WWWDIR:S,^${PREFIX}/,,}
  2572. ETCDIR_REL?= ${ETCDIR:S,^${PREFIX}/,,}
  2573. PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
  2574. EXAMPLESDIR="${EXAMPLESDIR_REL}" \
  2575. DATADIR="${DATADIR_REL}" \
  2576. WWWDIR="${WWWDIR_REL}" \
  2577. ETCDIR="${ETCDIR_REL}"
  2578. DESKTOPDIR?= ${PREFIX}/share/applications
  2579. .MAIN: all
  2580. ################################################################
  2581. # Many ways to disable a port.
  2582. #
  2583. # If we're in BATCH mode and the port is interactive, or we're
  2584. # in interactive mode and the port is non-interactive, skip all
  2585. # the important targets. The reason we have two modes is that
  2586. # one might want to leave a build in BATCH mode running
  2587. # overnight, then come back in the morning and do _only_ the
  2588. # interactive ones that required your intervention.
  2589. #
  2590. # Ignore ports that can't be resold if building for a CDROM.
  2591. #
  2592. # Don't build a port if it's restricted and we don't want to get
  2593. # into that.
  2594. #
  2595. # Don't build a port if it's broken, unless we're running a parallel
  2596. # build (in case it's fixed).
  2597. #
  2598. # Don't build a port if it's forbidden for whatever reason.
  2599. #
  2600. # Don't build a port if the system is too old.
  2601. ################################################################
  2602. # Check the machine architectures
  2603. . if defined(ONLY_FOR_ARCHS)
  2604. . for __ARCH in ${ONLY_FOR_ARCHS}
  2605. . if ${ARCH:M${__ARCH}} != ""
  2606. __ARCH_OK?= 1
  2607. . endif
  2608. . endfor
  2609. . else
  2610. __ARCH_OK?= 1
  2611. . endif
  2612. . if defined(NOT_FOR_ARCHS)
  2613. . for __NARCH in ${NOT_FOR_ARCHS}
  2614. . if ${ARCH:M${__NARCH}} != ""
  2615. .undef __ARCH_OK
  2616. . endif
  2617. . endfor
  2618. . endif
  2619. . if !defined(__ARCH_OK)
  2620. . if defined(ONLY_FOR_ARCHS)
  2621. IGNORE= is only for ${ONLY_FOR_ARCHS:O},
  2622. . else # defined(NOT_FOR_ARCHS)
  2623. IGNORE= does not run on ${NOT_FOR_ARCHS:O},
  2624. . endif
  2625. IGNORE+= while you are running ${ARCH}
  2626. . if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
  2627. IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}})
  2628. . elif defined(ONLY_FOR_ARCHS_REASON)
  2629. IGNORE+= (reason: ${ONLY_FOR_ARCHS_REASON})
  2630. . endif
  2631. . if defined(NOT_FOR_ARCHS_REASON_${ARCH})
  2632. IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON_${ARCH}})
  2633. . elif defined(NOT_FOR_ARCHS_REASON)
  2634. IGNORE+= (reason: ${NOT_FOR_ARCHS_REASON})
  2635. . endif
  2636. . endif
  2637. # Check the user interaction and legal issues
  2638. . if !defined(NO_IGNORE)
  2639. . for v in ${OSREL} ${OSREL:R}
  2640. . for f in ${FLAVOR}
  2641. . if defined($f_IGNORE_${OPSYS}_${v})
  2642. IGNORE+= "${${f}_IGNORE_${OPSYS}_${v}}"
  2643. . endif
  2644. . endfor
  2645. . endfor
  2646. . if (defined(IS_INTERACTIVE) && defined(BATCH))
  2647. IGNORE= is an interactive port
  2648. . elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
  2649. IGNORE= is not an interactive port
  2650. . elif (defined(NO_CDROM) && defined(FOR_CDROM))
  2651. IGNORE= may not be placed on a CDROM: ${NO_CDROM}
  2652. . elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
  2653. IGNORE= is restricted: ${RESTRICTED}
  2654. . elif (defined(NO_PACKAGE) && defined(PACKAGE_BUILDING))
  2655. IGNORE= may not be packaged: ${NO_PACKAGE}
  2656. . elif defined(IGNORE_${ARCH})
  2657. IGNORE= ${IGNORE_${ARCH}}
  2658. . elif defined(IGNORE_${OPSYS}_${OSREL:R}_${ARCH})
  2659. IGNORE= ${IGNORE_${OPSYS}_${OSREL:R}_${ARCH}}
  2660. . elif defined(IGNORE_${OPSYS}_${OSREL:R})
  2661. IGNORE= ${IGNORE_${OPSYS}_${OSREL:R}}
  2662. . elif defined(IGNORE_${OPSYS})
  2663. IGNORE= ${IGNORE_${OPSYS}}
  2664. . elif defined(BROKEN)
  2665. . if !defined(TRYBROKEN)
  2666. IGNORE= is marked as broken: ${BROKEN}
  2667. . endif
  2668. . elif defined(BROKEN_${ARCH})
  2669. . if !defined(TRYBROKEN)
  2670. IGNORE= is marked as broken on ${ARCH}: ${BROKEN_${ARCH}}
  2671. . endif
  2672. . elif defined(BROKEN_${OPSYS}_${OSREL:R}_${ARCH})
  2673. . if !defined(TRYBROKEN)
  2674. IGNORE= is marked as broken on ${OPSYS} ${OSREL} ${ARCH}: ${BROKEN_${OPSYS}_${OSREL:R}_${ARCH}}
  2675. . endif
  2676. . elif defined(BROKEN_${OPSYS}_${OSREL:R})
  2677. . if !defined(TRYBROKEN)
  2678. IGNORE= is marked as broken on ${OPSYS} ${OSREL}: ${BROKEN_${OPSYS}_${OSREL:R}}
  2679. . endif
  2680. . elif defined(BROKEN_${OPSYS})
  2681. . if !defined(TRYBROKEN)
  2682. IGNORE= is marked as broken on ${OPSYS}: ${BROKEN_${OPSYS}}
  2683. . endif
  2684. . elif defined(FORBIDDEN)
  2685. IGNORE= is forbidden: ${FORBIDDEN}
  2686. . endif
  2687. . if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
  2688. IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
  2689. clean:
  2690. @${IGNORECMD}
  2691. . endif
  2692. . if defined(IGNORE)
  2693. . if defined(IGNORE_SILENT)
  2694. IGNORECMD= ${DO_NADA}
  2695. . else
  2696. IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}. | ${FMT_80} ; exit 1
  2697. . endif
  2698. _TARGETS= check-sanity fetch checksum extract patch configure all build \
  2699. install reinstall test package stage restage
  2700. . for target in ${_TARGETS}
  2701. . if !target(${target})
  2702. ${target}:
  2703. @${IGNORECMD}
  2704. . if defined(INSTALLS_DEPENDS)
  2705. @${FALSE}
  2706. . endif
  2707. . endif
  2708. . endfor
  2709. . endif
  2710. . endif # !defined(NO_IGNORE)
  2711. ignorelist:
  2712. . if defined(IGNORE) || defined(NO_PACKAGE)
  2713. ignorelist: package-name
  2714. . endif
  2715. ignorelist-verbose:
  2716. . if defined(IGNORE)
  2717. @${ECHO_CMD} "${PKGNAME}|IGNORE: "${IGNORE:Q}
  2718. . elif defined(NO_PACKAGE)
  2719. @${ECHO_CMD} "${PKGNAME}|NO_PACKAGE: "${NO_PACKAGE:Q}
  2720. . endif
  2721. ################################################################
  2722. # Clean directories for ftp or CDROM.
  2723. ################################################################
  2724. . if !defined(LICENSE)
  2725. . if defined(RESTRICTED)
  2726. clean-restricted: delete-distfiles delete-package
  2727. clean-restricted-list: delete-distfiles-list delete-package-list
  2728. RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
  2729. . else
  2730. clean-restricted:
  2731. clean-restricted-list:
  2732. . endif
  2733. . if defined(NO_CDROM)
  2734. clean-for-cdrom: delete-distfiles delete-package
  2735. clean-for-cdrom-list: delete-distfiles-list delete-package-list
  2736. RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
  2737. . else
  2738. clean-for-cdrom:
  2739. clean-for-cdrom-list:
  2740. . endif
  2741. . endif # !defined(LICENSE)
  2742. . if defined(ALL_HOOK)
  2743. all:
  2744. @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
  2745. DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
  2746. PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
  2747. FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
  2748. BUILD_DEPENDS="${BUILD_DEPENDS}" RUN_DEPENDS="${RUN_DEPENDS}" \
  2749. CONFLICTS="${CONFLICTS}" \
  2750. ${ALL_HOOK}
  2751. . endif
  2752. . if !target(all)
  2753. all: stage
  2754. . endif
  2755. . if !defined(DEPENDS_TARGET)
  2756. . if defined(DEPENDS_PRECLEAN)
  2757. DEPENDS_TARGET= clean
  2758. DEPENDS_ARGS= NOCLEANDEPENDS=yes
  2759. . endif
  2760. . if make(reinstall)
  2761. DEPENDS_TARGET+= reinstall
  2762. . else
  2763. DEPENDS_TARGET+= install
  2764. . endif
  2765. . if defined(DEPENDS_CLEAN)
  2766. DEPENDS_TARGET+= clean
  2767. DEPENDS_ARGS+= NOCLEANDEPENDS=yes
  2768. . endif
  2769. . endif
  2770. ################################################################
  2771. #
  2772. # Do preliminary work to detect if we need to run the config
  2773. # target or not.
  2774. #
  2775. ################################################################
  2776. . if ((!defined(OPTIONS_DEFINE) && !defined(OPTIONS_SINGLE) && !defined(OPTIONS_MULTI)) \
  2777. && !defined(OPTIONS_GROUP) && !defined(OPTIONS_RADIO) \
  2778. || defined(CONFIG_DONE_${PKGBASE:tu}) || \
  2779. defined(PACKAGE_BUILDING) || defined(BATCH))
  2780. _OPTIONS_OK=yes
  2781. . endif
  2782. ################################################################
  2783. # The following are used to create easy dummy targets for
  2784. # disabling some bit of default target behavior you don't want.
  2785. # They still check to see if the target exists, and if so don't
  2786. # do anything, since you might want to set this globally for a
  2787. # group of ports in a Makefile.inc, but still be able to
  2788. # override from an individual Makefile.
  2789. ################################################################
  2790. # Disable build
  2791. . if defined(NO_BUILD) && !target(build)
  2792. build: configure
  2793. @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
  2794. . endif
  2795. # Disable package
  2796. . if defined(NO_PACKAGE) && !target(package)
  2797. package:
  2798. . if !defined(IGNORE_SILENT)
  2799. @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
  2800. . endif
  2801. . endif
  2802. ################################################################
  2803. # More standard targets start here.
  2804. #
  2805. # These are the body of the build/install framework. If you are
  2806. # not happy with the default actions, and you can't solve it by
  2807. # adding pre-* or post-* targets/scripts, override these.
  2808. ################################################################
  2809. . if defined(TRYBROKEN) && defined(BROKEN)
  2810. buildanyway-message:
  2811. @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
  2812. . endif
  2813. # Warn user about deprecated packages. Advisory only.
  2814. . if !target(check-deprecated)
  2815. # Try and keep these messages in sync with the ones in Mk/Scripts/create-manifest.sh
  2816. check-deprecated:
  2817. . if ${MAINTAINER} == "ports@FreeBSD.org"
  2818. @${ECHO_MSG} "===> NOTICE:"
  2819. @${ECHO_MSG}
  2820. @${ECHO_MSG} "The ${PORTNAME} port currently does not have a maintainer. As a result, it is"
  2821. @${ECHO_MSG} "more likely to have unresolved issues, not be up-to-date, or even be removed in"
  2822. @${ECHO_MSG} "the future. To volunteer to maintain this port, please create an issue at:"
  2823. @${ECHO_MSG}
  2824. @${ECHO_MSG} "https://bugs.freebsd.org/bugzilla"
  2825. @${ECHO_MSG}
  2826. @${ECHO_MSG} "More information about port maintainership is available at:"
  2827. @${ECHO_MSG}
  2828. @${ECHO_MSG} "https://docs.freebsd.org/en/articles/contributing/#ports-contributing"
  2829. @${ECHO_MSG}
  2830. . endif
  2831. . if defined(DEPRECATED)
  2832. @${ECHO_MSG} "===> NOTICE:"
  2833. @${ECHO_MSG}
  2834. @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
  2835. @${ECHO_MSG}
  2836. @${ECHO_MSG} ${DEPRECATED:Q}.
  2837. @${ECHO_MSG}
  2838. . if defined(EXPIRATION_DATE)
  2839. @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
  2840. @${ECHO_MSG}
  2841. . endif
  2842. . endif
  2843. . endif
  2844. # Check if the port is listed in the vulnerability database
  2845. AUDITFILE?= ${PKG_DBDIR}/vuln.xml
  2846. check-vulnerable:
  2847. . if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING) \
  2848. && exists(${AUDITFILE})
  2849. @${SETENV} \
  2850. dp_ECHO_MSG="${ECHO_MSG}" \
  2851. dp_PKG_BIN="${PKG_BIN}" \
  2852. dp_PORTNAME="${PORTNAME}" \
  2853. dp_PKGNAME="${PKGNAME}" \
  2854. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  2855. ${SH} ${SCRIPTSDIR}/check-vulnerable.sh
  2856. . endif
  2857. # Quote simply quote all variables, except FETCH_ENV, some ports are creative
  2858. # with it, and it needs to be quoted twice to pass through the echo/eval in
  2859. # do-fetch.
  2860. _DO_FETCH_ENV= \
  2861. dp_DISABLE_SIZE='${DISABLE_SIZE}' \
  2862. dp_DISTDIR='${_DISTDIR}' \
  2863. dp_DISTINFO_FILE='${DISTINFO_FILE}' \
  2864. dp_DIST_SUBDIR='${DIST_SUBDIR}' \
  2865. dp_ECHO_MSG='${ECHO_MSG}' \
  2866. dp_FETCH_AFTER_ARGS='${FETCH_AFTER_ARGS}' \
  2867. dp_FETCH_BEFORE_ARGS='${FETCH_BEFORE_ARGS}' \
  2868. dp_FETCH_CMD='${FETCH_CMD}' \
  2869. dp_FETCH_ENV=${FETCH_ENV:Q} \
  2870. dp_FORCE_FETCH_ALL='${FORCE_FETCH_ALL}' \
  2871. dp_FORCE_FETCH_LIST='${FORCE_FETCH_LIST}' \
  2872. dp_MASTER_SITE_BACKUP='${_MASTER_SITE_BACKUP}' \
  2873. dp_MASTER_SITE_OVERRIDE='${_MASTER_SITE_OVERRIDE}' \
  2874. dp_MASTER_SORT_AWK='${MASTER_SORT_AWK}' \
  2875. dp_NO_CHECKSUM='${NO_CHECKSUM}' \
  2876. dp_RANDOMIZE_SITES='${_RANDOMIZE_SITES}' \
  2877. dp_SCRIPTSDIR='${SCRIPTSDIR}' \
  2878. dp_TARGET='${.TARGET}'
  2879. . if defined(DEVELOPER)
  2880. _DO_FETCH_ENV+= dp_DEVELOPER=yes
  2881. . else
  2882. _DO_FETCH_ENV+= dp_DEVELOPER=
  2883. . endif
  2884. # Fetch
  2885. . if !target(do-fetch)
  2886. do-fetch:
  2887. . if !empty(DISTFILES)
  2888. @${SETENV} \
  2889. ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
  2890. dp_SITE_FLAVOR=MASTER \
  2891. ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
  2892. . endif
  2893. . if defined(PATCHFILES) && !empty(PATCHFILES)
  2894. @${SETENV} \
  2895. ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
  2896. dp_SITE_FLAVOR=PATCH \
  2897. ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
  2898. . endif
  2899. . endif
  2900. #
  2901. # Prints out a list of files to fetch (useful to do a batch fetch)
  2902. . if !target(fetch-list)
  2903. fetch-list:
  2904. . if !empty(DISTFILES)
  2905. @${SETENV} \
  2906. ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
  2907. dp_SITE_FLAVOR=MASTER \
  2908. ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
  2909. . endif
  2910. . if defined(PATCHFILES) && !empty(PATCHFILES)
  2911. @${SETENV} \
  2912. ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
  2913. dp_SITE_FLAVOR=PATCH \
  2914. ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
  2915. . endif
  2916. . endif
  2917. # Used by fetch-urlall-list and fetch-url-list
  2918. . if !target(fetch-url-list-int)
  2919. fetch-url-list-int:
  2920. . if !empty(DISTFILES)
  2921. @${SETENV} \
  2922. ${_DO_FETCH_ENV} ${_MASTER_SITES_ENV} \
  2923. dp_SITE_FLAVOR=MASTER \
  2924. ${SH} ${SCRIPTSDIR}/do-fetch.sh ${DISTFILES:C/.*/'&'/}
  2925. . endif
  2926. . if defined(PATCHFILES) && !empty(PATCHFILES)
  2927. @${SETENV} \
  2928. ${_DO_FETCH_ENV} ${_PATCH_SITES_ENV} \
  2929. dp_SITE_FLAVOR=PATCH \
  2930. ${SH} ${SCRIPTSDIR}/do-fetch.sh ${PATCHFILES:C/:-p[0-9]//:C/.*/'&'/}
  2931. . endif
  2932. . endif
  2933. . if !target(fetch-url-recursive-list-int)
  2934. fetch-url-recursive-list-int: fetch-url-list-int
  2935. @recursive_cmd="fetch-url-list-int"; \
  2936. recursive_dirs="$$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  2937. ${_FLAVOR_RECURSIVE_SH}
  2938. . endif
  2939. # Prints out all the URL for all the DISTFILES and PATCHFILES.
  2940. . if !target(fetch-urlall-list)
  2941. fetch-urlall-list:
  2942. @cd ${.CURDIR} && ${SETENV} FORCE_FETCH_ALL=yes ${MAKE} fetch-url-list-int
  2943. . endif
  2944. . if !target(fetch-urlall-recursive-list)
  2945. fetch-urlall-recursive-list: fetch-urlall-list
  2946. @recursive_cmd="fetch-urlall-list"; \
  2947. recursive_dirs="$$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  2948. ${_FLAVOR_RECURSIVE_SH}
  2949. . endif
  2950. # Prints the URL for all the DISTFILES and PATCHFILES that are not here
  2951. . if !target(fetch-url-list)
  2952. fetch-url-list: fetch-url-list-int
  2953. . endif
  2954. . if !target(fetch-url-recursive-list)
  2955. fetch-url-recursive-list: fetch-url-list
  2956. @recursive_cmd="fetch-url-list"; \
  2957. recursive_dirs="$$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  2958. ${_FLAVOR_RECURSIVE_SH}
  2959. . endif
  2960. # Extract
  2961. clean-wrkdir:
  2962. @${RM} -r ${WRKDIR}
  2963. . if !target(do-extract)
  2964. do-extract: ${EXTRACT_WRKDIR}
  2965. @for file in ${EXTRACT_ONLY}; do \
  2966. if ! (cd ${EXTRACT_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
  2967. then \
  2968. ${ECHO_MSG} "===> Failed to extract \"${_DISTDIR}/$$file\"."; \
  2969. exit 1; \
  2970. fi; \
  2971. done
  2972. @if [ ${UID} = 0 ]; then \
  2973. ${CHMOD} -R ug-s ${WRKDIR}; \
  2974. ${CHOWN} -R 0:0 ${WRKDIR}; \
  2975. fi
  2976. . endif
  2977. # Patch
  2978. . if !target(do-patch)
  2979. do-patch:
  2980. @${SETENV} \
  2981. dp_BZCAT="${BZCAT}" \
  2982. dp_CAT="${CAT}" \
  2983. dp_DISTDIR="${_DISTDIR}" \
  2984. dp_ECHO_MSG="${ECHO_MSG}" \
  2985. dp_EXTRA_PATCHES="${EXTRA_PATCHES}" \
  2986. dp_EXTRA_PATCH_TREE="${EXTRA_PATCH_TREE}" \
  2987. dp_GZCAT="${GZCAT}" \
  2988. dp_OPSYS="${OPSYS}" \
  2989. dp_PATCH="${PATCH}" \
  2990. dp_PATCHDIR="${PATCHDIR}" \
  2991. dp_PATCHFILES="${_PATCHFILES2}" \
  2992. dp_PATCH_ARGS=${PATCH_ARGS:Q} \
  2993. dp_PATCH_DEBUG_TMP="${PATCH_DEBUG_TMP}" \
  2994. dp_PATCH_DIST_ARGS="${PATCH_DIST_ARGS}" \
  2995. dp_PATCH_CONTINUE_ON_FAIL=${PATCH_CONTINUE_ON_FAIL:Dyes} \
  2996. dp_PATCH_SILENT="${PATCH_SILENT}" \
  2997. dp_PATCH_WRKSRC=${PATCH_WRKSRC} \
  2998. dp_PKGNAME="${PKGNAME}" \
  2999. dp_PKGORIGIN="${PKGORIGIN}" \
  3000. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  3001. dp_UNZIP_NATIVE_CMD="${UNZIP_NATIVE_CMD}" \
  3002. dp_XZCAT="${XZCAT}" \
  3003. ${SH} ${SCRIPTSDIR}/do-patch.sh
  3004. . endif
  3005. . if !target(run-autotools-fixup)
  3006. run-autotools-fixup:
  3007. # Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
  3008. . if !defined(WITHOUT_FBSD10_FIX)
  3009. -@for f in `${FIND} ${WRKDIR} -type f \( -name config.libpath -o \
  3010. -name config.rpath -o -name configure -o -name libtool.m4 -o \
  3011. -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
  3012. -name acinclude.m4 \)` ; do \
  3013. ${SED} -i.fbsd10bak \
  3014. -e 's|freebsd1\*)|freebsd1.\*)|g' \
  3015. -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
  3016. -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
  3017. -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
  3018. -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
  3019. $${f} ; \
  3020. cmp -s $${f}.fbsd10bak $${f} || \
  3021. ${ECHO_MSG} "===> FreeBSD 10 autotools fix applied to $${f}"; \
  3022. ${TOUCH} ${TOUCH_FLAGS} -mr $${f}.fbsd10bak $${f} ; \
  3023. ${RM} $${f}.fbsd10bak ; \
  3024. done
  3025. . endif
  3026. . endif
  3027. # Configure
  3028. . if !target(do-configure)
  3029. do-configure:
  3030. @if [ -f ${SCRIPTDIR}/configure ]; then \
  3031. cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
  3032. ${SCRIPTDIR}/configure; \
  3033. fi
  3034. . if defined(GNU_CONFIGURE)
  3035. @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
  3036. | ${XARGS} -n 1 ${DIRNAME}); \
  3037. for _D in $${CONFIG_GUESS_DIRS}; do \
  3038. ${RM} $${_D}/config.guess; \
  3039. ${CP} ${TEMPLATES}/config.guess $${_D}/config.guess; \
  3040. ${CHMOD} a+rx $${_D}/config.guess; \
  3041. ${RM} $${_D}/config.sub; \
  3042. ${CP} ${TEMPLATES}/config.sub $${_D}/config.sub; \
  3043. ${CHMOD} a+rx $${_D}/config.sub; \
  3044. done
  3045. . endif
  3046. . if defined(HAS_CONFIGURE)
  3047. @${MKDIR} ${CONFIGURE_WRKSRC}
  3048. @(cd ${CONFIGURE_WRKSRC} && \
  3049. ${SET_LATE_CONFIGURE_ARGS} \
  3050. if ! ${SETENVI} ${WRK_ENV} CC="${CC}" CPP="${CPP}" CXX="${CXX}" \
  3051. CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS}" \
  3052. LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" \
  3053. INSTALL="/usr/bin/install -c" \
  3054. INSTALL_DATA="${INSTALL_DATA}" \
  3055. INSTALL_LIB="${INSTALL_LIB}" \
  3056. INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
  3057. INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
  3058. ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS}; then \
  3059. ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
  3060. (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT_80} ; \
  3061. ${FALSE}; \
  3062. fi)
  3063. . endif
  3064. . endif
  3065. # Build
  3066. DO_MAKE_BUILD?= ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
  3067. ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS:N${DESTDIRNAME}=*}
  3068. . if !target(do-build)
  3069. do-build:
  3070. @(cd ${BUILD_WRKSRC}; if ! ${DO_MAKE_BUILD} ${ALL_TARGET}; then \
  3071. if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
  3072. ${ECHO_MSG} "===> Compilation failed unexpectedly."; \
  3073. (${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT_80} ; \
  3074. fi; \
  3075. ${FALSE}; \
  3076. fi)
  3077. . endif
  3078. # Check conflicts
  3079. . if !target(check-conflicts)
  3080. check-conflicts: check-build-conflicts check-install-conflicts
  3081. . endif
  3082. . if !target(check-build-conflicts)
  3083. check-build-conflicts:
  3084. . if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
  3085. @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; ) ; \
  3086. if [ -n "$${conflicts_with}" ]; then \
  3087. ${ECHO_MSG}; \
  3088. ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
  3089. for entry in $${conflicts_with}; do \
  3090. ${ECHO_MSG} " $${entry}"; \
  3091. done; \
  3092. ${ECHO_MSG}; \
  3093. ${ECHO_MSG} " They will not build together."; \
  3094. ${ECHO_MSG} " Please remove them first with pkg delete."; \
  3095. exit 1;\
  3096. fi
  3097. . endif
  3098. . endif
  3099. . if !target(identify-install-conflicts)
  3100. CONFLICT_WARNING_WAIT?= 10
  3101. identify-install-conflicts:
  3102. . if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
  3103. @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; ) ; \
  3104. if [ -n "$${conflicts_with}" ]; then \
  3105. ${ECHO_MSG}; \
  3106. ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
  3107. for entry in $${conflicts_with}; do \
  3108. ${ECHO_MSG} " $${entry}"; \
  3109. done; \
  3110. ${ECHO_MSG}; \
  3111. ${ECHO_MSG} " They install files into the same place."; \
  3112. ${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
  3113. sleep ${CONFLICT_WARNING_WAIT}; \
  3114. fi
  3115. . endif
  3116. . endif
  3117. . if !target(check-install-conflicts)
  3118. check-install-conflicts:
  3119. . if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
  3120. . if defined(DEFER_CONFLICTS_CHECK)
  3121. @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; ) ; \
  3122. if [ -n "$${conflicts_with}" ]; then \
  3123. ${ECHO_MSG}; \
  3124. ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
  3125. for entry in $${conflicts_with}; do \
  3126. ${ECHO_MSG} " $${entry}"; \
  3127. done; \
  3128. ${ECHO_MSG}; \
  3129. ${ECHO_MSG} " Please remove them first with pkg delete."; \
  3130. exit 1; \
  3131. fi
  3132. . else
  3133. @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; ) ; \
  3134. if [ -n "$${conflicts_with}" ]; then \
  3135. ${ECHO_MSG}; \
  3136. ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
  3137. for entry in $${conflicts_with}; do \
  3138. ${ECHO_MSG} " $${entry}"; \
  3139. done; \
  3140. ${ECHO_MSG}; \
  3141. ${ECHO_MSG} " They install files into the same place."; \
  3142. ${ECHO_MSG} " Please remove them first with pkg delete."; \
  3143. exit 1; \
  3144. fi
  3145. . endif # defined(DEFER_CONFLICTS_CHECK)
  3146. . endif
  3147. . endif
  3148. # Install
  3149. . if !target(do-install) && !defined(NO_INSTALL)
  3150. do-install:
  3151. @(cd ${INSTALL_WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${FAKEROOT} \
  3152. ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
  3153. . endif
  3154. # Test
  3155. . if !target(do-test) && defined(TEST_TARGET)
  3156. DO_MAKE_TEST?= ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
  3157. ${MAKEFILE} ${TEST_ARGS:N${DESTDIRNAME}=*}
  3158. do-test:
  3159. @(cd ${TEST_WRKSRC}; if ! ${DO_MAKE_TEST} ${TEST_TARGET}; then \
  3160. if [ -n "${TEST_FAIL_MESSAGE}" ] ; then \
  3161. ${ECHO_MSG} "===> Tests failed unexpectedly."; \
  3162. (${ECHO_CMD} "${TEST_FAIL_MESSAGE}") | ${FMT_80} ; \
  3163. fi; \
  3164. ${FALSE}; \
  3165. fi)
  3166. . endif
  3167. # Package
  3168. . if defined(_HAVE_PACKAGES)
  3169. _EXTRA_PACKAGE_TARGET_DEP+= ${PKGFILE}
  3170. _PORTS_DIRECTORIES+= ${PKGREPOSITORY}
  3171. . if ${PKGORIGIN} == "ports-mgmt/pkg" || ${PKGORIGIN} == "ports-mgmt/pkg-devel"
  3172. _EXTRA_PACKAGE_TARGET_DEP+= ${PKGLATESTREPOSITORY}
  3173. _PORTS_DIRECTORIES+= ${PKGLATESTREPOSITORY}
  3174. _EXTRA_PACKAGE_TARGET_DEP+= ${PKGLATESTFILE}
  3175. ${PKGLATESTFILE}: ${PKGFILE} ${PKGLATESTREPOSITORY}
  3176. ${INSTALL} -l rs ${PKGFILE} ${PKGLATESTFILE}
  3177. . if !defined(_PKG_TRANSITIONING_TO_NEW_EXT) && ${PKG_COMPRESSION_FORMAT} == txz
  3178. _EXTRA_PACKAGE_TARGET_DEP+= ${PKGOLDLATESTFILE} ${PKGOLDSIGFILE}
  3179. ${PKGOLDLATESTFILE}: ${PKGFILE} ${PKGLATESTREPOSITORY}
  3180. ${INSTALL} -l rs ${PKGFILE} ${PKGOLDLATESTFILE}
  3181. # Temporary workaround to be deleted once every supported version of FreeBSD
  3182. # have a bootstrap which handles the pkg extension.
  3183. ${PKGOLDSIGFILE}: ${PKGLATESTREPOSITORY}
  3184. ${INSTALL} -l rs pkg.pkg.sig ${PKGOLDSIGFILE}
  3185. . endif
  3186. . endif
  3187. . endif
  3188. # from here this will become a loop for subpackages
  3189. . for sp in ${_PKGS}
  3190. ${_PLIST}.${sp}: ${TMPPLIST}
  3191. @if [ "${PKGBASE}" = "${sp}" ]; then \
  3192. ${SED} "/^@comment /d; /@@/d" ${TMPPLIST} > ${.TARGET} ; \
  3193. else \
  3194. ${SED} -n "s/@@${sp:S/${PKGBASE}-//}@@//p" ${TMPPLIST} > ${.TARGET} ; \
  3195. fi
  3196. ${WRKDIR_PKGFILE${_SP.${sp}}}: ${_PLIST}.${sp} create-manifest ${WRKDIR}/pkg
  3197. @echo "===> Building ${PKGNAME${_SP.${sp}}}"
  3198. @if ! ${SETENV} ${PKG_ENV} ${PKG_CREATE} ${PKG_CREATE_ARGS} -m ${METADIR}.${sp} -p ${_PLIST}.${sp} -o ${WRKDIR}/pkg ${PKGNAME}; then \
  3199. cd ${.CURDIR} && eval ${MAKE} delete-package >/dev/null; \
  3200. exit 1; \
  3201. fi
  3202. _EXTRA_PACKAGE_TARGET_DEP+= ${WRKDIR_PKGFILE${_SP.${sp}}}
  3203. . if defined(_HAVE_PACKAGES)
  3204. ${PKGFILE${_SP.${sp}}}: ${WRKDIR_PKGFILE${_SP.${sp}}}
  3205. @${LN} -f ${WRKDIR_PKGFILE${_SP.${sp}}} ${PKGFILE${_SP.${sp}}} 2>/dev/null \
  3206. || ${CP} -f ${WRKDIR_PKGFILE${_SP.${sp}}} ${PKGFILE${_SP.${sp}}}
  3207. _EXTRA_PACKAGE_TARGET_DEP+= ${PKGFILE${_SP.${sp}}}
  3208. . endif
  3209. . endfor
  3210. # This will be the end of the loop
  3211. . if !target(do-package)
  3212. PKG_CREATE_ARGS+= -f ${PKG_COMPRESSION_FORMAT}
  3213. . if defined(PKG_COMPRESSION_LEVEL)
  3214. PKG_CREATE_ARGS+= -l ${PKG_COMPRESSION_LEVEL}
  3215. . endif
  3216. PKG_CREATE_ARGS+= -r ${STAGEDIR}
  3217. . if defined(PKG_CREATE_VERBOSE)
  3218. PKG_CREATE_ARGS+= -v
  3219. . endif
  3220. do-package: ${_EXTRA_PACKAGE_TARGET_DEP} ${WRKDIR}/pkg
  3221. . endif
  3222. . if !target(delete-package)
  3223. delete-package:
  3224. . for sp in ${_PKGS}
  3225. @${ECHO_MSG} "===> Deleting package for ${sp}"
  3226. # When staging, the package may only be in the workdir if not root
  3227. @${RM} ${PKGFILE${_SP.${sp}}} ${WRKDIR_PKGFILE${_SP.${sp}}} 2>/dev/null || :
  3228. . endfor
  3229. . endif
  3230. . if !target(delete-package-list)
  3231. delete-package-list:
  3232. . for sp in ${_PKGS}
  3233. @${ECHO_CMD} "[ -f ${PKGFILE${_SP.${sp}}} ] && (${ECHO_CMD} deleting ${PKGFILE${_SP.${sp}}}; ${RM} ${PKGFILE${_SP.${sp}}})"
  3234. . endfor
  3235. . endif
  3236. # Used by scripts and users to install a package from local repository.
  3237. # Poudriere -i uses this, please keep.
  3238. . if !target(install-package)
  3239. . if defined(FORCE_PKG_REGISTER)
  3240. _INSTALL_PKG_ARGS= -f
  3241. . endif
  3242. . if defined(INSTALLS_DEPENDS)
  3243. _INSTALL_PKG_ARGS+= -A
  3244. . endif
  3245. . for sp in ${_PKGS}
  3246. install-package: install-package.${sp}
  3247. install-package.${sp}:
  3248. @if [ -f "${WRKDIR_PKGFILE${_SP.${sp}}}" ]; then \
  3249. _pkgfile="${WRKDIR_PKGFILE${_SP.${sp}}}"; \
  3250. else \
  3251. _pkgfile="${PKGFILE${_SP.${sp}}}"; \
  3252. fi; \
  3253. ${PKG_ADD} ${_INSTALL_PKG_ARGS} $${_pkgfile}
  3254. . endfor
  3255. . endif
  3256. # Utility targets follow
  3257. . if !target(check-already-installed)
  3258. . if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
  3259. check-already-installed:
  3260. @${ECHO_MSG} "===> Checking if ${PKGBASE} is already installed"; \
  3261. pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
  3262. if [ -n "$${pkgname}" ]; then \
  3263. v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
  3264. if [ "$${v}" = "<" ]; then \
  3265. ${ECHO_CMD} "===> An older version of ${PKGBASE} is already installed ($${pkgname})"; \
  3266. else \
  3267. ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
  3268. fi; \
  3269. ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
  3270. ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
  3271. ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGBASE}"; \
  3272. ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
  3273. ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
  3274. exit 1; \
  3275. fi
  3276. . endif
  3277. . endif
  3278. . if !target(check-umask)
  3279. check-umask:
  3280. @if [ `${SH} -c umask` != 0022 ]; then \
  3281. ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
  3282. ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
  3283. ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
  3284. fi
  3285. . endif
  3286. # Needed for poudriere wait for at least a year before removing
  3287. # XXX 2017-04-09
  3288. . if !target(install-mtree)
  3289. install-mtree:
  3290. . endif
  3291. . if !target(install-ldconfig-file)
  3292. install-ldconfig-file:
  3293. . if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
  3294. . if defined(USE_LDCONFIG)
  3295. . if !defined(USE_LINUX_PREFIX)
  3296. . if ${USE_LDCONFIG} != "${LOCALBASE}/lib" && !defined(INSTALL_AS_USER)
  3297. @${ECHO_MSG} "===> Installing ldconfig configuration file"
  3298. . if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
  3299. @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}
  3300. . endif
  3301. @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
  3302. > ${STAGEDIR}${LOCALBASE}/${LDCONFIG_DIR}/${PKGBASE}
  3303. @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG_DIR}/${PKGBASE} >> ${TMPPLIST}
  3304. . if ${PREFIX} != ${LOCALBASE}
  3305. @${ECHO_CMD} "@dir ${LOCALBASE}/${LDCONFIG_DIR}" >> ${TMPPLIST}
  3306. . endif
  3307. . endif
  3308. . endif
  3309. . endif
  3310. . if defined(USE_LDCONFIG32)
  3311. . if !defined(INSTALL_AS_USER)
  3312. @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
  3313. . if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
  3314. @${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}
  3315. . endif
  3316. @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
  3317. > ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}/${PKGBASE}
  3318. @${ECHO_CMD} ${LOCALBASE}/${LDCONFIG32_DIR}/${PKGBASE} >> ${TMPPLIST}
  3319. . if ${PREFIX} != ${LOCALBASE}
  3320. @${ECHO_CMD} "@dir ${LOCALBASE}/${LDCONFIG32_DIR}" >> ${TMPPLIST}
  3321. . endif
  3322. . endif
  3323. . endif
  3324. . endif
  3325. . endif
  3326. . if !defined(USE_LINUX_PREFIX)
  3327. . if !target(fixup-lib-pkgconfig)
  3328. fixup-lib-pkgconfig:
  3329. @if [ -d ${STAGEDIR}${PREFIX}/lib/pkgconfig ]; then \
  3330. if [ -z "$$(${FIND} ${STAGEDIR}${PREFIX}/lib/pkgconfig -maxdepth 0 -empty)" ]; then \
  3331. if [ -n "${DEVELOPER:Dyes}" ]; then \
  3332. ${ECHO_MSG} "===> File(s) found in lib/pkgconfig while correct path is libdata/pkgconfig"; \
  3333. ${ECHO_MSG} " Applying fix but consider using USES= pathfix or adjust install path"; \
  3334. fi; \
  3335. ${MKDIR} ${STAGEDIR}${PREFIX}/libdata/pkgconfig; \
  3336. ${MV} ${STAGEDIR}${PREFIX}/lib/pkgconfig/* ${STAGEDIR}${PREFIX}/libdata/pkgconfig; \
  3337. fi; \
  3338. ${RMDIR} ${STAGEDIR}${PREFIX}/lib/pkgconfig; \
  3339. fi
  3340. . endif
  3341. . endif
  3342. . if !target(create-users-groups)
  3343. . if defined(GROUPS) || defined(USERS)
  3344. _UG_INSTALL= ${WRKDIR}/users-groups-install.sh
  3345. _UG_DEINSTALL= ${WRKDIR}/users-groups-deinstall.sh
  3346. PKGPREINSTALL+= ${_UG_INSTALL}
  3347. PKGPOSTDEINSTALL+= ${_UG_DEINSTALL}
  3348. create-users-groups:
  3349. @${SETENV} \
  3350. dp_ECHO_MSG="${ECHO_MSG}" \
  3351. dp_GID_FILES="${GID_FILES}" \
  3352. dp_GID_OFFSET="${GID_OFFSET}" \
  3353. dp_GROUPS_BLACKLIST="${GROUPS_BLACKLIST}" \
  3354. dp_INSTALL="${INSTALL}" \
  3355. dp_OPSYS="${OPSYS}" \
  3356. dp_OSVERSION="${OSVERSION}" \
  3357. dp_PREFIX="${PREFIX}" \
  3358. dp_PW="${PW}" \
  3359. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  3360. dp_UG_DEINSTALL="${_UG_DEINSTALL}" \
  3361. dp_UG_INSTALL="${_UG_INSTALL}" \
  3362. dp_UID_FILES="${UID_FILES}" \
  3363. dp_UID_OFFSET="${UID_OFFSET}" \
  3364. dp_USERS_BLACKLIST="${USERS_BLACKLIST}" \
  3365. ${SH} ${SCRIPTSDIR}/do-users-groups.sh "${USERS}" "${GROUPS}"
  3366. . endif
  3367. . endif
  3368. _WWW= ${WWW:[1]}
  3369. . if !defined(DISABLE_SECURITY_CHECK)
  3370. . if !target(security-check)
  3371. security-check: ${TMPPLIST}
  3372. # Scan PLIST for:
  3373. # 1. setugid files
  3374. # 2. accept()/recvfrom() which indicates network listening capability
  3375. # 3. insecure functions (gets/mktemp/tempnam/[XXX])
  3376. # 4. startup scripts, in conjunction with 2.
  3377. # 5. world-writable files/dirs
  3378. #
  3379. # The ${NONEXISTENT} argument of ${READELF} is there so that there are always
  3380. # at least two file arguments, and forces it to always output the "File: foo"
  3381. # header lines.
  3382. #
  3383. -@${RM} ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.readelf; \
  3384. ${AWK} -v prefix='${PREFIX}' ' \
  3385. match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
  3386. /^@/ { next; } \
  3387. /^\// { print; next; } \
  3388. { print prefix "/" $$0; } \
  3389. ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
  3390. ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
  3391. | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) 2> /dev/null > ${WRKDIR}/.PLIST.setuid; \
  3392. ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
  3393. | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
  3394. ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
  3395. | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
  3396. | ${XARGS} -0 ${READELF} -r ${NONEXISTENT} 2> /dev/null > ${WRKDIR}/.PLIST.readelf; \
  3397. if \
  3398. ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \
  3399. ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.readelf ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
  3400. then \
  3401. if [ ! -z "${_WWW}" ]; then \
  3402. ${ECHO_MSG}; \
  3403. ${ECHO_MSG} " For more information, and contact details about the security"; \
  3404. ${ECHO_MSG} " status of this software, see the following webpage: "; \
  3405. ${ECHO_MSG} "${_WWW}"; \
  3406. fi; \
  3407. fi
  3408. . endif
  3409. . else # i.e. defined(DISABLE_SECURITY_CHECK)
  3410. security-check:
  3411. @${ECHO_MSG} " WARNING: Security check has been disabled."
  3412. . endif # !defined(DISABLE_SECURITY_CHECK)
  3413. ################################################################
  3414. # Skeleton targets start here
  3415. #
  3416. # You shouldn't have to change these. Either add the pre-* or
  3417. # post-* targets/scripts or redefine the do-* targets. These
  3418. # targets don't do anything other than checking for cookies and
  3419. # call the necessary targets/scripts.
  3420. ################################################################
  3421. extract-message:
  3422. @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
  3423. patch-message:
  3424. @${ECHO_MSG} "===> Patching for ${PKGNAME}"
  3425. configure-message:
  3426. @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
  3427. build-message:
  3428. @${ECHO_MSG} "===> Building for ${PKGNAME}"
  3429. stage-message:
  3430. @${ECHO_MSG} "===> Staging for ${PKGNAME}"
  3431. install-message:
  3432. @${ECHO_MSG} "===> Installing for ${PKGNAME}"
  3433. test-message:
  3434. @${ECHO_MSG} "===> Testing for ${PKGNAME}"
  3435. package-message:
  3436. @${ECHO_MSG} "===> Building packages for ${PKGNAME}"
  3437. # Empty pre-* and post-* targets
  3438. . if exists(${SCRIPTDIR})
  3439. . for stage in pre post
  3440. . for name in pkg check-sanity fetch extract patch configure build stage install package
  3441. . if !target(${stage}-${name}-script)
  3442. . if exists(${SCRIPTDIR}/${stage}-${name})
  3443. ${stage}-${name}-script:
  3444. @ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
  3445. ${SCRIPTDIR}/${.TARGET:S/-script$//}
  3446. . endif
  3447. . endif
  3448. . endfor
  3449. . endfor
  3450. . endif
  3451. . if !target(pretty-print-www-site)
  3452. pretty-print-www-site:
  3453. @if [ -n "${_WWW}" ]; then \
  3454. ${ECHO_MSG} -n " and/or visit the "; \
  3455. ${ECHO_MSG} -n "<a href=\"${_WWW}\">web site</a>"; \
  3456. ${ECHO_MSG} " for further information"; \
  3457. fi
  3458. . endif
  3459. ################################################################
  3460. # Some more targets supplied for users' convenience
  3461. ################################################################
  3462. # Checkpatch
  3463. #
  3464. # Special target to verify patches
  3465. . if !target(checkpatch)
  3466. checkpatch:
  3467. @cd ${.CURDIR} && ${MAKE} ${PATCH_SILENT} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_REAL_SEQ}
  3468. . endif
  3469. # Reinstall
  3470. #
  3471. # Special target to re-run install
  3472. . if !target(reinstall)
  3473. reinstall:
  3474. @${RM} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
  3475. @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} deinstall install
  3476. . endif
  3477. . if !target(restage)
  3478. restage:
  3479. @${RM} -r ${STAGEDIR} ${STAGE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
  3480. @cd ${.CURDIR} && ${MAKE} stage
  3481. . endif
  3482. # Deinstall
  3483. #
  3484. # Special target to remove installation
  3485. . if !target(deinstall)
  3486. deinstall:
  3487. . if defined(UID) && ${UID} != 0 && !defined(INSTALL_AS_USER)
  3488. @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
  3489. @cd ${.CURDIR} && \
  3490. ${SU_CMD} "${MAKE} ${.TARGET}"
  3491. @${ECHO_MSG} "===> Returning to user credentials"
  3492. . else
  3493. . for _sp in ${_PKGS}
  3494. @${ECHO_MSG} "===> Deinstalling for ${_sp}"
  3495. @if ${PKG_INFO} -e ${_sp}; then \
  3496. p=`${PKG_INFO} -q -O ${_sp}`; \
  3497. ${ECHO_MSG} "===> Deinstalling $${p}"; \
  3498. ${PKG_DELETE} -f ${_sp} ; \
  3499. else \
  3500. ${ECHO_MSG} "===> ${_sp} not installed, skipping"; \
  3501. fi
  3502. . endfor
  3503. @${RM} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
  3504. . endif
  3505. . endif
  3506. # Deinstall-all
  3507. #
  3508. # Special target to remove installation of all ports of the same origin
  3509. . if !target(deinstall-all)
  3510. deinstall-all:
  3511. . if ${UID} != 0 && !defined(INSTALL_AS_USER)
  3512. @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
  3513. @cd ${.CURDIR} && \
  3514. ${SU_CMD} "${MAKE} ${.TARGET}"
  3515. @${ECHO_MSG} "===> Returning to user credentials"
  3516. . else
  3517. @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
  3518. @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
  3519. for oldpkgorigin in $$(${GREP} "|${PKGORIGIN}|" ${PORTSDIR}/MOVED | ${CUT} -f 1 -d '|' | ${SORT} -u); do \
  3520. deinstall_names="$${deinstall_names} $$(${PKG_INFO} -q -O $${oldpkgorigin})"; \
  3521. done; \
  3522. if [ -n "$${deinstall_names}" ]; then \
  3523. for d in $${deinstall_names}; do \
  3524. ${ECHO_MSG} "===> Deinstalling $${d}"; \
  3525. ${PKG_DELETE} -f $${d}; \
  3526. done; \
  3527. else \
  3528. ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
  3529. fi; \
  3530. ${RM} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
  3531. . endif
  3532. . endif
  3533. # Cleaning up
  3534. . if !target(do-clean)
  3535. do-clean:
  3536. @if [ -d ${WRKDIR} ]; then \
  3537. if [ -w ${WRKDIR} ]; then \
  3538. ${RM} -r ${WRKDIR}; \
  3539. else \
  3540. ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
  3541. fi; \
  3542. fi
  3543. . endif
  3544. . if !target(clean)
  3545. pre-clean: clean-msg
  3546. clean-msg:
  3547. @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
  3548. . if empty(FLAVORS)
  3549. CLEAN_DEPENDENCIES=
  3550. . if !defined(NOCLEANDEPENDS)
  3551. CLEAN_DEPENDENCIES+= limited-clean-depends-noflavor
  3552. limited-clean-depends-noflavor:
  3553. @cd ${.CURDIR} && ${MAKE} limited-clean-depends
  3554. . endif
  3555. . if target(pre-clean)
  3556. CLEAN_DEPENDENCIES+= pre-clean-noflavor
  3557. pre-clean-noflavor:
  3558. @cd ${.CURDIR} && ${SETENV} ${MAKE} pre-clean
  3559. . endif
  3560. CLEAN_DEPENDENCIES+= do-clean-noflavor
  3561. do-clean-noflavor:
  3562. @cd ${.CURDIR} && ${SETENV} ${MAKE} do-clean
  3563. . if target(post-clean)
  3564. CLEAN_DEPENDENCIES+= post-clean-noflavor
  3565. post-clean-noflavor:
  3566. @cd ${.CURDIR} && ${SETENV} ${MAKE} post-clean
  3567. . endif
  3568. .ORDER: ${CLEAN_DEPENDENCIES}
  3569. clean: ${CLEAN_DEPENDENCIES}
  3570. . endif
  3571. . if !empty(_FLAVOR)
  3572. _CLEANFLAVORS= ${_FLAVOR}
  3573. . else
  3574. _CLEANFLAVORS= ${FLAVORS}
  3575. . endif
  3576. . for _f in ${_CLEANFLAVORS}
  3577. CLEAN_DEPENDENCIES=
  3578. . if !defined(NOCLEANDEPENDS)
  3579. CLEAN_DEPENDENCIES+= limited-clean-depends-${_f}
  3580. limited-clean-depends-${_f}:
  3581. @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} limited-clean-depends
  3582. . endif
  3583. . if target(pre-clean)
  3584. CLEAN_DEPENDENCIES+= pre-clean-${_f}
  3585. pre-clean-${_f}:
  3586. @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} pre-clean
  3587. . endif
  3588. CLEAN_DEPENDENCIES+= do-clean-${_f}
  3589. do-clean-${_f}:
  3590. @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} do-clean
  3591. . if target(post-clean)
  3592. CLEAN_DEPENDENCIES+= post-clean-${_f}
  3593. post-clean-${_f}:
  3594. @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} post-clean
  3595. . endif
  3596. .ORDER: ${CLEAN_DEPENDENCIES}
  3597. clean: ${CLEAN_DEPENDENCIES}
  3598. . endfor
  3599. . endif
  3600. . if !target(distclean)
  3601. distclean: clean
  3602. @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES:Q} ${_PATCHFILES:Q}"
  3603. . endif
  3604. . if !target(delete-distfiles)
  3605. delete-distfiles:
  3606. @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
  3607. @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
  3608. cd ${_DISTDIR}; \
  3609. for file in ${RESTRICTED_FILES}; do \
  3610. ${RM} $${file}; \
  3611. dir=$${file%/*}; \
  3612. if [ "$${dir}" != "$${file}" ]; then \
  3613. ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
  3614. fi; \
  3615. done; \
  3616. fi)
  3617. . if defined(DIST_SUBDIR)
  3618. -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
  3619. . endif
  3620. . endif
  3621. . if !target(delete-distfiles-list)
  3622. delete-distfiles-list:
  3623. @${ECHO_CMD} "# ${PKGNAME}"
  3624. @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
  3625. for file in ${RESTRICTED_FILES}; do \
  3626. ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} ${_DISTDIR}/$$file)"; \
  3627. dir=$${file%/*}; \
  3628. if [ "$${dir}" != "$${file}" ]; then \
  3629. ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
  3630. fi; \
  3631. done; \
  3632. fi
  3633. . if defined(DIST_SUBDIR)
  3634. @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
  3635. . endif
  3636. . endif
  3637. # Checksumming utilities
  3638. # List all algorithms here, all the variables name must begin with dp_
  3639. _CHECKSUM_INIT_ENV= \
  3640. dp_SHA256=${SHA256}
  3641. . if !target(makesum)
  3642. # Some port change the options with OPTIONS_*_FORCE when make(makesum) to be
  3643. # able to add all distfiles in one go.
  3644. # For this to work, we need to call the do-fetch script directly here so that
  3645. # the options consistent when fetching and when makesum'ing.
  3646. # As we're fetching new distfiles, that are not in the distinfo file, disable
  3647. # checksum and sizes checks.
  3648. makesum: check-sanity
  3649. @cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \
  3650. DISABLE_SIZE=yes DISTFILES="${DISTFILES}" \
  3651. MASTER_SITES="${MASTER_SITES}" \
  3652. MASTER_SITE_SUBDIR="${MASTER_SITE_SUBDIR}" \
  3653. PATCH_SITES="${PATCH_SITES}"
  3654. @${SETENV} \
  3655. ${_CHECKSUM_INIT_ENV} \
  3656. dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \
  3657. dp_CKSUMFILES='${_CKSUMFILES}' \
  3658. dp_DISTDIR='${DISTDIR}' \
  3659. dp_DISTINFO_FILE='${DISTINFO_FILE}' \
  3660. dp_ECHO_MSG='${ECHO_MSG}' \
  3661. dp_SCRIPTSDIR='${SCRIPTSDIR}' \
  3662. ${SH} ${SCRIPTSDIR}/makesum.sh ${DISTFILES:C/.*/'&'/}
  3663. . endif
  3664. . if !target(checksum)
  3665. checksum: fetch
  3666. . if !empty(_CKSUMFILES) && !defined(NO_CHECKSUM)
  3667. @${SETENV} \
  3668. ${_CHECKSUM_INIT_ENV} \
  3669. dp_CHECKSUM_ALGORITHMS='${CHECKSUM_ALGORITHMS:tu}' \
  3670. dp_CURDIR='${.CURDIR}' \
  3671. dp_DISTDIR='${DISTDIR}' \
  3672. dp_DISTINFO_FILE='${DISTINFO_FILE}' \
  3673. dp_DIST_SUBDIR='${DIST_SUBDIR}' \
  3674. dp_ECHO_MSG='${ECHO_MSG}' \
  3675. dp_FETCH_REGET='${FETCH_REGET}' \
  3676. dp_MAKE='${MAKE}' \
  3677. dp_MAKEFLAGS='${.MAKEFLAGS}' \
  3678. dp_SCRIPTSDIR='${SCRIPTSDIR}' \
  3679. dp_DISABLE_SIZE='${DISABLE_SIZE}' \
  3680. dp_NO_CHECKSUM='${NO_CHECKSUM}' \
  3681. ${SH} ${SCRIPTSDIR}/checksum.sh ${_CKSUMFILES:C/.*/'&'/}
  3682. . endif
  3683. . endif
  3684. # Some port's archives contains files modes that are a bit too restrictive for
  3685. # some usage. For example:
  3686. # BUILD_DEPENDS= ${NONEXISTENT}:foo/bar:configure
  3687. # When building as a regular user, dependencies are installed/built as root, so
  3688. # if the archive contains files that have a mode of, say, 600, they will not be
  3689. # readable by the port requesting the dependency.
  3690. # This will also fix broken distribution files where directories don't have the
  3691. # executable bit on.
  3692. extract-fixup-modes:
  3693. @${CHMOD} -R u+w,a+rX ${WRKDIR}
  3694. ################################################################
  3695. # The special package-building targets
  3696. # You probably won't need to touch these
  3697. ################################################################
  3698. # Nobody should want to override this unless PKGNAME is simply bogus.
  3699. . if !target(package-name)
  3700. package-name:
  3701. @${ECHO_CMD} ${PKGNAME}
  3702. . endif
  3703. # Build a package but don't check the package cookie
  3704. . if !target(repackage)
  3705. repackage: pre-repackage package
  3706. pre-repackage:
  3707. @${RM} ${PACKAGE_COOKIE} ${TMPPLIST}*
  3708. . endif
  3709. # Build a package but don't check the cookie for installation, also don't
  3710. # install package cookie
  3711. . if !target(package-noinstall)
  3712. package-noinstall: package
  3713. . endif
  3714. ################################################################
  3715. # Dependency checking
  3716. ################################################################
  3717. . if !target(depends)
  3718. depends: pkg-depends extract-depends patch-depends lib-depends fetch-depends build-depends run-depends
  3719. . for deptype in PKG EXTRACT PATCH FETCH BUILD LIB RUN TEST
  3720. . for sp in ${_PKGS}
  3721. ${deptype}_DEPENDS_ALL+= ${${deptype}_DEPENDS${_SP.${sp}}}
  3722. . endfor
  3723. ${deptype:tl}-depends:
  3724. . if !empty(${deptype}_DEPENDS_ALL) && !defined(NO_DEPENDS)
  3725. @${SETENV} \
  3726. dp_RAWDEPENDS="${${deptype}_DEPENDS_ALL}" \
  3727. dp_DEPTYPE="${deptype}_DEPENDS" \
  3728. dp_DEPENDS_TARGET="${DEPENDS_TARGET}" \
  3729. dp_DEPENDS_PRECLEAN="${DEPENDS_PRECLEAN}" \
  3730. dp_DEPENDS_CLEAN="${DEPENDS_CLEAN}" \
  3731. dp_DEPENDS_ARGS="${DEPENDS_ARGS}" \
  3732. dp_USE_PACKAGE_DEPENDS="${USE_PACKAGE_DEPENDS}" \
  3733. dp_USE_PACKAGE_DEPENDS_ONLY="${USE_PACKAGE_DEPENDS_ONLY}" \
  3734. dp_PKG_ADD="${PKG_ADD}" \
  3735. dp_PKG_INFO="${PKG_INFO}" \
  3736. dp_WRKDIR="${WRKDIR}" \
  3737. dp_PKGNAME="${PKGNAME}" \
  3738. dp_STRICT_DEPENDS="${STRICT_DEPENDS}" \
  3739. dp_LOCALBASE="${LOCALBASE}" \
  3740. dp_LIB_DIRS="${LIB_DIRS}" \
  3741. dp_SH="${SH}" \
  3742. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  3743. PORTSDIR="${PORTSDIR}" \
  3744. dp_OVERLAYS="${OVERLAYS}" \
  3745. dp_MAKE="${MAKE}" \
  3746. dp_MAKEFLAGS='${.MAKEFLAGS}' \
  3747. ${SH} ${SCRIPTSDIR}/do-depends.sh
  3748. . endif
  3749. . endfor
  3750. . endif
  3751. # Dependency lists: both build and runtime, recursive. Print out directory names.
  3752. _UNIFIED_DEPENDS=${PKG_DEPENDS_ALL} ${EXTRACT_DEPENDS_ALL} ${PATCH_DEPENDS_ALL} ${FETCH_DEPENDS_ALL} ${BUILD_DEPENDS_ALL} ${LIB_DEPENDS_ALL} ${RUN_DEPENDS_ALL} ${TEST_DEPENDS_ALL}
  3753. _DEPEND_SPECIALS= ${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
  3754. . for d in ${_UNIFIED_DEPENDS:M*\:/*}
  3755. _PORTSDIR_STR= $${PORTSDIR}/
  3756. DEV_WARNING+= "It looks like the ${d} depends line has an absolute port origin, make sure to remove \$${_PORTSDIR_STR} from it."
  3757. . endfor
  3758. all-depends-list:
  3759. @${ALL-DEPENDS-LIST}
  3760. _FLAVOR_RECURSIVE_SH= \
  3761. if [ -z "$${recursive_cmd}" ]; then \
  3762. ${ECHO_MSG} "_FLAVOR_RECURSIVE_SH requires recursive_cmd to be set to the recursive make target to run." >&2; \
  3763. ${FALSE}; \
  3764. fi; \
  3765. if [ "$${recursive_dirs-null}" = "null" ]; then \
  3766. ${ECHO_MSG} "_FLAVOR_RECURSIVE_SH requires recursive_dirs to be set to the directories to recurse." >&2; \
  3767. ${FALSE}; \
  3768. fi; \
  3769. for dir in $${recursive_dirs}; do \
  3770. unset flavor FLAVOR; \
  3771. case $${dir} in \
  3772. *@*/*) ;; \
  3773. *@*) \
  3774. flavor=$${dir\#*@}; \
  3775. dir=$${dir%@*}; \
  3776. ;; \
  3777. esac; \
  3778. case $$dir in \
  3779. /*) ;; \
  3780. *) dir=${PORTSDIR}/$$dir ;; \
  3781. esac; \
  3782. (cd $$dir; ${SETENV} $${flavor:+FLAVOR=$${flavor}} ${MAKE} $${recursive_cmd}); \
  3783. done
  3784. # This script is shared among several dependency list variables. See file for
  3785. # usage.
  3786. DEPENDS-LIST= \
  3787. ${SETENV} \
  3788. PORTSDIR="${PORTSDIR}" \
  3789. dp_MAKE="${MAKE}" \
  3790. dp_PKGNAME="${PKGNAME}" \
  3791. dp_PKG_INFO="${PKG_INFO}" \
  3792. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  3793. dp_OVERLAYS="${OVERLAYS}" \
  3794. ${SH} ${SCRIPTSDIR}/depends-list.sh \
  3795. ${DEPENDS_SHOW_FLAVOR:D-f}
  3796. ALL-DEPENDS-LIST= ${DEPENDS-LIST} -r ${_UNIFIED_DEPENDS:Q}
  3797. ALL-DEPENDS-FLAVORS-LIST= ${DEPENDS-LIST} -f -r ${_UNIFIED_DEPENDS:Q}
  3798. DEINSTALL-DEPENDS-FLAVORS-LIST= ${DEPENDS-LIST} -f -r ${_UNIFIED_DEPENDS:N${PKG_DEPENDS}:Q}
  3799. MISSING-DEPENDS-LIST= ${DEPENDS-LIST} -m ${_UNIFIED_DEPENDS:Q}
  3800. BUILD-DEPENDS-LIST= ${DEPENDS-LIST} "${PKG_DEPENDS_ALL} ${EXTRACT_DEPENDS_ALL} ${PATCH_DEPENDS_ALL} ${FETCH_DEPENDS_ALL} ${BUILD_DEPENDS_ALL} ${LIB_DEPENDS_ALL}"
  3801. RUN-DEPENDS-LIST= ${DEPENDS-LIST} "${LIB_DEPENDS_ALL} ${RUN_DEPENDS_ALL}"
  3802. TEST-DEPENDS-LIST= ${DEPENDS-LIST} ${TEST_DEPENDS_ALL:Q}
  3803. CLEAN-DEPENDS-LIST= ${DEPENDS-LIST} -wr ${_UNIFIED_DEPENDS:Q}
  3804. CLEAN-DEPENDS-LIMITED-LIST= ${DEPENDS-LIST} -w ${_UNIFIED_DEPENDS:Q}
  3805. . if !target(clean-depends)
  3806. clean-depends:
  3807. @for dir in $$(${CLEAN-DEPENDS-LIST}); do \
  3808. (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
  3809. done
  3810. . endif
  3811. . if !target(limited-clean-depends)
  3812. limited-clean-depends:
  3813. @for dir in $$(${CLEAN-DEPENDS-LIMITED-LIST}); do \
  3814. (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
  3815. done
  3816. . endif
  3817. . if !target(deinstall-depends)
  3818. deinstall-depends:
  3819. @recursive_cmd="deinstall"; \
  3820. recursive_dirs="$$(${DEINSTALL-DEPENDS-FLAVORS-LIST})"; \
  3821. ${_FLAVOR_RECURSIVE_SH}
  3822. . endif
  3823. . if !target(fetch-specials)
  3824. fetch-specials:
  3825. @${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
  3826. @recursive_cmd="fetch"; \
  3827. recursive_dirs="${_DEPEND_SPECIALS}"; \
  3828. ${_FLAVOR_RECURSIVE_SH}
  3829. . endif
  3830. . if !target(fetch-recursive)
  3831. fetch-recursive:
  3832. @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
  3833. @recursive_cmd="fetch"; \
  3834. recursive_dirs="${.CURDIR}${FLAVOR:D@${FLAVOR}} $$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  3835. ${_FLAVOR_RECURSIVE_SH}
  3836. . endif
  3837. . if !target(fetch-recursive-list)
  3838. fetch-recursive-list:
  3839. @recursive_cmd="fetch-list"; \
  3840. recursive_dirs="${.CURDIR}${FLAVOR:D@${FLAVOR}} $$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  3841. ${_FLAVOR_RECURSIVE_SH}
  3842. . endif
  3843. # Used by fetch-required and fetch-required list, this script looks
  3844. # at each of the dependencies. If 3 items are specified in the tuple,
  3845. # such as foo:graphics/foo:extract, the first item (foo)
  3846. # is examined. Only if it begins with a / and does not exist on the
  3847. # file-system will ``make targ'' proceed.
  3848. # For more usual (dual-item) dependency tuples, the ``make targ''
  3849. # proceeds, if the exact package, which the directory WOULD'VE installed,
  3850. # is not yet installed.
  3851. # This is the exact behaviour of the old code, and it may need
  3852. # revisiting. For example, the entire first case seems dubious, and in
  3853. # the second case we, probably, should be satisfied with _any_ (earlier)
  3854. # package, with the same origin as that of the dir.
  3855. #
  3856. # -mi
  3857. FETCH_LIST?= for i in $$deps; do \
  3858. prog=$${i%%:*}; dir=$${i\#*:}; \
  3859. case $$dir in \
  3860. /*) ;; \
  3861. *) dir=${PORTSDIR}/$$dir ;; \
  3862. esac; \
  3863. case $$dir in \
  3864. *:*) if [ $$prog != $${prog\#/} -o ! -e $$prog ]; then \
  3865. dir=$${dir%%:*}; \
  3866. else \
  3867. continue; \
  3868. fi;; \
  3869. *) if [ -d ${PKG_DBDIR}/$$(cd $$dir; ${MAKE} -V PKGNAME) ]; then \
  3870. continue; \
  3871. fi;; \
  3872. esac; \
  3873. echo cd $$dir; cd $$dir; ${MAKE} $$targ; \
  3874. done
  3875. . if !target(fetch-required)
  3876. fetch-required: fetch
  3877. . if defined(NO_DEPENDS)
  3878. @${ECHO_MSG} "===> NO_DEPENDS is set, not fetching any other distfiles for ${PKGNAME}"
  3879. . else
  3880. @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
  3881. . for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
  3882. . if defined(${deptype}_DEPENDS)
  3883. @targ=fetch; deps="${${deptype}_DEPENDS_ALL}"; ${FETCH_LIST}
  3884. . endif
  3885. . endfor
  3886. . endif
  3887. . endif
  3888. . if !target(fetch-required-list)
  3889. fetch-required-list: fetch-list
  3890. . if !defined(NO_DEPENDS)
  3891. . for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
  3892. . if defined(${deptype}_DEPENDS)
  3893. @targ=fetch-list; deps="${${deptype}_DEPENDS_ALL}"; ${FETCH_LIST}
  3894. . endif
  3895. . endfor
  3896. . endif
  3897. . endif
  3898. . if !target(checksum-recursive)
  3899. checksum-recursive:
  3900. @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
  3901. @recursive_cmd="checksum"; \
  3902. recursive_dirs="${.CURDIR}${FLAVOR:D@${FLAVOR}} $$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  3903. ${_FLAVOR_RECURSIVE_SH}
  3904. . endif
  3905. # Dependency lists: build and runtime. Print out directory names.
  3906. build-depends-list:
  3907. . if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
  3908. @${BUILD-DEPENDS-LIST}
  3909. . endif
  3910. run-depends-list:
  3911. . if defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
  3912. @${RUN-DEPENDS-LIST}
  3913. . endif
  3914. test-depends-list:
  3915. . if defined(TEST_DEPENDS)
  3916. @${TEST-DEPENDS-LIST}
  3917. . endif
  3918. # Package (recursive runtime) dependency list. Print out both directory names
  3919. # and package names.
  3920. package-depends-list:
  3921. . if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS)
  3922. @${PACKAGE-DEPENDS-LIST}
  3923. . endif
  3924. _LIB_RUN_DEPENDS= ${LIB_DEPENDS_ALL} ${RUN_DEPENDS_ALL}
  3925. PACKAGE-DEPENDS-LIST?= \
  3926. if [ "${CHILD_DEPENDS}" ]; then \
  3927. installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
  3928. ${TRUE}); \
  3929. if [ "$$installed" ]; then \
  3930. break; \
  3931. fi; \
  3932. if [ -z "$$installed" ]; then \
  3933. installed="${PKGNAME}"; \
  3934. fi; \
  3935. for pkgname in $$installed; do \
  3936. ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
  3937. done; \
  3938. fi; \
  3939. checked="${PARENT_CHECKED}"; \
  3940. for dir in ${_LIB_RUN_DEPENDS:C,[^:]*:([^:]*):?.*,\1,}; do \
  3941. unset flavor; \
  3942. case $${dir} in \
  3943. *~*) \
  3944. dir=$${dir%~*}; \
  3945. ;; \
  3946. esac; \
  3947. case $${dir} in \
  3948. *@*) \
  3949. flavor=$${dir\#*@}; \
  3950. dir=$${dir%@*}; \
  3951. ;; \
  3952. esac; \
  3953. case "$$dir" in \
  3954. /*) ;; \
  3955. *) dir=${PORTSDIR}/$$dir ;; \
  3956. esac ; \
  3957. dir=$$(${REALPATH} $$dir); \
  3958. if [ -d $$dir ]; then \
  3959. case $$checked in \
  3960. $$dir|$$dir\ *|*\ $$dir|*\ $$dir\ *) continue;; \
  3961. esac; \
  3962. childout=$$(cd $$dir; ${SETENV} FLAVOR=$${flavor} ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
  3963. set -- $$childout; \
  3964. childdir=""; \
  3965. while [ $$\# != 0 ]; do \
  3966. childdir="$$childdir $$2"; \
  3967. ${ECHO_CMD} "$$1 $$2 $$3"; \
  3968. shift 3; \
  3969. done; \
  3970. checked="$$dir $$childdir $$checked"; \
  3971. else \
  3972. ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
  3973. fi; \
  3974. done
  3975. # FIXME: SELF_DEPENDS can only be used to depend on sub packages whose
  3976. # package name has not been overrided by the framework, otherwize the
  3977. # assumption made below that the package name is "PKGBASE-$$self" is broken.
  3978. . for sp in ${_PKGS}
  3979. ACTUAL-PACKAGE-DEPENDS${_SP.${sp}}?= \
  3980. depfiles="" ; \
  3981. for lib in ${LIB_DEPENDS${_SP.${sp}}:C/\:.*//}; do \
  3982. depfiles="$$depfiles `${SETENV} LIB_DIRS="${LIB_DIRS}" LOCALBASE="${LOCALBASE}" ${SH} ${SCRIPTSDIR}/find-lib.sh $${lib}`" ; \
  3983. done ; \
  3984. for self in ${SELF_DEPENDS${_SP.${sp}}}; do \
  3985. if [ "$$self" = "main" ]; then \
  3986. printf "\"%s\": {origin: \"%s\", version: \"%s\"}\n" ${PKGBASE} ${PKGORIGIN} ${PKGVERSION}; \
  3987. else \
  3988. printf "\"%s-%s\": {origin: \"%s\", version: \"%s\"}\n" ${PKGBASE} $$self ${PKGORIGIN} ${PKGVERSION}; \
  3989. fi ; \
  3990. done ; \
  3991. ${SETENV} PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS${_SP.${sp}}:C/(.*)\:.*/"\1"/}
  3992. . endfor
  3993. PKG_NOTES_ENV?=
  3994. . for note in ${PKG_NOTES}
  3995. PKG_NOTES_ENV+= dp_PKG_NOTE_${note}=${PKG_NOTE_${note}:Q}
  3996. . endfor
  3997. . for sp in ${_PKGS}
  3998. PKG_NOTES.${sp}= ${PKG_NOTES}
  3999. PKG_NOTES_ENV.${sp}= ${PKG_NOTES_ENV}
  4000. . if ${sp} != ${PKGBASE}
  4001. PKG_NOTES.${sp}+= subpackage
  4002. PKG_NOTES_ENV.${sp}+= dp_PKG_NOTE_subpackage=${_SP.${sp}:S/^.//1}
  4003. . endif
  4004. create-manifest: create-manifest.${sp}
  4005. create-manifest.${sp}:
  4006. @${SETENV} \
  4007. dp_SCRIPTSDIR='${SCRIPTSDIR}' \
  4008. dp_ACTUAL_PACKAGE_DEPENDS='${ACTUAL-PACKAGE-DEPENDS${_SP.${sp}}}' \
  4009. dp_CATEGORIES='${CATEGORIES:u:S/$/,/}' \
  4010. dp_COMMENT=${COMMENT${_SP.${sp}}:Q} \
  4011. dp_COMPLETE_OPTIONS_LIST='${COMPLETE_OPTIONS_LIST}' \
  4012. dp_DEPRECATED=${DEPRECATED:Q} \
  4013. dp_DESCR='${DESCR${_SP.${sp}}}' \
  4014. dp_EXPIRATION_DATE='${EXPIRATION_DATE}' \
  4015. dp_GROUPS='${GROUPS:u:S/$/,/}' \
  4016. dp_LICENSE='${LICENSE:u:S/$/,/}' \
  4017. dp_LICENSE_COMB='${LICENSE_COMB}' \
  4018. dp_MAINTAINER='${MAINTAINER}' \
  4019. dp_METADIR='${METADIR}.${sp}' \
  4020. dp_NO_ARCH='${NO_ARCH}' \
  4021. dp_PKGBASE='${sp}' \
  4022. dp_PKGDEINSTALL='${PKGDEINSTALL${_SP.${sp}}}' \
  4023. dp_PKGINSTALL='${PKGINSTALL${_SP.${sp}}}' \
  4024. dp_PKGMESSAGES='${_PKGMESSAGES${_SP.${sp}}}' \
  4025. dp_PKGORIGIN='${PKGORIGIN}' \
  4026. dp_PKGPOSTDEINSTALL='${PKGPOSTDEINSTALL${_SP.${sp}}}' \
  4027. dp_PKGPOSTINSTALL='${PKGPOSTINSTALL${_SP.${sp}}}' \
  4028. dp_PKGPREDEINSTALL='${PKGPREDEINSTALL${_SP.${sp}}}' \
  4029. dp_PKGPREINSTALL='${PKGPREINSTALL${_SP.${sp}}}' \
  4030. dp_PKGVERSION='${PKGVERSION}' \
  4031. dp_PKG_BIN='${PKG_BIN}' \
  4032. dp_PKG_IGNORE_DEPENDS='${PKG_IGNORE_DEPENDS}' \
  4033. dp_PKG_NOTES='${PKG_NOTES.${sp}}' \
  4034. dp_PORT_OPTIONS='${PORT_OPTIONS}' \
  4035. dp_PREFIX='${PREFIX}' \
  4036. dp_USERS='${USERS:u:S/$/,/}' \
  4037. dp_WWW='${WWW}' \
  4038. ${PKG_NOTES_ENV.${sp}} \
  4039. ${SH} ${SCRIPTSDIR}/create-manifest.sh
  4040. . endfor
  4041. # Print out package names.
  4042. package-depends:
  4043. @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
  4044. . for sp in ${_PKGS}
  4045. actual-package-depends: actual-package-depends.${sp}
  4046. actual-package-depends.${sp}:
  4047. @${ACTUAL-PACKAGE-DEPENDS${_SP.${sp}}}
  4048. . endfor
  4049. # Build packages for port and dependencies
  4050. package-recursive: package
  4051. @recursive_cmd="package-noinstall"; \
  4052. recursive_dirs="$$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  4053. ${_FLAVOR_RECURSIVE_SH}
  4054. # Show missing dependencies
  4055. missing:
  4056. @for dir in $$(${MISSING-DEPENDS-LIST}); do \
  4057. echo $${dir#${PORTSDIR}/}; \
  4058. done
  4059. # Show missing dependencies by name
  4060. missing-packages:
  4061. @_packages=$$(${PKG_INFO} -aq); \
  4062. for dir in $$(${ALL-DEPENDS-LIST}); do \
  4063. _p=$$(cd $$dir; ${MAKE} -VPKGNAME); \
  4064. if ! $$(${ECHO_CMD} $${_packages} | ${GREP} -q $${_p}); then \
  4065. ${ECHO_CMD} $${_p}; \
  4066. fi; \
  4067. done
  4068. # Install missing dependencies from package
  4069. install-missing-packages:
  4070. @_dirs=$$(${MISSING-DEPENDS-LIST}); \
  4071. ${ECHO_CMD} "$${_dirs}" | ${SED} "s%${PORTSDIR}/%%g" | \
  4072. ${SU_CMD} "${XARGS} -o ${PKG_BIN} install -A"
  4073. ################################################################
  4074. # Everything after here are internal targets and really
  4075. # shouldn't be touched by anybody but the release engineers.
  4076. ################################################################
  4077. # This target generates an index entry suitable for aggregation into
  4078. # a large index. Format is:
  4079. #
  4080. # distribution-name|port-path|installation-prefix|comment| \
  4081. # description-file|maintainer|categories|extract-depends| \
  4082. # patch-depends|fetch-depends|build-depends|run-depends|www site
  4083. #
  4084. # If this ever changes, portmgr should contact the portsnap maintainer
  4085. # first to avoid gratuitous breakage.
  4086. . if !target(describe)
  4087. _EXTRACT_DEPENDS=${EXTRACT_DEPENDS_ALL:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
  4088. _PATCH_DEPENDS=${PATCH_DEPENDS_ALL:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
  4089. _FETCH_DEPENDS=${FETCH_DEPENDS_ALL:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
  4090. _LIB_DEPENDS=${LIB_DEPENDS_ALL:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,}
  4091. _BUILD_DEPENDS=${BUILD_DEPENDS_ALL:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS}
  4092. _RUN_DEPENDS=${RUN_DEPENDS_ALL:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS}
  4093. . if exists(${DESCR})
  4094. _DESCR=${DESCR}
  4095. . else
  4096. _DESCR=/dev/null
  4097. . endif
  4098. . if defined(BUILDING_INDEX) && defined(INDEX_PORTS)
  4099. INDEX_OUT=${INDEX_TMPDIR}/${INDEXFILE}.desc.aggr
  4100. . else
  4101. INDEX_OUT=/dev/stdout
  4102. . endif
  4103. . if empty(FLAVORS) || defined(_DESCRIBE_WITH_FLAVOR)
  4104. describe:
  4105. @(${ECHO_CMD} "${PKGNAME}|${.CURDIR}|${PREFIX}|"${COMMENT:Q}"|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|${_WWW}" >> ${INDEX_OUT})
  4106. . else # empty(FLAVORS)
  4107. describe: ${FLAVORS:S/^/describe-/}
  4108. . for f in ${FLAVORS}
  4109. describe-${f}:
  4110. @cd ${.CURDIR} && ${SETENV} FLAVOR=${f} ${MAKE} -B -D_DESCRIBE_WITH_FLAVOR describe
  4111. . endfor
  4112. . endif # empty(FLAVORS)
  4113. . endif
  4114. . if empty(FLAVORS) || defined(_DESCRIBE_WITH_FLAVOR)
  4115. . if defined(_DESCRIBE_WITH_FLAVOR)
  4116. _JSON_OBJ_NAME="\"${FLAVOR}-${.CURDIR:T}\":"
  4117. . endif
  4118. describe-json:
  4119. @(${ECHO_CMD} "${_JSON_OBJ_NAME} { ";\
  4120. ${ECHO_CMD} \"uses\":[\"${USES:ts,:Q:S/,/\",\"/g}\"], ;\
  4121. ${ECHO_CMD} \"flavors\":[\"${FLAVORS:ts,:Q:S/,/\",\"/g}\"], ;\
  4122. ${ECHO_CMD} \"options_default\":[\"${OPTIONS_DEFAULT:ts,:Q:S/,/\",\"/g}\"], ;\
  4123. ${ECHO_CMD} \"fetch_depends\":[\"${FETCH_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4124. ${ECHO_CMD} \"extract_depends\":[\"${EXTRACT_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4125. ${ECHO_CMD} \"patch_depends\":[\"${PATCH_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4126. ${ECHO_CMD} \"build_depends\":[\"${BUILD_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4127. ${ECHO_CMD} \"lib_depends\":[\"${LIB_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4128. ${ECHO_CMD} \"run_depends\":[\"${RUN_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4129. ${ECHO_CMD} \"test_depends\":[\"${TEST_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4130. ${ECHO_CMD} \"pkg_depends\":[\"${PKG_DEPENDS:ts,:Q:S/,/\",\"/g}\"], ;\
  4131. ${ECHO_CMD} \"complete_options_list\":[\"${COMPLETE_OPTIONS_LIST:ts,:S/,/\",\"/g}\"], ;\
  4132. ${ECHO_CMD} \"categories\":[\"${CATEGORIES:ts,:S/,/\",\"/g}\"], ;\
  4133. ${ECHO_CMD} \"license\":[\"${LICENSE:ts,:S/,/\",\"/g}\"], ;\
  4134. ${ECHO_CMD} \"deprecated\":\""${DEPRECATED:S/"/\\\"/g:S/\\\\*/*/g:S/\\\'/'/g}" \", ;\
  4135. ${ECHO_CMD} \"broken\":\"${BROKEN:Q:S/"/\\\"/g:S/\\\\*/*/g:S/\\\'/'/g}\", ;\
  4136. ${ECHO_CMD} \"distversion\":\"${DISTVERSION}\", ;\
  4137. ${ECHO_CMD} \"distversionprefix\":\"${DISTVERSIONPREFIX}\", ;\
  4138. ${ECHO_CMD} \"distversionsuffix\":\"${DISTVERSIONSUFFIX}\", ;\
  4139. ${ECHO_CMD} \"expiration_date\":\"${EXPIRATION_DATE}\", ;\
  4140. ${ECHO_CMD} \"flavor\":\"${FLAVOR}\", ;\
  4141. ${ECHO_CMD} \"gh_account\":\"${GH_ACCOUNT}\", ;\
  4142. ${ECHO_CMD} \"gh_project\":\"${GH_PROJECT}\", ;\
  4143. ${ECHO_CMD} \"gh_tagname\":\"${GH_TAGNAME}\", ;\
  4144. ${ECHO_CMD} \"gl_account\":\"${GL_ACCOUNT}\", ;\
  4145. ${ECHO_CMD} \"gl_commit\":\"${GL_COMMIT}\", ;\
  4146. ${ECHO_CMD} \"gl_project\":\"${GL_PROJECT}\", ;\
  4147. ${ECHO_CMD} \"gl_site\":\"${GL_SITE}\", ;\
  4148. ${ECHO_CMD} \"maintainer\":\"${MAINTAINER}\", ;\
  4149. ${ECHO_CMD} \"makefiles\":\"${MAKEFILES}\", ;\
  4150. ${ECHO_CMD} \"pkgbase\":\"${PKGBASE}\", ;\
  4151. ${ECHO_CMD} \"pkgname\":\"${PKGNAME}\", ;\
  4152. ${ECHO_CMD} \"pkgnamesuffix\":\"${PKGNAMESUFFIX}\", ;\
  4153. ${ECHO_CMD} \"pkgorigin\":\"${PKGORIGIN}\", ;\
  4154. ${ECHO_CMD} \"comment\":\"${COMMENT:Q:S/"/\\\"/g:S/\\\\*/*/g:S/\\\'/'/g}\", ;\
  4155. ${ECHO_CMD} \"portepoch\":\"${PORTEPOCH}\", ;\
  4156. ${ECHO_CMD} \"portname\":\"${PORTNAME}\", ;\
  4157. ${ECHO_CMD} \"portrevision\":\"${PORTREVISION}\", ;\
  4158. ${ECHO_CMD} \"portversion\":\"${PORTVERSION}\", ;\
  4159. ${ECHO_CMD} \"use_github\":\"${USE_GITHUB}\", ;\
  4160. ${ECHO_CMD} \"use_gitlab\":\"${USE_GITLAB}\", ;\
  4161. ${ECHO_CMD} \"www\":\"${WWW:Q}\" ;\
  4162. ${ECHO_CMD} "}" >> ${INDEX_OUT})
  4163. . else # empty(FLAVORS)
  4164. describe-json: ${FLAVORS:S/^/describe-json-/}
  4165. _LAST_FLAVOR = ${FLAVORS:[-1]}
  4166. . for f in ${FLAVORS}
  4167. describe-json-${f}:
  4168. @if [ "${f}" == "${FLAVORS:[1]}" ]; then \
  4169. ${ECHO_CMD} "{" ;\
  4170. fi;
  4171. @cd ${.CURDIR} && ${SETENV} FLAVOR=${f} ${MAKE} -B -D_DESCRIBE_WITH_FLAVOR describe-json
  4172. @if [ "${f}" != "${_LAST_FLAVOR}" ]; then \
  4173. ${ECHO_MSG} "," ;\
  4174. else \
  4175. ${ECHO_CMD} "}" ;\
  4176. fi; \
  4177. . endfor
  4178. . endif # empty(FLAVORS)
  4179. www-site:
  4180. @${ECHO_CMD} ${_WWW}
  4181. . if !target(readmes)
  4182. readmes: readme
  4183. . endif
  4184. . if !target(readme)
  4185. readme:
  4186. @${RM} ${.CURDIR}/README.html
  4187. @cd ${.CURDIR} && ${MAKE} ${.CURDIR}/README.html
  4188. . endif
  4189. ${.CURDIR}/README.html:
  4190. @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
  4191. @${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
  4192. ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
  4193. -e 's|%%PKG%%|${PKGNAME}|g' \
  4194. -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
  4195. -e '/%%COMMENT%%/d' \
  4196. -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
  4197. ${SED} -e 's|${.CURDIR}/||')"'|' \
  4198. -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
  4199. ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
  4200. -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
  4201. -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-www-site)"'|' \
  4202. -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-build-depends-list)"'|' \
  4203. -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} pretty-print-run-depends-list)"'|' \
  4204. -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
  4205. ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
  4206. ${TEMPLATES}/README.port >> ${.TARGET}
  4207. # The following two targets require an up-to-date INDEX in ${PORTSDIR}
  4208. _PRETTY_PRINT_DEPENDS_LIST=\
  4209. if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
  4210. ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
  4211. else \
  4212. target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
  4213. if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi; \
  4214. ${ECHO_MSG} -n 'This port requires package(s) "' ; \
  4215. ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
  4216. ${ECHO_MSG} "\" to $$target."; \
  4217. fi;
  4218. . if !target(pretty-print-build-depends-list)
  4219. pretty-print-build-depends-list:
  4220. . if defined(PKG_DEPENDS) || defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
  4221. defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS)
  4222. @${_PRETTY_PRINT_DEPENDS_LIST}
  4223. . endif
  4224. . endif
  4225. . if !target(pretty-print-run-depends-list)
  4226. pretty-print-run-depends-list:
  4227. . if defined(RUN_DEPENDS) || defined(LIB_DEPENDS)
  4228. @${_PRETTY_PRINT_DEPENDS_LIST}
  4229. . endif
  4230. . endif
  4231. _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
  4232. . if !target(apply-slist) && defined(SUB_FILES)
  4233. apply-slist:
  4234. . for file in ${SUB_FILES}
  4235. . if !exists(${FILESDIR}/${file}.in)
  4236. @${ECHO_MSG} "** Missing ${FILESDIR}/${file}.in for ${PKGNAME}."; exit 1
  4237. . else
  4238. @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
  4239. . endif
  4240. . endfor
  4241. . for i in pkg-message pkg-install pkg-deinstall pkg-req
  4242. . if ${SUB_FILES:M${i}*}!=""
  4243. ${i:S/-//:tu}= ${WRKDIR}/${SUB_FILES:M${i}*}
  4244. . endif
  4245. . endfor
  4246. . endif
  4247. # Generate packing list. Also tests to make sure all required package
  4248. # files exist.
  4249. PLIST_SUB_SANITIZED= ${PLIST_SUB:N*_regex=*}
  4250. . if !target(generate-plist)
  4251. generate-plist: ${WRKDIR}
  4252. @${ECHO_MSG} "===> Generating temporary packing list"
  4253. @${MKDIR} ${TMPPLIST:H}
  4254. @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
  4255. @>${TMPPLIST}
  4256. @for file in ${PLIST_FILES}; do \
  4257. ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
  4258. done
  4259. . for sp in ${_PKGS}
  4260. . if ${sp} != ${PKGBASE}
  4261. @for file in ${PLIST_FILES${_SP.${sp}}}; do \
  4262. ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's/^/@@${_SP.${sp}:S/^.//}@@/' >> ${TMPPLIST}; \
  4263. done
  4264. . endif
  4265. . endfor
  4266. . if !empty(PLIST)
  4267. . for f in ${PLIST}
  4268. @if [ -f "${f}" ]; then \
  4269. ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${f} >> ${TMPPLIST}; \
  4270. for i in owner group mode; do ${ECHO_CMD} "@$$i"; done >> ${TMPPLIST}; \
  4271. fi
  4272. . endfor
  4273. . endif
  4274. . for dir in ${PLIST_DIRS}
  4275. @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dir ,' >> ${TMPPLIST}
  4276. . endfor
  4277. . for sp in ${_PKGS}
  4278. . if ${sp} != ${PKGBASE}
  4279. . for dir in ${PLIST_DIRS${_SP.${sp}}}
  4280. @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB_SANITIZED:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@@${_SP.${sp}:S/^.//}@@@dir ,' >> ${TMPPLIST}
  4281. . endfor
  4282. . endif
  4283. . endfor
  4284. . endif
  4285. ${TMPPLIST}:
  4286. @cd ${.CURDIR} && ${MAKE} generate-plist
  4287. . for _type in EXAMPLES DOCS
  4288. . if !empty(_REALLY_ALL_POSSIBLE_OPTIONS:M${_type})
  4289. . if !target(add-plist-${_type:tl})
  4290. . if defined(PORT${_type}) && !empty(PORT_OPTIONS:M${_type})
  4291. add-plist-${_type:tl}:
  4292. . for x in ${PORT${_type}}
  4293. @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
  4294. if [ ! -e ${STAGEDIR}${${_type}DIR}/${x} ]; then \
  4295. ${ECHO_CMD} ${${_type}DIR}/${x} >> ${TMPPLIST}; \
  4296. fi;fi
  4297. . endfor
  4298. @${FIND} -P ${PORT${_type}:S/^/${STAGEDIR}${${_type}DIR}\//} ! -type d 2>/dev/null | \
  4299. ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
  4300. . endif
  4301. . endif
  4302. . endif
  4303. . endfor
  4304. . if !target(add-plist-data)
  4305. . if defined(PORTDATA)
  4306. add-plist-data:
  4307. . for x in ${PORTDATA}
  4308. @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
  4309. if [ ! -e ${STAGEDIR}${DATADIR}/${x} ]; then \
  4310. ${ECHO_CMD} ${DATADIR}/${x} >> ${TMPPLIST}; \
  4311. fi;fi
  4312. . endfor
  4313. @${FIND} -P ${PORTDATA:S/^/${STAGEDIR}${DATADIR}\//} ! -type d 2>/dev/null | \
  4314. ${SED} -ne 's,^${STAGEDIR},,p' >> ${TMPPLIST}
  4315. . endif
  4316. . endif
  4317. . if !target(add-plist-info)
  4318. . if defined(INFO)
  4319. add-plist-info:
  4320. . for i in ${INFO}
  4321. @${LS} ${STAGEDIR}${PREFIX}/${INFO_PATH}/$i.info* | ${SED} -e s:${STAGEDIR}:@info\ :g >> ${TMPPLIST}
  4322. . endfor
  4323. . endif
  4324. . endif
  4325. # If we're installing into a non-standard PREFIX, we need to remove that directory at
  4326. # deinstall-time
  4327. . if !target(add-plist-post)
  4328. . if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE} && \
  4329. ${PREFIX} != "/usr" && ${PREFIX} != "/" && !defined(NO_PREFIX_RMDIR))
  4330. add-plist-post:
  4331. @${ECHO_CMD} "@dir ${PREFIX}" >> ${TMPPLIST}
  4332. . endif
  4333. . endif
  4334. . if !target(install-rc-script)
  4335. . if defined(USE_RC_SUBR)
  4336. install-rc-script:
  4337. @${ECHO_MSG} "===> Staging rc.d startup script(s)"
  4338. @for i in ${USE_RC_SUBR}; do \
  4339. _prefix=${PREFIX}; \
  4340. [ "${PREFIX}" = "/usr" ] && _prefix="" ; \
  4341. ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${STAGEDIR}$${_prefix}/etc/rc.d/$${i%.sh}; \
  4342. ${ECHO_CMD} "@(root,wheel,0755) $${_prefix}/etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
  4343. done
  4344. . endif
  4345. . endif
  4346. . if !target(check-man)
  4347. check-man: stage
  4348. @${ECHO_MSG} "====> Checking man pages (check-man)"
  4349. @mdirs= ; \
  4350. for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
  4351. [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
  4352. done ; \
  4353. err=0 ; \
  4354. for dir in $$mdirs; do \
  4355. for f in $$(find $$dir -name "*.gz"); do \
  4356. ${ECHO_CMD} "===> Checking $${f##*/}" ; \
  4357. gunzip -c $$f | mandoc -Tlint -Werror && continue ; \
  4358. err=1 ; \
  4359. done ; \
  4360. done ; \
  4361. exit $$err
  4362. . endif
  4363. # Compress all manpage not already compressed which are not hardlinks
  4364. # Find all manpages which are not compressed and are hardlinks, and only get the list of inodes concerned, for each of them compress the first one found and recreate the hardlinks for the others
  4365. # Fixes all dead symlinks left by the previous round
  4366. . if !target(compress-man)
  4367. compress-man:
  4368. @${ECHO_MSG} "====> Compressing man pages (compress-man)"
  4369. @mdirs= ; \
  4370. for dir in ${MANDIRS:S/^/${STAGEDIR}/} ; do \
  4371. [ -d $$dir ] && mdirs="$$mdirs $$dir" ;\
  4372. done ; \
  4373. for dir in $$mdirs; do \
  4374. ${FIND} $$dir -type f \! -name "*.gz" -links 1 -exec ${GZIP_CMD} {} \; ; \
  4375. ${FIND} $$dir -type f \! -name "*.gz" \! -links 1 -exec ${STAT} -f '%i' {} \; | \
  4376. ${SORT} -u | while read inode ; do \
  4377. unset ref ; \
  4378. for f in $$(${FIND} $$dir -type f -inum $${inode} -print); do \
  4379. if [ -z $$ref ]; then \
  4380. ref=$${f}.gz ; \
  4381. ${GZIP_CMD} $${f} ; \
  4382. continue ; \
  4383. fi ; \
  4384. ${RM} $${f} ; \
  4385. (cd $${f%/*}; ${LN} -f $${ref##*/} $${f##*/}.gz) ; \
  4386. done ; \
  4387. done ; \
  4388. ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \
  4389. ${LN} -sf $$(readlink $$link).gz $$link.gz ;\
  4390. ${RM} $$link ; \
  4391. done; \
  4392. done
  4393. . endif
  4394. . if !target(stage-dir)
  4395. stage-dir: ${STAGEDIR}${PREFIX}
  4396. . if !defined(NO_MTREE)
  4397. @${MTREE_CMD} ${MTREE_ARGS} ${STAGEDIR}${PREFIX} > /dev/null
  4398. . endif
  4399. . endif
  4400. . if !target(makeplist)
  4401. makeplist: stage
  4402. @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh makeplist
  4403. . endif
  4404. . if !target(check-plist)
  4405. check-plist: stage
  4406. @${ECHO_MSG} "====> Checking for pkg-plist issues (check-plist)"
  4407. @${SETENV} ${CO_ENV} ${SH} ${SCRIPTSDIR}/check-stagedir.sh checkplist
  4408. @${ECHO_MSG} "===> No pkg-plist issues found (check-plist)"
  4409. . endif
  4410. . if !target(check-orphans)
  4411. check-orphans: check-plist
  4412. . endif
  4413. . if !target(stage-qa)
  4414. stage-qa:
  4415. @${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
  4416. @${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh
  4417. . if !defined(DEVELOPER)
  4418. @${ECHO_MSG} "/!\\ To run stage-qa automatically add DEVELOPER=yes to your environment /!\\"
  4419. . endif
  4420. . endif
  4421. pretty-flavors-package-names: .PHONY
  4422. . if empty(FLAVORS)
  4423. @${ECHO_CMD} "no flavor: ${PKGNAMES}"
  4424. . else
  4425. . for f in ${FLAVORS}
  4426. @${ECHO_CMD} -n "${f}: "
  4427. @cd ${.CURDIR} && ${SETENV} -i FLAVOR=${f} ${MAKE} -B -V PKGNAMES
  4428. . endfor
  4429. . endif
  4430. flavors-package-names: .PHONY
  4431. . if empty(FLAVORS)
  4432. @${ECHO_CMD} "${PKGNAMES}" | ${XARGS} -n 1
  4433. . else
  4434. . for f in ${FLAVORS}
  4435. @cd ${.CURDIR} && ${SETENV} -i FLAVOR=${f} ${MAKE} -B -V PKGNAMES | ${XARGS} -n 1
  4436. . endfor
  4437. . endif
  4438. # Fake installation of package so that user can pkg delete it later.
  4439. . if !target(fake-pkg)
  4440. STAGE_ARGS= -i ${STAGEDIR}
  4441. . if defined(NO_PKG_REGISTER)
  4442. STAGE_ARGS= -N
  4443. . endif
  4444. . for sp in ${_PKGS}
  4445. fake-pkg: fake-pkg.${sp}
  4446. fake-pkg.${sp}: ${_PLIST}.${sp}
  4447. . if defined(INSTALLS_DEPENDS)
  4448. . if !defined(NO_PKG_REGISTER)
  4449. @${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic"
  4450. . endif
  4451. @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_REGISTER} -d ${STAGE_ARGS} -m ${METADIR}.${sp} -f ${_PLIST}.${sp}
  4452. . else
  4453. . if !defined(NO_PKG_REGISTER)
  4454. @${ECHO_MSG} "===> Registering installation for ${PKGNAME}"
  4455. . endif
  4456. @${SETENV} ${PKG_ENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_REGISTER} ${STAGE_ARGS} -m ${METADIR}.${sp} -f ${_PLIST}.${sp}
  4457. . endif
  4458. @${RM} -r ${METADIR}.${sp}
  4459. . endfor
  4460. . endif
  4461. # Depend is generally meaningless for arbitrary ports, but if someone wants
  4462. # one they can override this. This is just to catch people who've gotten into
  4463. # the habit of typing `make depend all install' as a matter of course.
  4464. # Same goes for tags
  4465. . for _t in depend tags
  4466. . if !target(${_t})
  4467. ${_t}:
  4468. . endif
  4469. . endfor
  4470. . if !defined(NOPRECIOUSMAKEVARS)
  4471. # These won't change, so we can pass them through the environment
  4472. . for var in ${_EXPORTED_VARS}
  4473. . if empty(.MAKEFLAGS:M${var}=*) && !empty(${var})
  4474. .MAKEFLAGS: ${var}=${${var}:Q}
  4475. . endif
  4476. . endfor
  4477. . endif
  4478. PORTS_ENV_VARS+= ${_EXPORTED_VARS}
  4479. . if !target(pre-check-config)
  4480. pre-check-config:
  4481. _CHECK_OPTIONS_NAMES= OPTIONS_DEFINE OPTIONS_GROUP OPTIONS_MULTI \
  4482. OPTIONS_RADIO OPTIONS_SINGLE
  4483. _CHECK_OPTIONS_NAMES+= ${OPTIONS_GROUP:S/^/OPTIONS_GROUP_/}
  4484. _CHECK_OPTIONS_NAMES+= ${OPTIONS_MULTI:S/^/OPTIONS_MULTI_/}
  4485. _CHECK_OPTIONS_NAMES+= ${OPTIONS_RADIO:S/^/OPTIONS_RADIO_/}
  4486. _CHECK_OPTIONS_NAMES+= ${OPTIONS_SINGLE:S/^/OPTIONS_SINGLE_/}
  4487. . for var in ${_CHECK_OPTIONS_NAMES}
  4488. . if defined(${var})
  4489. . for o in ${${var}}
  4490. . if ${o:C/[-_[:upper:][:digit:]]//g}
  4491. OPTIONS_BAD_NAMES+= ${o}
  4492. . endif
  4493. . endfor
  4494. . endif
  4495. . endfor
  4496. . if defined(OPTIONS_BAD_NAMES) && !empty(OPTIONS_BAD_NAMES)
  4497. DEV_WARNING+= "These options name have characters outside of [-_A-Z0-9]:"
  4498. DEV_WARNING+= "${OPTIONS_BAD_NAMES:O:u}"
  4499. . endif
  4500. . for single in ${OPTIONS_SINGLE}
  4501. . for opt in ${OPTIONS_SINGLE_${single}}
  4502. . if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
  4503. . if !empty(PORT_OPTIONS:M${opt})
  4504. OPTIONS_WRONG_SINGLE_${single}+= ${opt}
  4505. . if defined(OPTFOUND)
  4506. OPTIONS_WRONG_SINGLE+= ${single}
  4507. . else
  4508. OPTFOUND= true
  4509. . endif
  4510. . endif
  4511. . else
  4512. # if conditional and if the condition is unchecked, remove opt from the list of
  4513. # set options
  4514. PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
  4515. OPTNOCHECK= true
  4516. . endif
  4517. . endfor
  4518. . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
  4519. OPTIONS_WRONG_SINGLE+= ${single}
  4520. . endif
  4521. . undef OPTFOUND
  4522. . undef OPTNOCHECK
  4523. . endfor
  4524. .undef single
  4525. . for radio in ${OPTIONS_RADIO}
  4526. . for opt in ${OPTIONS_RADIO_${radio}}
  4527. . if !empty(PORT_OPTIONS:M${opt})
  4528. OPTIONS_WRONG_RADIO_${radio}+= ${opt}
  4529. . if defined(OPTFOUND)
  4530. OPTIONS_WRONG_RADIO+= ${radio}
  4531. . else
  4532. OPTFOUND= true
  4533. . endif
  4534. . endif
  4535. . endfor
  4536. . undef OPTFOUND
  4537. . endfor
  4538. . for multi in ${OPTIONS_MULTI}
  4539. . for opt in ${OPTIONS_MULTI_${multi}}
  4540. . if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi})
  4541. . if !empty(PORT_OPTIONS:M${opt})
  4542. OPTFOUND= true
  4543. . endif
  4544. . else
  4545. # if conditional and if the condition is unchecked, remove opt from the list of
  4546. # set options
  4547. PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
  4548. OPTNOCHECK= true
  4549. . endif
  4550. . endfor
  4551. . if !defined(OPTFOUND) && !defined(OPTNOCHECK)
  4552. OPTIONS_WRONG_MULTI+= ${multi}
  4553. . endif
  4554. . undef OPTFOUND
  4555. . undef OPTNOCHECK
  4556. . endfor
  4557. .undef multi
  4558. . for opt in ${PORT_OPTIONS}
  4559. . for conflict in ${${opt}_PREVENTS}
  4560. . if ${PORT_OPTIONS:M${conflict}}
  4561. . if empty(OPTIONS_WRONG_PREVENTS:M${opt})
  4562. OPTIONS_WRONG_PREVENTS+= ${opt}
  4563. . endif
  4564. OPTIONS_WRONG_PREVENTS_${opt}+= ${conflict}
  4565. . endif
  4566. . endfor
  4567. . endfor
  4568. .undef conflict
  4569. .undef opt
  4570. . endif #pre-check-config
  4571. . if !target(_check-config)
  4572. _check-config: pre-check-config
  4573. . for multi in ${OPTIONS_WRONG_MULTI}
  4574. @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi"
  4575. . endfor
  4576. . for single in ${OPTIONS_WRONG_SINGLE}
  4577. @${ECHO_MSG} "====> You must select one and only one option from the ${single} single"
  4578. . if defined(OPTIONS_WRONG_SINGLE_${single})
  4579. @${ECHO_MSG} "=====> Only one of these must be defined: ${OPTIONS_WRONG_SINGLE_${single}}"
  4580. . else
  4581. @${ECHO_MSG} "=====> No option was selected (and one must be)"
  4582. . endif
  4583. . endfor
  4584. . for radio in ${OPTIONS_WRONG_RADIO}
  4585. @${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
  4586. @${ECHO_MSG} "=====> Only one of these must be defined: ${OPTIONS_WRONG_RADIO_${radio}}"
  4587. . endfor
  4588. . if defined(OPTIONS_WRONG_PREVENTS)
  4589. @${ECHO_MSG} "====> Two or more enabled options conflict with each other"
  4590. . for prevents in ${OPTIONS_WRONG_PREVENTS}
  4591. @${ECHO_MSG} "=====> Option ${prevents} conflicts with ${OPTIONS_WRONG_PREVENTS_${prevents}} (select only one)"
  4592. . if defined(${prevents}_PREVENTS_MSG)
  4593. @${ECHO_MSG} "======> ${${prevents}_PREVENTS_MSG}"
  4594. . endif
  4595. . endfor
  4596. . endif
  4597. . if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO) || !empty(OPTIONS_WRONG_PREVENTS)
  4598. _CHECK_CONFIG_ERROR= true
  4599. . endif
  4600. . endif # _check-config
  4601. . if !target(check-config)
  4602. check-config: _check-config
  4603. . if !empty(_CHECK_CONFIG_ERROR)
  4604. @${FALSE}
  4605. . endif
  4606. . endif # check-config
  4607. . if !target(sanity-config)
  4608. sanity-config: _check-config
  4609. . if !empty(_CHECK_CONFIG_ERROR)
  4610. @echo -n "Config is invalid. Re-edit? [Y/n] "; \
  4611. read answer; \
  4612. case $$answer in \
  4613. [Nn]|[Nn][Oo]) \
  4614. exit 0; \
  4615. esac; \
  4616. cd ${.CURDIR} && ${MAKE} config
  4617. . endif
  4618. . endif # sanity-config
  4619. . if !target(pre-config)
  4620. pre-config:
  4621. D4P_ENV= PKGNAME="${PKGNAME}" \
  4622. PORT_OPTIONS="${PORT_OPTIONS}" \
  4623. ALL_OPTIONS="${ALL_OPTIONS}" \
  4624. OPTIONS_MULTI="${OPTIONS_MULTI}" \
  4625. OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
  4626. OPTIONS_RADIO="${OPTIONS_RADIO}" \
  4627. OPTIONS_GROUP="${OPTIONS_GROUP}" \
  4628. NEW_OPTIONS="${NEW_OPTIONS}" \
  4629. DIALOG4PORTS="${DIALOG4PORTS}" \
  4630. PREFIX="${PREFIX}" \
  4631. LOCALBASE="${LOCALBASE}" \
  4632. PORTSDIR="${PORTSDIR}" \
  4633. MAKE="${MAKE}" \
  4634. D4PHEIGHT="${D4PHEIGHT}" \
  4635. D4PMINHEIGHT="${D4PMINHEIGHT}" \
  4636. D4PWIDTH="${D4PWIDTH}" \
  4637. D4PFULLSCREEN="${D4PFULLSCREEN}" \
  4638. D4PALIGNCENTER="${D4PALIGNCENTER}" \
  4639. D4PASCIILINES="${D4PASCIILINES}"
  4640. . if exists(${PKGHELP})
  4641. D4P_ENV+= PKGHELP="${PKGHELP}"
  4642. . endif
  4643. . for opt in ${ALL_OPTIONS}
  4644. D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
  4645. . endfor
  4646. . for otype in MULTI GROUP SINGLE RADIO
  4647. . for m in ${OPTIONS_${otype}}
  4648. D4P_ENV+= OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
  4649. ${m}_DESC=""${${m}_DESC:Q}""
  4650. . for opt in ${OPTIONS_${otype}_${m}}
  4651. D4P_ENV+= ${opt}_DESC=""${${opt}_DESC:Q}""
  4652. . endfor
  4653. . endfor
  4654. . endfor
  4655. .undef m
  4656. .undef otype
  4657. .undef opt
  4658. . endif # pre-config
  4659. . if !target(do-config)
  4660. do-config:
  4661. . if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
  4662. @${ECHO_MSG} "===> No options to configure"
  4663. . else
  4664. @optionsdir=${OPTIONS_FILE:H}; \
  4665. if [ ! -w "${PORT_DBDIR}" -a "`stat -f %u ${PORT_DBDIR:H}`" = 0 ]; \
  4666. then \
  4667. ${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
  4668. (${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \
  4669. (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
  4670. ${ECHO_MSG} "===> Returning to user credentials" ; \
  4671. else \
  4672. ${MKDIR} $${optionsdir} 2> /dev/null || \
  4673. (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1) ; \
  4674. fi
  4675. @TMPOPTIONSFILE=$$(mktemp -t portoptions); \
  4676. trap "${RM} $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
  4677. ${SETENV} ${D4P_ENV} ${SH} ${SCRIPTSDIR}/dialog4ports.sh $${TMPOPTIONSFILE} || { \
  4678. ${RM} $${TMPOPTIONSFILE}; \
  4679. ${ECHO_CMD}; \
  4680. ${ECHO_MSG} "===> Options unchanged"; \
  4681. exit 0; \
  4682. }; \
  4683. ${ECHO_CMD}; \
  4684. if [ ! -e $${TMPOPTIONSFILE} ]; then \
  4685. ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
  4686. exit 0; \
  4687. fi; \
  4688. SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
  4689. ${RM} $${TMPOPTIONSFILE}; \
  4690. TMPOPTIONSFILE=$$(mktemp -t portoptions); \
  4691. trap "${RM} $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
  4692. ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
  4693. ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
  4694. ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
  4695. ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
  4696. for i in ${COMPLETE_OPTIONS_LIST}; do \
  4697. if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
  4698. ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
  4699. else \
  4700. ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
  4701. fi; \
  4702. done; \
  4703. if [ ! -w "${OPTIONS_FILE:H}" -a "`stat -f %u ${OPTIONS_FILE:H}`" != ${UID} ]; \
  4704. then \
  4705. ${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
  4706. ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
  4707. ${ECHO_MSG} "===> Returning to user credentials"; \
  4708. else \
  4709. ${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
  4710. fi; \
  4711. ${RM} $${TMPOPTIONSFILE}
  4712. @cd ${.CURDIR} && ${MAKE} sanity-config
  4713. . endif
  4714. . endif # do-config
  4715. . if !target(config)
  4716. . if !defined(NO_DIALOG)
  4717. config: pre-config do-config
  4718. . else
  4719. config:
  4720. @${ECHO_MSG} "===> Skipping 'config' as NO_DIALOG is defined"
  4721. . endif
  4722. . endif # config
  4723. . if !target(config-recursive)
  4724. config-recursive:
  4725. @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
  4726. @recursive_cmd="config-conditional"; \
  4727. recursive_dirs="${.CURDIR}${FLAVOR:D@${FLAVOR}} $$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  4728. ${_FLAVOR_RECURSIVE_SH}
  4729. . endif # config-recursive
  4730. . if !target(config-conditional)
  4731. config-conditional:
  4732. . if !empty(NEW_OPTIONS)
  4733. @cd ${.CURDIR} && ${MAKE} config;
  4734. . endif
  4735. . endif # config-conditional
  4736. . if !target(showconfig) && (make(*config*) || (!empty(.MAKEFLAGS:M-V) && !empty(.MAKEFLAGS:M*_DESC)))
  4737. .include "${PORTSDIR}/Mk/bsd.options.desc.mk"
  4738. MULTI_EOL= : you have to choose at least one of them
  4739. SINGLE_EOL= : you have to select exactly one of them
  4740. RADIO_EOL= : you can only select none or one of them
  4741. showconfig: check-config
  4742. . if !empty(COMPLETE_OPTIONS_LIST)
  4743. @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
  4744. . for opt in ${ALL_OPTIONS}
  4745. @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
  4746. . if !empty(${opt}_DESC)
  4747. @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
  4748. . endif
  4749. @${ECHO_MSG} ""
  4750. . endfor
  4751. #multi and conditional multis
  4752. . for otype in MULTI GROUP SINGLE RADIO
  4753. . for m in ${OPTIONS_${otype}}
  4754. . if empty(${m}_DESC)
  4755. @${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
  4756. . else
  4757. @${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
  4758. . endif
  4759. . for opt in ${OPTIONS_${otype}_${m}}
  4760. @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
  4761. . if !empty(${opt}_DESC)
  4762. @${ECHO_MSG} -n ": "${${opt}_DESC:Q}
  4763. . endif
  4764. @${ECHO_MSG} ""
  4765. . endfor
  4766. . endfor
  4767. . endfor
  4768. .undef otype
  4769. .undef m
  4770. .undef opt
  4771. @${ECHO_MSG} "===> Use 'make config' to modify these settings"
  4772. . endif
  4773. . endif # showconfig
  4774. . if !target(showconfig-recursive)
  4775. showconfig-recursive:
  4776. @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and its dependencies";
  4777. @recursive_cmd="showconfig"; \
  4778. recursive_dirs="${.CURDIR}${FLAVOR:D@${FLAVOR}} $$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  4779. ${_FLAVOR_RECURSIVE_SH}
  4780. . endif # showconfig-recursive
  4781. . if !target(rmconfig)
  4782. rmconfig:
  4783. . if exists(${OPTIONS_FILE})
  4784. -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
  4785. optionsdir=${OPTIONS_FILE:H}; \
  4786. if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" -a ! -w "${OPTIONS_FILE}" ]; then \
  4787. ${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONS_FILE} and $${optionsdir}"; \
  4788. ${SU_CMD} "${RM} ${OPTIONS_FILE} ; \
  4789. ${RMDIR} $${optionsdir}"; \
  4790. ${ECHO_MSG} "===> Returning to user credentials"; \
  4791. else \
  4792. ${RM} ${OPTIONS_FILE}; \
  4793. ${RMDIR} $${optionsdir} 2>/dev/null || return 0; \
  4794. fi
  4795. . else
  4796. @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
  4797. . endif
  4798. . endif # rmconfig
  4799. . if !target(rmconfig-recursive)
  4800. rmconfig-recursive:
  4801. @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and its dependencies";
  4802. @recursive_cmd="rmconfig"; \
  4803. recursive_dirs="${.CURDIR}${FLAVOR:D@${FLAVOR}} $$(${ALL-DEPENDS-FLAVORS-LIST})"; \
  4804. ${_FLAVOR_RECURSIVE_SH}
  4805. . endif # rmconfig-recursive
  4806. . if !target(pretty-print-config)
  4807. MULTI_START= [
  4808. MULTI_END= ]
  4809. GROUP_START= [
  4810. GROUP_END= ]
  4811. SINGLE_START= (
  4812. SINGLE_END= )
  4813. RADIO_START= (
  4814. RADIO_END= )
  4815. pretty-print-config:
  4816. . for opt in ${ALL_OPTIONS}
  4817. @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
  4818. . endfor
  4819. . for otype in MULTI GROUP SINGLE RADIO
  4820. . for m in ${OPTIONS_${otype}}
  4821. @${ECHO_MSG} -n "${m}${${otype}_START} "
  4822. . for opt in ${OPTIONS_${otype}_${m}}
  4823. @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
  4824. . endfor
  4825. @${ECHO_MSG} -n "${${otype}_END} "
  4826. . endfor
  4827. . endfor
  4828. .undef otype
  4829. .undef m
  4830. .undef opt
  4831. @${ECHO_MSG} ""
  4832. . endif # pretty-print-config
  4833. desktop-categories:
  4834. @${SETENV} \
  4835. dp_CATEGORIES="${CATEGORIES}" \
  4836. dp_ECHO_CMD=${ECHO_CMD} \
  4837. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  4838. dp_SORT="${SORT}" \
  4839. dp_TR="${TR}" \
  4840. ${SH} ${SCRIPTSDIR}/desktop-categories.sh
  4841. . if defined(DESKTOP_ENTRIES)
  4842. check-desktop-entries:
  4843. @${SETENV} \
  4844. dp_CURDIR="${.CURDIR}" \
  4845. dp_ECHO_CMD=${ECHO_CMD} \
  4846. dp_ECHO_MSG=${ECHO_MSG} \
  4847. dp_EXPR="${EXPR}" \
  4848. dp_GREP="${GREP}" \
  4849. dp_MAKE="${MAKE}" \
  4850. dp_PKGNAME="${PKGNAME}" \
  4851. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  4852. dp_SED="${SED}" \
  4853. dp_VALID_DESKTOP_CATEGORIES="${VALID_DESKTOP_CATEGORIES}" \
  4854. dp_TR="${TR}" \
  4855. ${SH} ${SCRIPTSDIR}/check-desktop-entries.sh ${DESKTOP_ENTRIES}
  4856. . endif
  4857. . if !target(install-desktop-entries)
  4858. . if defined(DESKTOP_ENTRIES)
  4859. install-desktop-entries:
  4860. @${SETENV} \
  4861. dp_CURDIR="${.CURDIR}" \
  4862. dp_ECHO_CMD=${ECHO_CMD} \
  4863. dp_SCRIPTSDIR="${SCRIPTSDIR}" \
  4864. dp_STAGEDIR="${STAGEDIR}" \
  4865. dp_DESKTOPDIR="${DESKTOPDIR}" \
  4866. dp_TMPPLIST="${TMPPLIST}" \
  4867. dp_MAKE="${MAKE}" \
  4868. dp_SED="${SED}" \
  4869. ${SH} ${SCRIPTSDIR}/install-desktop-entries.sh ${DESKTOP_ENTRIES}
  4870. . endif
  4871. . endif
  4872. . if !empty(BINARY_ALIAS)
  4873. . if !target(create-binary-alias)
  4874. create-binary-alias: ${BINARY_LINKDIR}
  4875. . for target src in ${BINARY_ALIAS:C/=/ /}
  4876. @if srcpath=`which -- ${src}`; then \
  4877. ${RLN} $${srcpath} ${BINARY_LINKDIR}/${target}; \
  4878. else \
  4879. ${ECHO_MSG} "===> Missing \"${src}\" to create a binary alias at \"${BINARY_LINKDIR}/${target}\""; \
  4880. ${FALSE}; \
  4881. fi
  4882. . endfor
  4883. . endif
  4884. . endif
  4885. . if !empty(PKGCONFIG_BASE)
  4886. . if !target(create-base-pkgconfig)
  4887. create-base-pkgconfig: ${PKGCONFIG_LINKDIR}
  4888. . for pcfile in ${PKGCONFIG_BASE:S/$/.pc/}
  4889. @if `test -f ${PKGCONFIG_BASEDIR}/${pcfile}`; then \
  4890. ${RLN} ${PKGCONFIG_BASEDIR}/${pcfile} ${PKGCONFIG_LINKDIR}/${pcfile}; \
  4891. else \
  4892. ${ECHO_MSG} "===> Missing \"${pcfile}\" to create a link at \"${PKGCONFIG_LINKDIR}/${pcfile}\" "; \
  4893. ${FALSE}; \
  4894. fi
  4895. . endfor
  4896. . endif
  4897. . endif
  4898. . if !empty(BINARY_WRAPPERS)
  4899. . if !target(create-binary-wrappers)
  4900. create-binary-wrappers: ${BINARY_LINKDIR}
  4901. . for bin in ${BINARY_WRAPPERS}
  4902. @${INSTALL_SCRIPT} ${WRAPPERSDIR}/${bin} ${BINARY_LINKDIR}
  4903. . endfor
  4904. . endif
  4905. . endif
  4906. . if defined(WARNING)
  4907. WARNING_WAIT?= 10
  4908. show-warnings:
  4909. @${ECHO_MSG} "/!\\ WARNING /!\\"
  4910. @${ECHO_MSG}
  4911. . for m in ${WARNING}
  4912. @${ECHO_MSG} "${m}" | ${FMT_80}
  4913. @${ECHO_MSG}
  4914. . endfor
  4915. @sleep ${WARNING_WAIT}
  4916. . endif
  4917. . if defined(ERROR)
  4918. show-errors:
  4919. @${ECHO_MSG} "/!\\ ERRORS /!\\"
  4920. @${ECHO_MSG}
  4921. . for m in ${ERROR}
  4922. @${ECHO_MSG} "${m}" | ${FMT_80}
  4923. @${ECHO_MSG}
  4924. . endfor
  4925. @${FALSE}
  4926. . endif
  4927. . if defined(DEVELOPER)
  4928. . if defined(DEV_WARNING)
  4929. DEV_WARNING_WAIT?= 10
  4930. show-dev-warnings:
  4931. @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile warnings, please consider fixing /!\\"
  4932. @${ECHO_MSG}
  4933. . for m in ${DEV_WARNING}
  4934. @${ECHO_MSG} ${m} | ${FMT_80}
  4935. @${ECHO_MSG}
  4936. . endfor
  4937. . if defined(DEV_WARNING_FATAL)
  4938. @${FALSE}
  4939. . else
  4940. @sleep ${DEV_WARNING_WAIT}
  4941. . endif
  4942. . endif
  4943. . if defined(DEV_ERROR)
  4944. show-dev-errors:
  4945. @${ECHO_MSG} "/!\\ ${PKGNAME}: Makefile errors /!\\"
  4946. @${ECHO_MSG}
  4947. . for m in ${DEV_ERROR}
  4948. @${ECHO_MSG} "${m}" | ${FMT_80}
  4949. @${ECHO_MSG}
  4950. . endfor
  4951. @${FALSE}
  4952. . endif
  4953. . endif #DEVELOPER
  4954. ${_PORTS_DIRECTORIES}:
  4955. @${MKDIR} ${.TARGET}
  4956. # Please note that the order of the following targets is important, and
  4957. # should not be modified.
  4958. _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL TEST PACKAGE STAGE
  4959. # Define the SEQ of actions to take when each target is ran, and which targets
  4960. # it depends on before running its SEQ.
  4961. #
  4962. # Main target has a priority of 500, pre-target 300, post-target 700,
  4963. # target-depends 150. Other targets are spaced in between those
  4964. #
  4965. # If you change the pre-foo and post-foo values here, go and keep them in sync
  4966. # in _OPTIONS_TARGETS in bsd.options.mk
  4967. _SANITY_SEQ= 050:post-chroot 100:pre-everything \
  4968. 125:show-unsupported-system-error 150:check-makefile \
  4969. 190:show-errors 200:show-warnings \
  4970. 210:show-dev-errors 220:show-dev-warnings \
  4971. 250:check-categories 300:check-makevars \
  4972. 350:check-desktop-entries 400:check-depends \
  4973. 500:check-deprecated \
  4974. 550:check-vulnerable 600:check-license 650:check-config \
  4975. 700:buildanyway-message 750:options-message ${_USES_sanity}
  4976. _PKG_DEP= check-sanity
  4977. _PKG_SEQ= 500:pkg-depends
  4978. _FETCH_DEP= pkg
  4979. _FETCH_SEQ= 150:fetch-depends 300:pre-fetch 450:pre-fetch-script \
  4980. 500:do-fetch 550:fetch-specials 700:post-fetch \
  4981. 850:post-fetch-script \
  4982. ${_OPTIONS_fetch} ${_USES_fetch}
  4983. _EXTRACT_DEP= fetch
  4984. _EXTRACT_SEQ= 010:check-build-conflicts 050:extract-message 100:checksum \
  4985. 150:extract-depends 190:clean-wrkdir 200:${EXTRACT_WRKDIR} \
  4986. 300:pre-extract 450:pre-extract-script 500:do-extract \
  4987. 700:post-extract 850:post-extract-script \
  4988. 999:extract-fixup-modes \
  4989. ${_OPTIONS_extract} ${_USES_extract} ${_SITES_extract}
  4990. _PATCH_DEP= extract
  4991. _PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \
  4992. 300:pre-patch 450:pre-patch-script 500:do-patch \
  4993. 700:post-patch 850:post-patch-script \
  4994. ${_OPTIONS_patch} ${_USES_patch}
  4995. _CONFIGURE_DEP= patch
  4996. _CONFIGURE_SEQ= 150:build-depends 151:lib-depends 160:create-binary-alias \
  4997. 161:create-binary-wrappers 170:create-base-pkgconfig \
  4998. 200:configure-message 210:apply-slist \
  4999. 300:pre-configure 450:pre-configure-script \
  5000. 490:run-autotools-fixup 500:do-configure 700:post-configure \
  5001. 850:post-configure-script \
  5002. ${_OPTIONS_configure} ${_USES_configure}
  5003. _BUILD_DEP= configure
  5004. _BUILD_SEQ= 100:build-message 300:pre-build 450:pre-build-script \
  5005. 500:do-build 700:post-build 850:post-build-script \
  5006. ${_OPTIONS_build} ${_USES_build}
  5007. _STAGE_DEP= build
  5008. # STAGE is special in its numbering as it has install and stage, so install is
  5009. # the main, and stage goes after.
  5010. _STAGE_SEQ= 050:stage-message 100:stage-dir 150:run-depends \
  5011. 300:pre-install \
  5012. 400:generate-plist 450:pre-su-install 475:create-users-groups \
  5013. 500:do-install 550:kmod-post-install 600:fixup-lib-pkgconfig 700:post-install \
  5014. 750:post-install-script 800:post-stage 850:compress-man \
  5015. 860:install-rc-script 870:install-ldconfig-file \
  5016. 880:install-license 890:install-desktop-entries \
  5017. 900:add-plist-info 910:add-plist-docs 920:add-plist-examples \
  5018. 930:add-plist-data 940:add-plist-post ${POST_PLIST:C/^/990:/} \
  5019. ${_OPTIONS_install} ${_USES_install} \
  5020. ${_OPTIONS_stage} ${_USES_stage} ${_FEATURES_stage}
  5021. . if defined(DEVELOPER)
  5022. _STAGE_SEQ+= 995:stage-qa
  5023. . else
  5024. stage-qa: stage
  5025. . endif
  5026. _TEST_DEP= stage
  5027. _TEST_SEQ= 100:test-message 150:test-depends 300:pre-test 500:do-test \
  5028. 800:post-test \
  5029. ${_OPTIONS_test} ${_USES_test}
  5030. _INSTALL_DEP= stage
  5031. _INSTALL_SEQ= 100:install-message \
  5032. 150:identify-install-conflicts \
  5033. 200:check-already-installed \
  5034. 300:create-manifest
  5035. _INSTALL_SUSEQ= 400:fake-pkg 500:security-check
  5036. _PACKAGE_DEP= stage ${_TESTING_PACKAGE_DEP}
  5037. _PACKAGE_SEQ= 100:package-message 300:pre-package 450:pre-package-script \
  5038. 500:do-package 850:post-package-script \
  5039. ${_OPTIONS_package} ${_USES_package}
  5040. # Enforce order for -jN builds
  5041. . for _t in ${_TARGETS_STAGES}
  5042. # Check if the port need to change the default order of some targets...
  5043. . if defined(TARGET_ORDER_OVERRIDE)
  5044. _tmp_seq:=
  5045. . for _entry in ${_${_t}_SEQ}
  5046. # for _target because :M${_target} does not work with fmake
  5047. . for _target in ${_entry:C/^[0-9]+://}
  5048. . if ${TARGET_ORDER_OVERRIDE:M*\:${_target}}
  5049. _tmp_seq:= ${_tmp_seq} ${TARGET_ORDER_OVERRIDE:M*\:${_target}}
  5050. . else
  5051. _tmp_seq:= ${_tmp_seq} ${_entry}
  5052. . endif
  5053. . endfor
  5054. . endfor
  5055. _${_t}_SEQ:= ${_tmp_seq}
  5056. . endif
  5057. . for s in ${_${_t}_SEQ:O:C/^[0-9]+://}
  5058. . if target(${s})
  5059. . if ! ${NOTPHONY:M${s}}
  5060. _PHONY_TARGETS+= ${s}
  5061. . endif
  5062. _${_t}_REAL_SEQ+= ${s}
  5063. . endif
  5064. . endfor
  5065. . for s in ${_${_t}_SUSEQ:O:C/^[0-9]+://}
  5066. . if target(${s})
  5067. . if ! ${NOTPHONY:M${s}}
  5068. _PHONY_TARGETS+= ${s}
  5069. . endif
  5070. _${_t}_REAL_SUSEQ+= ${s}
  5071. . endif
  5072. . endfor
  5073. .ORDER: ${_${_t}_DEP} ${_${_t}_REAL_SEQ}
  5074. . endfor
  5075. # Define all of the main targets which depend on a sequence of other targets.
  5076. # See above *_SEQ and *_DEP. The _DEP will run before this defined target is
  5077. # ran. The _SEQ will run as this target once _DEP is satisfied.
  5078. . for target in extract patch configure build stage install package
  5079. # Check if config dialog needs to show and execute it if needed. If is it not
  5080. # needed (_OPTIONS_OK), then just depend on the cookie which is defined later
  5081. # to depend on the *_DEP and execute the *_SEQ.
  5082. # If options are required, execute config-conditional and then re-execute the
  5083. # target noting that config is no longer needed.
  5084. . if !target(${target}) && defined(_OPTIONS_OK)
  5085. _PHONY_TARGETS+= ${target}
  5086. ${target}: ${${target:tu}_COOKIE}
  5087. . elif !target(${target})
  5088. ${target}: config-conditional
  5089. @cd ${.CURDIR} && ${MAKE} CONFIG_DONE_${PKGBASE:tu}=1 ${${target:tu}_COOKIE}
  5090. . elif target(${target}) && defined(IGNORE)
  5091. . endif
  5092. . if !exists(${${target:tu}_COOKIE})
  5093. # Define the real target behavior. Depend on the target's *_DEP. Execute
  5094. # the target's *_SEQ. Also handle su and USE_SUBMAKE needs.
  5095. . if ${UID} != 0 && defined(_${target:tu}_REAL_SUSEQ) && !defined(INSTALL_AS_USER)
  5096. . if defined(USE_SUBMAKE)
  5097. ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
  5098. @cd ${.CURDIR} && ${MAKE} ${_${target:tu}_REAL_SEQ}
  5099. . else # !USE_SUBMAKE
  5100. ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ}
  5101. . endif # USE_SUBMAKE
  5102. @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
  5103. @cd ${.CURDIR} && \
  5104. ${SU_CMD} "${MAKE} ${_${target:tu}_REAL_SUSEQ}"
  5105. @${ECHO_MSG} "===> Returning to user credentials"
  5106. @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
  5107. . else # No SU needed
  5108. . if defined(USE_SUBMAKE)
  5109. ${${target:tu}_COOKIE}: ${_${target:tu}_DEP}
  5110. @cd ${.CURDIR} && \
  5111. ${MAKE} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
  5112. @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
  5113. . else # !USE_SUBMAKE
  5114. ${${target:tu}_COOKIE}: ${_${target:tu}_DEP} ${_${target:tu}_REAL_SEQ} ${_${target:tu}_REAL_SUSEQ}
  5115. @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
  5116. . endif # USE_SUBMAKE
  5117. . endif # SU needed
  5118. . else # exists(cookie)
  5119. ${${target:tu}_COOKIE}::
  5120. @if [ ! -e ${.TARGET} ]; then \
  5121. cd ${.CURDIR} && ${MAKE} ${.TARGET}; \
  5122. fi
  5123. . endif # !exists(cookie)
  5124. . endfor # foreach(targets)
  5125. .PHONY: ${_PHONY_TARGETS} check-sanity fetch pkg
  5126. . if !target(check-sanity)
  5127. check-sanity: ${_SANITY_REAL_SEQ}
  5128. . endif
  5129. . if !target(fetch)
  5130. fetch: ${_FETCH_DEP} ${_FETCH_REAL_SEQ}
  5131. . endif
  5132. . if !target(pkg)
  5133. pkg: ${_PKG_DEP} ${_PKG_REAL_SEQ}
  5134. . endif
  5135. . if !target(test)
  5136. test: ${_TEST_DEP}
  5137. . if !defined(NO_TEST)
  5138. test: ${_TEST_REAL_SEQ}
  5139. . endif
  5140. . endif
  5141. . endif
  5142. # End of post-makefile section.
  5143. .endif
  5144. # End of the DESTDIR if statement