programmer.lout 193 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539
  1. @SysInclude{ fontdefs }
  2. @SysInclude{ langdefs }
  3. @SysInclude{ dl }
  4. @SysInclude{ docf }
  5. @Use { @DocumentLayout
  6. @ParaGap { 1.70vx }
  7. @InitialBreak { 1.0fx ragged hyphen }
  8. @PageHeaders { Titles }
  9. @OptimizePages { Yes }
  10. @RunningEvenTop { @B { @PageNum } }
  11. @RunningOddTop { @Right { @B { @PageNum } } }
  12. @RunningEvenFoot { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 @Right { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual } }
  13. @RunningOddFoot { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual @Right { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 } }
  14. @RunningStartEvenTop { @Null }
  15. @RunningStartOddTop { @Null }
  16. @RunningStartEvenFoot { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 @Right { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual } }
  17. @RunningStartOddFoot { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual @Right { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 } }
  18. # @RunningEvenTop { @B { @PageNum } @Centre { } @Right { @MinorNum } }
  19. # @RunningOddTop { @MinorNum @Centre { @MinorTitle } @Right { @B { @PageNum } } }
  20. # @RunningEvenFoot { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 @Right { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual } }
  21. # @RunningOddFoot { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual @Right { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 } }
  22. # @RunningStartEvenTop { @Null }
  23. # @RunningStartOddTop { @Null }
  24. # @RunningStartEvenFoot { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 @Right { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual } }
  25. # @RunningStartOddFoot { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual @Right { version 0.2.0.0 (dpkg 1.3.7), 23 August 1996 } }
  26. }
  27. @Use { @OrdinaryLayout }
  28. @Doc @Text @Begin
  29. @CenteredDisplay {clines 1.3v} @Break {
  30. +5p @Font Bold @Font { {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers' manual }
  31. -2p @Font { Ian Jackson {{0.7 1.0} @Scale {Courier Bold} @Font {<"ijackson@gnu.ai.mit.edu">}} }
  32. version 0.2.0.0 (dpkg 1.3.7), 23 August 1996
  33. }
  34. @LP
  35. @CNP
  36. {
  37. newpath 0 ysize 0.3 ft sub moveto
  38. xsize 0 rlineto
  39. 0 0.1 ft rlineto
  40. xsize neg 0 rlineto
  41. closepath fill
  42. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break {
  43. 0.1.|0.5fe{ Abstract}}}} |0f }} //0.0fe
  44. @LP
  45. This manual describes the technical aspects of creating Debian binary
  46. and source packages. It also documents the interface between
  47. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} and its access method scripts. It does not deal with
  48. the Debian Project policy requirements, and it assumes familiarity
  49. with {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s functions from the system administrator's
  50. perspective.
  51. @LP
  52. @CNP
  53. {
  54. newpath 0 ysize 0.3 ft sub moveto
  55. xsize 0 rlineto
  56. 0 0.1 ft rlineto
  57. xsize neg 0 rlineto
  58. closepath fill
  59. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break {
  60. 0.2.|0.5fe{ Contents}}}} |0f }} //0.0fe
  61. //1vx//0.3vx Bold @Font @HAdjust { @HContract { { 1. } |5fx {Introduction and scope of this manual} } |2f @PageOf { ch-scope } } //1.00vx
  62. //0.3vx Bold @Font @HAdjust { @HContract { { 2. } |5fx {Binary packages} } |2f @PageOf { ch-binarypkg } } //1.00vx
  63. @HAdjust { @HContract { { 2.1. } |5fx {Creating package files "-" {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}}} } |2f @PageOf { s-bincreating } } //0.95vx
  64. @HAdjust { @HContract { { 2.2. } |5fx {Package control information files} } |2f @PageOf { s-controlarea } } //0.95vx
  65. @HAdjust { @HContract { { 2.3. } |5fx {The main control information file: {{0.7 1.0} @Scale {Courier Bold} @Font {control}}} } |2f @PageOf { s-controlfile } } //0.95vx
  66. //0.3vx Bold @Font @HAdjust { @HContract { { 3. } |5fx {Source packages} } |2f @PageOf { ch-sourcepkg } } //1.00vx
  67. @HAdjust { @HContract { { 3.1. } |5fx {Tools for processing source packages} } |2f @PageOf { s-sourcetools } } //0.95vx
  68. @HAdjust { @HContract { { 3.2. } |5fx {The Debianised source tree} } |2f @PageOf { s-sourcetree } } //0.95vx
  69. @HAdjust { @HContract { { 3.3. } |5fx {Source packages as archives} } |2f @PageOf { s-sourcearchives } } //0.95vx
  70. @HAdjust { @HContract { { 3.4. } |5fx {Unpacking a Debian source package without {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}}} } |2f @PageOf { s3.4 } } //0.95vx
  71. //0.3vx Bold @Font @HAdjust { @HContract { { 4. } |5fx {Control files and their fields} } |2f @PageOf { ch-controlfields } } //1.00vx
  72. @HAdjust { @HContract { { 4.1. } |5fx {Syntax of control files} } |2f @PageOf { s4.1 } } //0.95vx
  73. @HAdjust { @HContract { { 4.2. } |5fx {List of fields
  74. } } |2f @PageOf { s4.2 } } //0.95vx
  75. //0.3vx Bold @Font @HAdjust { @HContract { { 5. } |5fx {Version numbering} } |2f @PageOf { ch-versions } } //1.00vx
  76. //0.3vx Bold @Font @HAdjust { @HContract { { 6. } |5fx {Package maintainer scripts
  77. and installation procedure} } |2f @PageOf { ch-maintainerscripts } } //1.00vx
  78. @HAdjust { @HContract { { 6.1. } |5fx {Introduction to package maintainer scripts} } |2f @PageOf { s6.1 } } //0.95vx
  79. @HAdjust { @HContract { { 6.2. } |5fx {Summary of ways maintainer scripts are called} } |2f @PageOf { s-mscriptsinstact } } //0.95vx
  80. @HAdjust { @HContract { { 6.3. } |5fx {Details of unpack phase of installation or upgrade} } |2f @PageOf { s6.3 } } //0.95vx
  81. @HAdjust { @HContract { { 6.4. } |5fx {Details of configuration} } |2f @PageOf { s6.4 } } //0.95vx
  82. @HAdjust { @HContract { { 6.5. } |5fx {Details of removal "and/or" configuration purging} } |2f @PageOf { s6.5 } } //0.95vx
  83. //0.3vx Bold @Font @HAdjust { @HContract { { 7. } |5fx {Descriptions of packages "-" the
  84. {{0.7 1.0} @Scale {Courier Bold} @Font {Description}} field} } |2f @PageOf { ch-descriptions } } //1.00vx
  85. @HAdjust { @HContract { { 7.1. } |5fx {Types of formatting line in the extended description} } |2f @PageOf { s7.1 } } //0.95vx
  86. @HAdjust { @HContract { { 7.2. } |5fx {Notes about writing descriptions} } |2f @PageOf { s7.2 } } //0.95vx
  87. @HAdjust { @HContract { { 7.3. } |5fx {Example description in control file for Smail} } |2f @PageOf { s7.3 } } //0.95vx
  88. //0.3vx Bold @Font @HAdjust { @HContract { { 8. } |5fx {Declaring relationships between packages} } |2f @PageOf { ch-relationships } } //1.00vx
  89. @HAdjust { @HContract { { 8.1. } |5fx {Syntax of relationship fields} } |2f @PageOf { s-depsyntax } } //0.95vx
  90. @HAdjust { @HContract { { 8.2. } |5fx {Dependencies "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}} } |2f @PageOf { s8.2 } } //0.95vx
  91. @HAdjust { @HContract { { 8.3. } |5fx {Alternative packages "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}}} } |2f @PageOf { s-conflicts } } //0.95vx
  92. @HAdjust { @HContract { { 8.4. } |5fx {Virtual packages "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}}} } |2f @PageOf { s-virtual } } //0.95vx
  93. @HAdjust { @HContract { { 8.5. } |5fx {{{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} "-" overwriting files and replacing packages} } |2f @PageOf { s-replaces } } //0.95vx
  94. @HAdjust { @HContract { { 8.6. } |5fx {Defaults for satisfying dependencies "-" ordering} } |2f @PageOf { s8.6 } } //0.95vx
  95. //0.3vx Bold @Font @HAdjust { @HContract { { 9. } |5fx {Configuration file handling} } |2f @PageOf { ch-conffiles } } //1.00vx
  96. @HAdjust { @HContract { { 9.1. } |5fx {Automatic handling of configuration files by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}} } |2f @PageOf { s9.1 } } //0.95vx
  97. @HAdjust { @HContract { { 9.2. } |5fx {"Fully-featured" maintainer script configuration handling} } |2f @PageOf { s9.2 } } //0.95vx
  98. //0.3vx Bold @Font @HAdjust { @HContract { { 10. } |5fx {Alternative versions of an interface "-"
  99. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives"}}} } |2f @PageOf { ch-alternatives } } //1.00vx
  100. //0.3vx Bold @Font @HAdjust { @HContract { { 11. } |5fx {Diversions "-" overriding a package's version of a file} } |2f @PageOf { ch-diversions } } //1.00vx
  101. //0.3vx Bold @Font @HAdjust { @HContract { { 12. } |5fx {Shared libraries} } |2f @PageOf { ch-sharedlibs } } //1.00vx
  102. //0.3vx Bold @Font @HAdjust { @HContract { { 13. } |5fx {Configuration of {{0.7 1.0} @Scale {Courier Bold} @Font {init}}} } |2f @PageOf { ch-sysvinit } } //1.00vx
  103. @HAdjust { @HContract { { 13.1. } |5fx {Introduction to the {{0.7 1.0} @Scale {Courier Bold} @Font {init.d}} scheme} } |2f @PageOf { s13.1 } } //0.95vx
  104. @HAdjust { @HContract { { 13.2. } |5fx {Writing {{0.7 1.0} @Scale {Courier Bold} @Font {init.d}} scripts} } |2f @PageOf { s13.2 } } //0.95vx
  105. @HAdjust { @HContract { { 13.3. } |5fx {Managing the {{0.7 1.0} @Scale {Courier Bold} @Font {rc{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} links "-" {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}}} } |2f @PageOf { s13.3 } } //0.95vx
  106. @HAdjust { @HContract { { 13.4. } |5fx {"Boot-time" initialisation "-" {{0.7 1.0} @Scale {Courier Bold} @Font {rc.boot}}} } |2f @PageOf { s13.4 } } //0.95vx
  107. @HAdjust { @HContract { { 13.5. } |5fx {Notes} } |2f @PageOf { s13.5 } } //0.95vx
  108. @HAdjust { @HContract { { 13.6. } |5fx {Example} } |2f @PageOf { s13.6 } } //0.95vx
  109. //0.3vx Bold @Font @HAdjust { @HContract { { 14. } |5fx {{{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s interface to its installation methods} } |2f @PageOf { ch-methif } } //1.00vx
  110. @HAdjust { @HContract { { 14.1. } |5fx {Functions of the method scripts} } |2f @PageOf { s14.1 } } //0.95vx
  111. @HAdjust { @HContract { { 14.2. } |5fx {Location and arguments of the method scripts} } |2f @PageOf { s14.2 } } //0.95vx
  112. @LP
  113. @CNP
  114. {
  115. newpath 0 ysize 0.3 ft sub moveto
  116. xsize 0 rlineto
  117. 0 0.1 ft rlineto
  118. xsize neg 0 rlineto
  119. closepath fill
  120. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break {
  121. 0.3.|0.5fe{ Copyright Notice}}}} |0f }} //0.0fe
  122. @LP
  123. Copyright ©1996 Ian Jackson.
  124. @LP
  125. This manual is free software; you may redistribute it "and/or" modify it
  126. under the terms of the GNU General Public License as published by the
  127. Free Software Foundation; either version 2, or (at your option) any
  128. later version.
  129. @LP
  130. This is distributed in the hope that it will be useful, but
  131. {{Times Slope} @Font {without any warranty}}; without even the implied warranty of
  132. merchantability or fitness for a particular purpose. See the GNU
  133. General Public License for more details.
  134. @LP
  135. You should have received a copy of the GNU General Public License with
  136. your Debian "GNU/Linux" system, in {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/doc/copyright/GPL"}}, or
  137. with the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} source package as the file {{0.7 1.0} @Scale {Courier Bold} @Font {COPYING}}. If
  138. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  139. Cambridge, MA 02139, USA.
  140. @LP
  141. @NP
  142. {
  143. newpath 0 ysize 0.3 ft sub moveto
  144. xsize 0 rlineto
  145. 0 0.2 ft rlineto
  146. xsize neg 0 rlineto
  147. closepath fill
  148. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-scope}
  149. 1.|0.5fe{ Introduction and scope of this manual}}}} |0f }} //0.0fe
  150. @LP
  151. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} is a suite of programs for creating binary package files
  152. and installing and removing them on Unix systems.{@FootNote{ {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  153. is targetted primarily at Debian "GNU/Linux," but may work on or be
  154. ported to other systems.}}
  155. @LP
  156. The binary packages are designed for the management of installed
  157. executable programs (usually compiled binaries) and their associated
  158. data, though source code examples and documentation are provided as
  159. part of some packages.
  160. @LP
  161. This manual describes the technical aspects of creating Debian binary
  162. packages ({{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} files). It documents the behaviour of the
  163. package management programs {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}, {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} et al. and and the
  164. way they interact with packages.
  165. @LP
  166. It also documents the interaction between {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s core and the
  167. access method scripts it uses to actually install the selected
  168. packages, and describes how to create a new access method.
  169. @LP
  170. This manual does not go into detail about the options and usage of the
  171. package building and installation tools. It should therefore be read
  172. in conjuction with those programs' manpages.
  173. @LP
  174. The utility programs which are provided with {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} for managing
  175. various system configuration and similar issues, such as
  176. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"install"--"info"}}, are not described in
  177. detail here "-" please see their manpages.
  178. @LP
  179. It does {{Times Slope} @Font {not}} describe the policy requirements imposed on Debian
  180. packages, such as the permissions on files and directories,
  181. documentation requirements, upload procedure, and so on. You should
  182. see the Debian packaging policy manual for these details. (Many of
  183. them will probably turn out to be helpful even if you don't plan to
  184. upload your package and make it available as part of the
  185. distribution.)
  186. @LP
  187. It is assumed that the reader is reasonably familiar with the
  188. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} System Administrators' manual. Unfortunately this manual
  189. does not yet exist.
  190. @LP
  191. The Debian version of the FSF's GNU hello program is provided as an
  192. example for people wishing to create Debian packages.
  193. @LP
  194. {{Times Slope} @Font {Note that this document is still a draft!}}
  195. @LP
  196. @NP
  197. {
  198. newpath 0 ysize 0.3 ft sub moveto
  199. xsize 0 rlineto
  200. 0 0.2 ft rlineto
  201. xsize neg 0 rlineto
  202. closepath fill
  203. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-binarypkg}
  204. 2.|0.5fe{ Binary packages}}}} |0f }} //0.0fe
  205. @LP
  206. The binary package has two main sections. The first part consists of
  207. various control information files and scripts used by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} when
  208. installing and removing. See `Package control information files', page @PageOf{s-controlarea}.
  209. @LP
  210. The second part is an archive (currently a {{0.7 1.0} @Scale {Courier Bold} @Font {tar}} archive)
  211. containing files and directories to be installed.
  212. @LP
  213. In the future binary packages may also contain other components, such
  214. as checksums and digital signatures.
  215. @LP
  216. @CNP
  217. {
  218. newpath 0 ysize 0.3 ft sub moveto
  219. xsize 0 rlineto
  220. 0 0.1 ft rlineto
  221. xsize neg 0 rlineto
  222. closepath fill
  223. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-bincreating}
  224. 2.1.|0.5fe{ Creating package files "-" {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}}}}}} |0f }} //0.0fe
  225. @LP
  226. All manipulation of binary package files is done by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}};
  227. it's the only program that has knowledge of the format.
  228. ({{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}} may be invoked by calling {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}, as {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will
  229. spot that the options requested are appropriate to {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}} and
  230. invoke that instead with the same arguments.)
  231. @LP
  232. In order to create a binary package you must make a directory tree
  233. which contains all the files and directories you want to have in the
  234. filesystem data part of the package. In "Debian-format" source packages
  235. this directory is usually {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/tmp"}}, relative to the top of
  236. the package's source tree.
  237. @LP
  238. They should have the locations (relative to the root of the directory
  239. tree you're constructing) ownerships and permissions which you want
  240. them to have on the system when they are installed.
  241. @LP
  242. With current versions of {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} the "uid/username" and "gid/groupname"
  243. mappings for the users and groups being used should be the same on the
  244. system where the package is built and the one where it is installed.
  245. @LP
  246. You need to add one special directory to the root of the miniature
  247. filesystem tree you're creating: {{0.7 1.0} @Scale {Courier Bold} @Font {DEBIAN}}. It should contain the
  248. control information files, notably the binary package control file
  249. (see `The main control information file: {{0.7 1.0} @Scale {Courier Bold} @Font {control}}', page @PageOf{s-controlfile}).
  250. @LP
  251. The {{0.7 1.0} @Scale {Courier Bold} @Font {DEBIAN}} directory will not appear in the filesystem archive of
  252. the package, and so won't be installed by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} when the package
  253. is installed.
  254. @LP
  255. When you've prepared the package, you should invoke:
  256. //1.0vx
  257. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  258. dpkg ""--""--"build" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {directory}}}}}}} //0.2fe
  259. @LP
  260. This will build the package in {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {directory}}}}.deb}}.
  261. ({{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} knows that {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"build"}} is a {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}} option, so it
  262. invokes {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}} with the same arguments to build the package.)
  263. @LP
  264. See the manpage {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb(8)"}} for details of how
  265. to examine the contents of this "newly-created" file. You may find the
  266. output of following commands enlightening:
  267. //1.0vx
  268. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  269. "dpkg"--"deb" ""--""--"info" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {filename}}}}.deb
  270. "dpkg"--"deb" ""--""--"contents" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {filename}}}}.deb}}} //0.2fe
  271. @LP
  272. @CNP
  273. {
  274. newpath 0 ysize 0.3 ft sub moveto
  275. xsize 0 rlineto
  276. 0 0.1 ft rlineto
  277. xsize neg 0 rlineto
  278. closepath fill
  279. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-controlarea}
  280. 2.2.|0.5fe{ Package control information files}}}} |0f }} //0.0fe
  281. @LP
  282. The control information portion of a binary package is a collection of
  283. files with names known to {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}. It will treat the contents of
  284. these files specially "-" some of them contain information used by
  285. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} when installing or removing the package; others are scripts
  286. which the package maintainer wants {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} to run.
  287. @LP
  288. It is possible to put other files in the package control area, but
  289. this is not generally a good idea (though they will largely be
  290. ignored).
  291. @LP
  292. Here is a brief list of the control info files supported by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  293. and a summary of what they're used for.
  294. @LP
  295. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {control}}}}
  296. //1.0vx
  297. @RawIndentedDisplay {
  298. This is the key description file used by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}. It specifies the
  299. package's name and version, gives its description for the user, states
  300. its relationships with other packages, and so forth.
  301. See `The main control information file: {{0.7 1.0} @Scale {Courier Bold} @Font {control}}', page @PageOf{s-controlfile}.
  302. @LP
  303. It is usually generated automatically from information in the source
  304. package by the {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} program, and with assistance
  305. from {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}}. See `Tools for processing source packages', page @PageOf{s-sourcetools}.
  306. }
  307. //0fe //1.2fx
  308. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {postinst}}, {{0.7 1.0} @Scale {Courier Bold} @Font {preinst}}, {{0.7 1.0} @Scale {Courier Bold} @Font {postrm}}, {{0.7 1.0} @Scale {Courier Bold} @Font {prerm}}}}
  309. //1.0vx
  310. @RawIndentedDisplay {
  311. These are exectuable files (usually scripts) which {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} runs
  312. during installation, upgrade and removal of packages. They allow the
  313. package to deal with matters which are particular to that package or
  314. require more complicated processing than that provided by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}.
  315. Details of when and how they are called are in
  316. `Package maintainer scripts
  317. and installation procedure', page @PageOf{ch-maintainerscripts}.
  318. @LP
  319. It is very important to make these scripts itempotent.{@FootNote{ That
  320. means that if it runs successfully or fails and then you call it again
  321. it doesn't bomb out, but just ensures that everything is the way it
  322. ought to be.}} This is so that if an error occurs, the user
  323. interrupts {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} or some other unforeseen circumstance happens you
  324. don't leave the user with a "badly-broken" package.
  325. @LP
  326. The maintainer scripts are guaranteed to run with a controlling
  327. terminal and can interact with the user. If they need to prompt for
  328. passwords, do "full-screen" interaction or something similar you should
  329. do these things to and from {{0.7 1.0} @Scale {Courier Bold} @Font {"/dev/tty"}}, since {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will at
  330. some point redirect scripts' standard input and output so that it can
  331. log the installation process. Likewise, because these scripts may be
  332. executed with standard output redirected into a pipe for logging
  333. purposes, Perl scripts should set unbuffered output by setting
  334. {{0.7 1.0} @Scale {Courier Bold} @Font {"$|=1"}} so that the output is printed immediately rather than being
  335. buffered.
  336. @LP
  337. Each script should return a zero exit status for success, or a nonzero
  338. one for failure.
  339. }
  340. //0fe //1.2fx
  341. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {conffiles}}}}
  342. //1.0vx
  343. @RawIndentedDisplay {
  344. This file contains a list of configuration files which are to be
  345. handled automatically by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} (see `Configuration file handling', page @PageOf{ch-conffiles}). Note
  346. that not necessarily every configuration file should be listed here.
  347. }
  348. //0fe //1.2fx
  349. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {shlibs}}}}
  350. //1.0vx
  351. @RawIndentedDisplay {
  352. This file contains a list of the shared libraries supplied by the
  353. package, with dependency details for each. This is used by
  354. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} when it determines what dependencies are
  355. required in a package control file.
  356. @LP
  357. Each line is of the form:
  358. //1.0vx
  359. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  360. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"library"--"name"}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"version"--"or"--"soname"}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {dependencies ...}}}}}}} //0.2fe
  361. @LP
  362. {{Times Slope} @Font {"library-name"}} is the name of the shared library, for example
  363. {{0.7 1.0} @Scale {Courier Bold} @Font {libc5}}.
  364. @LP
  365. {{Times Slope} @Font {"version-or-soname"}} is the soname of the library "-" ie, the thing
  366. that must exactly match for the library to be recognised by
  367. {{0.7 1.0} @Scale {Courier Bold} @Font {ld.so}}. Usually this is major version number of the library.
  368. @LP
  369. {{Times Slope} @Font {dependencies}} has the same syntax as a dependency field in a
  370. binary package control file. It should give details of which
  371. package(s) are required to satisfy a binary built against the version
  372. of the library contained in the package. See `Syntax of relationship fields', page @PageOf{s-depsyntax}.
  373. @LP
  374. For example, if the package {{0.7 1.0} @Scale {Courier Bold} @Font {foo}} contains {{0.7 1.0} @Scale {Courier Bold} @Font {libfoo.so.1.2.3}},
  375. where the soname of the library is {{0.7 1.0} @Scale {Courier Bold} @Font {libfoo.so.1}}, and the first
  376. version of the package which contained a minor number of at least
  377. {{0.7 1.0} @Scale {Courier Bold} @Font {2.3}} was {{Times Slope} @Font {"1.2.3-1"}}, then the package's {{Times Slope} @Font {shlibs}} could
  378. say:
  379. //1.0vx
  380. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  381. libfoo 1 foo (>= "1.2.3"--"1)"}}} //0.2fe
  382. @LP
  383. The "version-specific" dependency is to avoid warnings from {{0.7 1.0} @Scale {Courier Bold} @Font {ld.so}}
  384. about using older shared libraries with newer binaries.
  385. }
  386. //0fe
  387. @LP
  388. @CNP
  389. {
  390. newpath 0 ysize 0.3 ft sub moveto
  391. xsize 0 rlineto
  392. 0 0.1 ft rlineto
  393. xsize neg 0 rlineto
  394. closepath fill
  395. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-controlfile}
  396. 2.3.|0.5fe{ The main control information file: {{0.7 1.0} @Scale {Courier Bold} @Font {control}}}}}} |0f }} //0.0fe
  397. @LP
  398. The most important control information file used by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} when it
  399. installs a package is {{0.7 1.0} @Scale {Courier Bold} @Font {control}}. It contains all the package's
  400. `vital statistics'.
  401. @LP
  402. The binary package control files of packages built from Debian sources
  403. are made by a special tool, {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}}, which reads
  404. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/control"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/changelog"}} to find the
  405. information it needs. See `Source packages', page @PageOf{ch-sourcepkg} for more details.
  406. @LP
  407. The fields in binary package control files are:
  408. //1.0vx
  409. {@RawBulletList
  410. gap { 1.0vx }
  411. @ListItem {
  412. {{0.7 1.0} @Scale {Courier Bold} @Font {Package}} (mandatory)
  413. }
  414. @ListItem {
  415. {{0.7 1.0} @Scale {Courier Bold} @Font {Version}} (mandatory)
  416. }
  417. @ListItem {
  418. {{0.7 1.0} @Scale {Courier Bold} @Font {Architecture}}
  419. (mandatory){@FootNote{ This field should appear in all packages, though
  420. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} doesn't require it yet so that old packages can still be
  421. installed.}}
  422. }
  423. @ListItem {
  424. {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}} et al.
  425. }
  426. @ListItem {
  427. {{0.7 1.0} @Scale {Courier Bold} @Font {Essential}}
  428. }
  429. @ListItem {
  430. {{0.7 1.0} @Scale {Courier Bold} @Font {Maintainer}}
  431. }
  432. @ListItem {
  433. {{0.7 1.0} @Scale {Courier Bold} @Font {Section}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}}
  434. }
  435. @ListItem {
  436. {{0.7 1.0} @Scale {Courier Bold} @Font {Source}}
  437. }
  438. @ListItem {
  439. {{0.7 1.0} @Scale {Courier Bold} @Font {Description}}
  440. }
  441. @ListItem {
  442. {{0.7 1.0} @Scale {Courier Bold} @Font {"Installed"--"Size"}}
  443. }
  444. @RawEndList}//0ve
  445. @LP
  446. A description of the syntax of control files and the purpose of these
  447. fields is available in `Control files and their fields', page @PageOf{ch-controlfields}.
  448. @LP
  449. @NP
  450. {
  451. newpath 0 ysize 0.3 ft sub moveto
  452. xsize 0 rlineto
  453. 0 0.2 ft rlineto
  454. xsize neg 0 rlineto
  455. closepath fill
  456. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-sourcepkg}
  457. 3.|0.5fe{ Source packages}}}} |0f }} //0.0fe
  458. @LP
  459. The Debian binary packages in the distribution are generated from
  460. Debian sources, which are in a special format to assist the easy and
  461. automatic building of binaries.
  462. @LP
  463. @CNP
  464. {
  465. newpath 0 ysize 0.3 ft sub moveto
  466. xsize 0 rlineto
  467. 0 0.1 ft rlineto
  468. xsize neg 0 rlineto
  469. closepath fill
  470. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-sourcetools}
  471. 3.1.|0.5fe{ Tools for processing source packages}}}} |0f }} //0.0fe
  472. @LP
  473. Various tools are provided for manipulating source packages; they pack
  474. and unpack sources and help build of binary packages and help manage
  475. the distribution of new versions.
  476. @LP
  477. They are introduced and typical uses described here; see {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source(1)"}} for full documentation about their
  478. arguments and operation.
  479. @LP
  480. For examples of how to construct a Debian source package, and how to
  481. use those utilities that are used by Debian source packages, please
  482. see the {{0.7 1.0} @Scale {Courier Bold} @Font {hello}} example package.
  483. @LP
  484. @CNP
  485. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.1}
  486. 3.1.1.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} "-" packs and unpacks Debian source packages}}}//0.2fe
  487. @LP
  488. This program is frequently used by hand, and is also called from
  489. "package-independent" automated building scripts such as
  490. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"buildpackage"}}.
  491. @LP
  492. To unpack a package it is typically invoked with
  493. //1.0vx
  494. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  495. "dpkg"--"source" ""--"x" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {".../path/to/filename"}}}}.dsc}}} //0.2fe
  496. with the {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {filename}}}}.tar.gz}} and
  497. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {filename}}}}.diff.gz}} (if applicable) in the same directory. It
  498. unpacks into {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}}, and if applicable
  499. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}.orig}}, in the current directory.
  500. @LP
  501. To create a packed source archive it is typically invoked:
  502. //1.0vx
  503. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  504. "dpkg"--"source" ""--"b" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}}} //0.2fe
  505. This will create the {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}}, {{0.7 1.0} @Scale {Courier Bold} @Font {.tar.gz}} and {{0.7 1.0} @Scale {Courier Bold} @Font {.diff.gz}} (if
  506. appropriate) in the current directory. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} does not
  507. clean the source tree first "-" this must be done separately if it is
  508. required.
  509. @LP
  510. See also `Source packages as archives', page @PageOf{s-sourcearchives}.
  511. @LP
  512. @CNP
  513. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.2}
  514. 3.1.2.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"buildpackage"}} "-" overall "package-building" control
  515. script}}}//0.2fe
  516. @LP
  517. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"buildpackage"}} is a script which invokes {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}},
  518. the {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} targets {{0.7 1.0} @Scale {Courier Bold} @Font {clean}}, {{0.7 1.0} @Scale {Courier Bold} @Font {build}} and
  519. {{0.7 1.0} @Scale {Courier Bold} @Font {binary}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {pgp}} to build a signed
  520. source and binary package upload.
  521. @LP
  522. It is usually invoked by hand from the top level of the built or
  523. unbuilt source directory. It may be invoked with no arguments; useful
  524. arguments include:
  525. //1.0vx
  526. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {""--"uc"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {""--"us"}}}}
  527. //1.0vx
  528. {|2f {
  529. Do not "PGP-sign" the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file or the source package
  530. {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}} file, respectively.
  531. }}
  532. //1.0vx
  533. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {""--"p"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"pgp-command"}}}}}}}}
  534. //1.0vx
  535. {|2f {
  536. Invoke {{Times Slope} @Font {"pgp-command"}} instead of finding {{0.7 1.0} @Scale {Courier Bold} @Font {pgp}} on the
  537. {{0.7 1.0} @Scale {Courier Bold} @Font {PATH}}. {{Times Slope} @Font {"pgp-command"}} must behave just like {{0.7 1.0} @Scale {Courier Bold} @Font {pgp}}.
  538. }}
  539. //1.0vx
  540. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {""--"r"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"root-command"}}}}}}}}
  541. //1.0vx
  542. {|2f {
  543. When root privilege is required, invoke the command
  544. {{Times Slope} @Font {"root-command"}}. {{Times Slope} @Font {"root-command"}} should invoke its first
  545. argument as a command, from the {{0.7 1.0} @Scale {Courier Bold} @Font {PATH}} if necessary, and pass its
  546. second and subsequent arguments to the command it calls. If no
  547. {{Times Slope} @Font {"root-command"}} is supplied then {{Times Slope} @Font {"dpkg-buildpackage"}} will take
  548. no special action to gain root privilege, so that for most packages it
  549. will have to be invoked as root to start with.
  550. }}
  551. //1.0vx
  552. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {""--"b"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {""--"B"}}}}
  553. //1.0vx
  554. {|2f {
  555. Two types of "binary-only" build and upload "-" see {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source(1)"}}.
  556. }}
  557. //0.2fe
  558. @LP
  559. @CNP
  560. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.3}
  561. 3.1.3.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} "-" generates binary package control files}}}//0.2fe
  562. @LP
  563. This program is usually called from {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} (see `The Debianised source tree', page @PageOf{s-sourcetree}) in the top level of the source tree.
  564. @LP
  565. This is usually done just before the files and directories in the
  566. temporary directory tree where the package is being built have their
  567. permissions and ownerships set and the package is constructed using
  568. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}}{@FootNote{ This is so that the control file which is
  569. produced has the right permissions}}.
  570. @LP
  571. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} must be called after all the files which are to
  572. go into the package have been placed in the temporary build directory,
  573. so that its calculation of the installed size of a package is correct.
  574. @LP
  575. It is also necessary for {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} to be run after
  576. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} so that the variable substitutions created by
  577. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} in {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}} are available.
  578. @LP
  579. For a package which generates only one binary package, and which
  580. builds it in {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/tmp"}} relative to the top of the source
  581. package, it is usually sufficient to call:
  582. //1.0vx
  583. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  584. "dpkg"--"gencontrol"}}} //0.2fe
  585. @LP
  586. Sources which build several binaries will typically need something
  587. like:
  588. //1.0vx
  589. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  590. "dpkg"--"gencontrol" ""--"Pdebian/tmp"--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {pkg}}}} ""--"p"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}}}} //0.2fe
  591. The {{0.7 1.0} @Scale {Courier Bold} @Font {""--"P"}} tells {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} that the package is being
  592. built in a "non-default" directory, and the {{0.7 1.0} @Scale {Courier Bold} @Font {""--"p"}} tells it which
  593. package's control file should be generated.
  594. @LP
  595. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} also adds information to the list of files in
  596. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/files"}}, for the benefit of (for example) a future
  597. invocation of {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}}.
  598. @LP
  599. @CNP
  600. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.4}
  601. 3.1.4.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} "-" calculates shared library dependencies}}}//0.2fe
  602. @LP
  603. This program is usually called from {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} just before
  604. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} (see `The Debianised source tree', page @PageOf{s-sourcetree}), in the top level
  605. of the source tree.
  606. @LP
  607. Its arguments are executables{@FootNote{ They may be specified either
  608. in the locations in the source tree where they are created or in the
  609. locations in the temporary build tree where they are installed prior
  610. to binary package creation.}} for which shared library
  611. dependencies should be included in the binary package's control file.
  612. @LP
  613. If some of the executable(s) shared libraries should only warrant a
  614. {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}} or {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}}, or if some warrant a
  615. {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}, this can be achieved by using the
  616. {{0.7 1.0} @Scale {Courier Bold} @Font {""--"d"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"dependency-field"}}}}}} option before those executable(s).
  617. (Each {{0.7 1.0} @Scale {Courier Bold} @Font {""--"d"}} option takes effect until the next {{0.7 1.0} @Scale {Courier Bold} @Font {""--"d"}}.)
  618. @LP
  619. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} does not directly cause the output control file
  620. to be modified. Instead by default it adds to the
  621. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}} file variable settings like
  622. {{0.7 1.0} @Scale {Courier Bold} @Font {shlibs:Depends}}. These variable settings must be referenced in
  623. dependency fields in the appropriate "per-binary-package" sections of
  624. the source control file.
  625. @LP
  626. For example, the {{0.7 1.0} @Scale {Courier Bold} @Font {procps}} package generates two kinds of
  627. binaries, simple C binaries like {{0.7 1.0} @Scale {Courier Bold} @Font {ps}} which require a
  628. predependency and "full-screen" ncurses binaries like {{0.7 1.0} @Scale {Courier Bold} @Font {top}} which
  629. require only a recommendation. It can say in its {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}}:
  630. //1.0vx
  631. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  632. "dpkg"--"shlibdeps" ""--"dPre"--"Depends" ps ""--"dRecommends" top}}} //0.2fe
  633. and then in its main control file {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/control"}}:
  634. //1.0vx
  635. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  636. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {...}}}}
  637. Package: procps
  638. "Pre"--"Depends:" "${shlibs:Pre"--"Depends}"
  639. Recommends: "${shlibs:Recommends}"
  640. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {...}}}}}}} //0.2fe
  641. @LP
  642. Sources which produce several binary packages with different shared
  643. library dependency requirements can use the {{0.7 1.0} @Scale {Courier Bold} @Font {""--"p"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {varnameprefix}}}}}}
  644. option to override the default {{0.7 1.0} @Scale {Courier Bold} @Font {shlib:}} prefix (one invocation of
  645. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} per setting of this option). They can thus
  646. produce several sets of dependency variables, each of the form
  647. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {varnameprefix}}}}:{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {dependencyfield}}}}}}, which can be referred
  648. to in the appropriate parts of the binary package control files.
  649. @LP
  650. @CNP
  651. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.5}
  652. 3.1.5.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"distaddfile"}} "-" adds a file to {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/files"}}}}}//0.2fe
  653. @LP
  654. Some packages' uploads need to include files other than the source and
  655. binary package files.
  656. @LP
  657. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"distaddfile"}} adds a file to the {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/files"}} file so
  658. that it will be included in the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file when
  659. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} is run.
  660. @LP
  661. It is usually invoked from the {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} target of
  662. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}}:
  663. //1.0vx
  664. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  665. "dpkg"--"distaddfile" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {filename}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {section}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {priority}}}}}}} //0.2fe
  666. The {{Times Slope} @Font {filename}} is relative to the directory where
  667. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} will expect to find it "-" this is usually the
  668. directory above the top level of the source tree. The
  669. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} target should put the file there just before or
  670. just after calling {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"distaddfile"}}.
  671. @LP
  672. The {{Times Slope} @Font {section}} and {{Times Slope} @Font {priority}} are passed unchanged into the
  673. resulting {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file. See `{{0.7 1.0} @Scale {Courier Bold} @Font {Section}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}}', page @PageOf{s-f-classification}.
  674. @LP
  675. @CNP
  676. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.6}
  677. 3.1.6.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} "-" generates a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} upload
  678. control file}}}//0.2fe
  679. @LP
  680. This program is usually called by "package-independent" automatic
  681. building scripts such as {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"buildpackage"}}, but it may also be
  682. called by hand.
  683. @LP
  684. It is usually called in the top level of a built source tree, and when
  685. invoked with no arguments will print out a straightforward
  686. {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file based on the information in the source package's
  687. changelog and control file and the binary and source packages which
  688. should have been built.
  689. @LP
  690. @CNP
  691. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.1.7}
  692. 3.1.7.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"parsechangelog"}} "-" produces parsed representation of
  693. a changelog}}}//0.2fe
  694. @LP
  695. This program is used internally by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} et al. It may
  696. also occasionally be useful in {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} and elsewhere. It
  697. parses a changelog, {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/changelog"}} by default, and prints a
  698. "control-file" format representation of the information in it to
  699. standard output.
  700. @LP
  701. @CNP
  702. {
  703. newpath 0 ysize 0.3 ft sub moveto
  704. xsize 0 rlineto
  705. 0 0.1 ft rlineto
  706. xsize neg 0 rlineto
  707. closepath fill
  708. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-sourcetree}
  709. 3.2.|0.5fe{ The Debianised source tree}}}} |0f }} //0.0fe
  710. @LP
  711. The source archive scheme described later is intended to allow a
  712. Debianised source tree with some associated control information to be
  713. reproduced and transported easily. The Debianised source tree is a
  714. version of the original program with certain files added for the
  715. benefit of the Debianisation process, and with any other changes
  716. required made to the rest of the source code and installation scripts.
  717. @LP
  718. The extra files created for Debian are in the subdirectory {{0.7 1.0} @Scale {Courier Bold} @Font {debian}}
  719. of the top level of the Debianised source tree. They are described
  720. below.
  721. @LP
  722. @CNP
  723. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.2.1}
  724. 3.2.1.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} "-" the main building script}}}//0.2fe
  725. @LP
  726. This file is an executable makefile, and contains the "package-specific"
  727. recipies for compiling the package and building binary package(s) out
  728. of the source.
  729. @LP
  730. It must start with the line {{0.7 1.0} @Scale {Courier Bold} @Font {"#!/usr/bin/make" ""--"f"}}, so that it
  731. can be invoked by saying its name rather than invoking {{0.7 1.0} @Scale {Courier Bold} @Font {make}}
  732. explicitly.
  733. @LP
  734. The targets which are required to be present are:
  735. @LP
  736. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {build}}}}
  737. //1.0vx
  738. @RawIndentedDisplay {
  739. This should perform all "non-interactive" configuration and compilation
  740. of the package. If a package has an interactive "pre-build"
  741. configuration routine, the Debianised source package should be built
  742. after this has taken place, so that it can be built without rerunning
  743. the configuration.
  744. @LP
  745. For some packages, notably ones where the same source tree is compiled
  746. in different ways to produce two binary packages, the {{0.7 1.0} @Scale {Courier Bold} @Font {build}}
  747. target does not make much sense. For these packages it is good enough
  748. to provide two (or more) targets ({{0.7 1.0} @Scale {Courier Bold} @Font {"build"--"a"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"build"--"b"}} or
  749. whatever) for each of the ways of building the package, and a
  750. {{0.7 1.0} @Scale {Courier Bold} @Font {build}} target that does nothing. The {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} target will have
  751. to build the package in each of the possible ways and make the binary
  752. package out of each.
  753. @LP
  754. The {{0.7 1.0} @Scale {Courier Bold} @Font {build}} target must not do anything that might require root
  755. privilege.
  756. @LP
  757. The {{0.7 1.0} @Scale {Courier Bold} @Font {build}} target may need to run {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} first "-" see below.
  758. @LP
  759. When a package has a configuration routine that takes a long time, or
  760. when the makefiles are poorly designed, or when {{0.7 1.0} @Scale {Courier Bold} @Font {build}} needs to
  761. run {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} first, it is a good idea to {{0.7 1.0} @Scale {Courier Bold} @Font {touch build}} when the
  762. build process is complete. This will ensure that if {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"
  763. build}} is run again it will not rebuild the whole program.
  764. }
  765. //0fe //1.2fx
  766. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {binary}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"arch"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"indep"}}}}
  767. //1.0vx
  768. @RawIndentedDisplay {
  769. The {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} target should be all that is necessary for the user
  770. to build the binary package. It is split into two parts:
  771. {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"arch"}} builds the packages' output files which are
  772. specific to a particular architecture, and {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"indep"}}
  773. builds those which are not.
  774. @LP
  775. {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} should usually be a target with no commands which simply
  776. depends on {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"arch"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"indep"}}.
  777. @LP
  778. Both {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"*"}} targets should depend on the {{0.7 1.0} @Scale {Courier Bold} @Font {build}} target,
  779. above, so that the package is built if it has not been already. It
  780. should then create the relevant binary package(s), using
  781. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} to make their control files and {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}}
  782. to build them and place them in the parent of the top level directory.
  783. @LP
  784. If one of the {{0.7 1.0} @Scale {Courier Bold} @Font {"binary"--"*"}} targets has nothing to do (this will be
  785. always be the case if the source generates only a single binary
  786. package, whether "architecture-dependent" or not) it {{Times Slope} @Font {must}} still
  787. exist, but should always succeed.
  788. @LP
  789. `Binary packages', page @PageOf{ch-binarypkg} describes how to construct binary packages.
  790. @LP
  791. The {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} targets must be invoked as root.
  792. }
  793. //0fe //1.2fx
  794. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {clean}}}}
  795. //1.0vx
  796. @RawIndentedDisplay {
  797. This should undo any effects that the {{0.7 1.0} @Scale {Courier Bold} @Font {build}} and {{0.7 1.0} @Scale {Courier Bold} @Font {binary}}
  798. targets may have had, except that it should leave alone any output
  799. files created in the parent directory by a run of {{0.7 1.0} @Scale {Courier Bold} @Font {binary}}.
  800. @LP
  801. If a {{0.7 1.0} @Scale {Courier Bold} @Font {build}} file is touched at the end of the {{0.7 1.0} @Scale {Courier Bold} @Font {build}} target,
  802. as suggested above, it must be removed as the first thing that
  803. {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} does, so that running {{0.7 1.0} @Scale {Courier Bold} @Font {build}} again after an interrupted
  804. {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} doesn't think that everything is already done.
  805. @LP
  806. The {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} target must be invoked as root if {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} has
  807. been invoked since the last {{0.7 1.0} @Scale {Courier Bold} @Font {clean}}, or if {{0.7 1.0} @Scale {Courier Bold} @Font {build}} has been
  808. invoked as root (since {{0.7 1.0} @Scale {Courier Bold} @Font {build}} may create directories, for
  809. example).
  810. }
  811. //0fe //1.2fx
  812. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {"get"--"orig"--"source"}}}}
  813. //1.0vx
  814. @RawIndentedDisplay {
  815. This target fetches the most recent version of the original source
  816. package from a canonical archive site (via FTP or WWW, for example),
  817. does any necessary rearrangement to turn it into the original source
  818. tarfile format described below, and leaves it in the current directory.
  819. @LP
  820. This target may be invoked in any directory, and should take care to
  821. clean up any temporary files it may have left.
  822. @LP
  823. This target is optional, but providing it if possible is a good idea.
  824. }
  825. //0fe
  826. @LP
  827. The {{0.7 1.0} @Scale {Courier Bold} @Font {build}}, {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} and {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} targets must be
  828. invoked with a current directory of the package's "top-level"
  829. directory.
  830. @LP
  831. Additional targets may exist in {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}}, either as
  832. published or undocumented interfaces or for the package's internal
  833. use.
  834. @LP
  835. @CNP
  836. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.2.2}
  837. 3.2.2.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/control"}}}}}//0.2fe
  838. @LP
  839. This file contains "version-independent" details about the source
  840. package and about the binary packages it creates.
  841. @LP
  842. It is a series of sets of control fields, each syntactically similar
  843. to a binary package control file. The sets are separated by one or
  844. more blank lines. The first set is information about the source
  845. package in general; each subsequent set describes one binary package
  846. that the source tree builds.
  847. @LP
  848. The syntax and semantics of the fields are described below in
  849. `Control files and their fields', page @PageOf{ch-controlfields}.
  850. @LP
  851. The general "(binary-package-independent)" fields are:
  852. //1.0vx
  853. {@RawBulletList
  854. gap { 1.0vx }
  855. @ListItem {
  856. {{0.7 1.0} @Scale {Courier Bold} @Font {Source}} (mandatory)
  857. }
  858. @ListItem {
  859. {{0.7 1.0} @Scale {Courier Bold} @Font {Maintainer}}
  860. }
  861. @ListItem {
  862. {{0.7 1.0} @Scale {Courier Bold} @Font {Section}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}}
  863. (classification, mandatory)
  864. }
  865. @ListItem {
  866. {{0.7 1.0} @Scale {Courier Bold} @Font {"Standards"--"Version"}}
  867. }
  868. @RawEndList}//0ve
  869. @LP
  870. The "per-binary-package" fields are:
  871. //1.0vx
  872. {@RawBulletList
  873. gap { 1.0vx }
  874. @ListItem {
  875. {{0.7 1.0} @Scale {Courier Bold} @Font {Package}} (mandatory)
  876. }
  877. @ListItem {
  878. {{0.7 1.0} @Scale {Courier Bold} @Font {Architecture}} (mandatory)
  879. }
  880. @ListItem {
  881. {{0.7 1.0} @Scale {Courier Bold} @Font {Description}}
  882. }
  883. @ListItem {
  884. {{0.7 1.0} @Scale {Courier Bold} @Font {Section}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}} (classification)
  885. }
  886. @ListItem {
  887. {{0.7 1.0} @Scale {Courier Bold} @Font {Essential}}
  888. }
  889. @ListItem {
  890. {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}} et al. (package interrelationships)
  891. }
  892. @RawEndList}//0ve
  893. @LP
  894. These fields are used by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} to generate control
  895. files for binary packages (see below), by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} to
  896. generate the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file to accompany the upload, and by
  897. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} when it creates the {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}} source control file as
  898. part of a source archive.
  899. @LP
  900. The fields here may contain variable references "-" their values will be
  901. substituted by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} or
  902. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} when they generate output control files. See `{{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}} and variable substitutions', page @PageOf{s-srcsubstvars} for details.
  903. @LP
  904. @CNP
  905. @Heading +2p @Font { 1.2vx @Break { {@PageMark s3.2.2.1}
  906. 3.2.2.1.|0.5fe{ "User-defined" fields}}}//0.2fe
  907. @LP
  908. Additional "user-defined" fields may be added to the source package
  909. control file. Such fields will be ignored, and not copied to (for
  910. example) binary or source package control files or upload control
  911. files.
  912. @LP
  913. If you wish to add additional unsupported fields to these output files
  914. you should use the mechanism described here.
  915. @LP
  916. Fields in the main source control information file with names starting
  917. {{0.7 1.0} @Scale {Courier Bold} @Font {X}}, followed by one or more of the letters {{0.7 1.0} @Scale {Courier Bold} @Font {BCS}} and a hyphen
  918. {{0.7 1.0} @Scale {Courier Bold} @Font {""--""}}, will be copied to the output files. Only the part of the
  919. field name after the hyphen will be used in the output file. Where
  920. the letter {{0.7 1.0} @Scale {Courier Bold} @Font {B}} is used the field will appear in binary package
  921. control files, where the letter {{0.7 1.0} @Scale {Courier Bold} @Font {S}} is used in source package
  922. control files and where {{0.7 1.0} @Scale {Courier Bold} @Font {C}} is used in upload control
  923. ({{0.7 1.0} @Scale {Courier Bold} @Font {.changes}}) files.
  924. @LP
  925. For example, if the main source information control file contains the
  926. field
  927. //1.0vx
  928. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  929. "XBS"--"Comment:" I stand between the candle and the star.}}} //0.2fe
  930. then the binary and source package control files will contain the
  931. field
  932. //1.0vx
  933. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  934. Comment: I stand between the candle and the star.}}} //0.2fe
  935. @LP
  936. @CNP
  937. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-dpkgchangelog}
  938. 3.2.3.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/changelog"}}}}}//0.2fe
  939. @LP
  940. This file records the changes to the "Debian-specific" parts of the
  941. package{@FootNote{ Though there is nothing stopping an author who is
  942. also the Debian maintainer from using it for all their changes, it
  943. will have to be renamed if the Debian and upstream maintainers become
  944. different people.}}.
  945. @LP
  946. It has a special format which allows the package building tools to
  947. discover which version of the package is being built and find out
  948. other "release-specific" information.
  949. @LP
  950. That format is a series of entries like this:
  951. //1.0vx
  952. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  953. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}} ({{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}) {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {distribution(s)}}}}; urgency={{1.4285714285 1.0} @Scale {{{Times Slope} @Font {urgency}}}}
  954. * {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {change details}}}}
  955. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {more change details}}}}
  956. * {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {even more change details}}}}
  957. ""--""--"" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {maintainer name and email address}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {date}}}}}}} //0.2fe
  958. @LP
  959. {{Times Slope} @Font {package}} and {{Times Slope} @Font {version}} are the source package name and
  960. version number. {{Times Slope} @Font {distribution(s)}} lists the distributions where
  961. this version should be installed when it is uploaded "-" it is copied to
  962. the {{0.7 1.0} @Scale {Courier Bold} @Font {Distribution}} field in the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file. See `{{0.7 1.0} @Scale {Courier Bold} @Font {Distribution}}', page @PageOf{s-f-Distribution}.
  963. @LP
  964. {{Times Slope} @Font {urgency}} is the value for the {{0.7 1.0} @Scale {Courier Bold} @Font {Urgency}} field in the
  965. {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file for the upload. See `{{0.7 1.0} @Scale {Courier Bold} @Font {Urgency}}', page @PageOf{s-f-Urgency}. It is
  966. not possible to specify an urgency containing commas; commas are used
  967. to separate {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {keyword}}}}={{1.4285714285 1.0} @Scale {{{Times Slope} @Font {value}}}}}} settings in the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  968. changelog format (though there is currently only one useful
  969. {{Times Slope} @Font {keyword}}, {{0.7 1.0} @Scale {Courier Bold} @Font {urgency}}).
  970. @LP
  971. The change details may in fact be any series of lines starting with at
  972. least two spaces, but conventionally each change starts with an
  973. asterisk and a separating space and continuation lines are indented so
  974. as to bring them in line with the start of the text above. Blank
  975. lines may be used here to separate groups of changes, if desired.
  976. @LP
  977. The maintainer name and email address should {{Times Slope} @Font {not}} necessarily be
  978. those of the usual package maintainer. They should be the details of
  979. the person doing {{Times Slope} @Font {this}} version. The information here will be
  980. copied to the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file, and then later used to send an
  981. acknowledgement when the upload has been installed.
  982. @LP
  983. The {{Times Slope} @Font {date}} should be in RFC822 format; it should include the
  984. timezone specified numerically, with the timezone name or abbreviation
  985. optionally present as a comment.
  986. @LP
  987. The first `title' line with the package name should start at the left
  988. hand margin; the `trailer' line with the maintainer and date details
  989. should be preceded by exactly one space. The maintainer details and
  990. the date must be separated by exactly two spaces.
  991. @LP
  992. An Emacs mode for editing this format is available: it is called
  993. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian"--"changelog"--"mode"}}. You can have this mode selected
  994. automatically when you edit a Debian changelog by adding a local
  995. variables clause to the end of the changelog.
  996. @LP
  997. @CNP
  998. @Heading +2p @Font { 1.2vx @Break { {@PageMark s3.2.3.1}
  999. 3.2.3.1.|0.5fe{ Defining alternative changelog formats}}}//0.2fe
  1000. @LP
  1001. It is possible to use a different format to the standard one, by
  1002. providing a parser for the format you wish to use.
  1003. @LP
  1004. In order to have {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"parsechangelog"}} run your parser, you must
  1005. include a line within the last 40 lines of your file matching the Perl
  1006. regular expression:
  1007. //1.0vx
  1008. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  1009. "\\schangelog"--"format:\\s+([0"--"9a"--"z]+)\\W"}}} //0.2fe
  1010. The part in parentheses should be the name of the format.
  1011. @LP
  1012. If such a line exists then {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"parsechangelog"}} will look for the
  1013. parser as {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/lib/dpkg/parsechangelog/"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"format-name"}}}}}} or
  1014. {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/local/lib/dpkg/parsechangelog/"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"format-name"}}}}}}; it is an
  1015. error for it not to find it, or for it not to be an executable
  1016. program. The default changelog format is {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}, and a parser for
  1017. it is provided with the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} package.
  1018. @LP
  1019. The parser will be invoked with the changelog open on standard input
  1020. at the start of the file. It should read the file (it may seek if it
  1021. wishes) to determine the information required and return the parsed
  1022. information to standard output in the form of a series of control
  1023. fields in the standard format. By default it should return
  1024. information about only the most recent version in the changelog; it
  1025. should accept a {{0.7 1.0} @Scale {Courier Bold} @Font {""--"v"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}} option to return changes
  1026. information from all versions present {{Times Slope} @Font {strictly after}}
  1027. {{Times Slope} @Font {version}}, and it should then be an error for {{Times Slope} @Font {version}} not to
  1028. be present in the changelog.
  1029. @LP
  1030. The fields are:
  1031. //1.0vx
  1032. {@RawBulletList
  1033. gap { 1.0vx }
  1034. @ListItem {
  1035. {{0.7 1.0} @Scale {Courier Bold} @Font {Source}}
  1036. }
  1037. @ListItem {
  1038. {{0.7 1.0} @Scale {Courier Bold} @Font {Version}} (mandatory)
  1039. }
  1040. @ListItem {
  1041. {{0.7 1.0} @Scale {Courier Bold} @Font {Distribution}} (mandatory)
  1042. }
  1043. @ListItem {
  1044. {{0.7 1.0} @Scale {Courier Bold} @Font {Urgency}} (mandatory)
  1045. }
  1046. @ListItem {
  1047. {{0.7 1.0} @Scale {Courier Bold} @Font {Maintainer}} (mandatory)
  1048. }
  1049. @ListItem {
  1050. {{0.7 1.0} @Scale {Courier Bold} @Font {Date}}
  1051. }
  1052. @ListItem {
  1053. {{0.7 1.0} @Scale {Courier Bold} @Font {Changes}} (mandatory)
  1054. }
  1055. @RawEndList}//0ve
  1056. @LP
  1057. If several versions are being returned (due to the use of {{0.7 1.0} @Scale {Courier Bold} @Font {""--"v"}}),
  1058. the urgency value should be of the highest urgency code listed at the
  1059. start of any of the versions requested followed by the concatenated
  1060. "(space-separated)" comments from all the versions requested; the
  1061. maintainer, version, distribution and date should always be from the
  1062. most recent version.
  1063. @LP
  1064. For the format of the {{0.7 1.0} @Scale {Courier Bold} @Font {Changes}} field see `{{0.7 1.0} @Scale {Courier Bold} @Font {Changes}}', page @PageOf{s-f-Changes}.
  1065. @LP
  1066. If the changelog format which is being parsed always or almost always
  1067. leaves a blank line between individual change notes these blank lines
  1068. should be stripped out, so as to make the resulting output compact.
  1069. @LP
  1070. If the changelog format does not contain date or package name
  1071. information this information should be omitted from the output. The
  1072. parser should not attempt to synthesise it or find it from other
  1073. sources.
  1074. @LP
  1075. If the changelog does not have the expected format the parser should
  1076. exit with a nonzero exit status, rather than trying to muddle through
  1077. and possibly generating incorrect output.
  1078. @LP
  1079. A changelog parser may not interact with the user at all.
  1080. @LP
  1081. @CNP
  1082. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-srcsubstvars}
  1083. 3.2.4.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}} and variable substitutions}}}//0.2fe
  1084. @LP
  1085. When {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} and
  1086. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} generate control files they do variable
  1087. substitutions on their output just before writing it. Variable
  1088. substitutions have the form {{0.7 1.0} @Scale {Courier Bold} @Font {"${"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"variable-name"}}}}"}"}}. The optional
  1089. file {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}} contains variable substitutions to be
  1090. used; variables can also be set directly from {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}}
  1091. using the {{0.7 1.0} @Scale {Courier Bold} @Font {""--"V"}} option to the source packaging commands, and certain
  1092. predefined variables are available.
  1093. @LP
  1094. The file may be a static part of the source archive, or generated and
  1095. modified dynamically by {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} targets. In the latter
  1096. case it must be removed by the {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} target.
  1097. @LP
  1098. See {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source(1)"}} for full details about source
  1099. variable substitutions, including the format of
  1100. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}}.
  1101. @LP
  1102. @CNP
  1103. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.2.5}
  1104. 3.2.5.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/files"}}}}}//0.2fe
  1105. @LP
  1106. This file is not a permanent part of the source tree; it is used while
  1107. building packages to record which files are being generated.
  1108. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} uses it when it generates a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file.
  1109. @LP
  1110. It should not exist in a shipped source package, and so it (and any
  1111. backup files or temporary files such as
  1112. {{0.7 1.0} @Scale {Courier Bold} @Font {files.new}}{@FootNote{ {{0.7 1.0} @Scale {Courier Bold} @Font {files.new}} is used as a temporary file by
  1113. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"distaddfile"}} "-" they write a new
  1114. version of {{0.7 1.0} @Scale {Courier Bold} @Font {files}} here before renaming it, to avoid leaving a
  1115. corrupted copy if an error occurs}}) should be removed by the
  1116. {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} target. It may also be wise to ensure a fresh start by
  1117. emptying or removing it at the start of the {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} target.
  1118. @LP
  1119. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} adds an entry to this file for the {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}}
  1120. file that will be created by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}} from the control file
  1121. that it generates, so for most packages all that needs to be done with
  1122. this file is to delete it in {{0.7 1.0} @Scale {Courier Bold} @Font {clean}}.
  1123. @LP
  1124. If a package upload includes files besides the source package and any
  1125. binary packages whose control files were made with
  1126. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} then they should be placed in the parent of the
  1127. package's "top-level" directory and {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"distaddfile"}} should be
  1128. called to add the file to the list in {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/files"}}.
  1129. @LP
  1130. @CNP
  1131. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.2.6}
  1132. 3.2.6.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/tmp"}}}}}//0.2fe
  1133. @LP
  1134. This is the canonical temporary location for the construction of
  1135. binary packages by the {{0.7 1.0} @Scale {Courier Bold} @Font {binary}} target. The directory {{0.7 1.0} @Scale {Courier Bold} @Font {tmp}}
  1136. serves as the root of the filesystem tree as it is being constructed
  1137. (for example, by using the package's upstream makefiles install
  1138. targets and redirecting the output there), and it also contains the
  1139. {{0.7 1.0} @Scale {Courier Bold} @Font {DEBIAN}} subdirectory. See `Creating package files "-" {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}}', page @PageOf{s-bincreating}.
  1140. @LP
  1141. If several binary packages are generated from the same source tree it
  1142. is usual to use several {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/tmp"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {something}}}}}} directories,
  1143. for example {{0.7 1.0} @Scale {Courier Bold} @Font {"tmp"--"a"}} or {{0.7 1.0} @Scale {Courier Bold} @Font {"tmp"--"doc"}}.
  1144. @LP
  1145. Whatever {{0.7 1.0} @Scale {Courier Bold} @Font {tmp}} directories are created and used by {{0.7 1.0} @Scale {Courier Bold} @Font {binary}}
  1146. must of course be removed by the {{0.7 1.0} @Scale {Courier Bold} @Font {clean}} target.
  1147. @LP
  1148. @CNP
  1149. {
  1150. newpath 0 ysize 0.3 ft sub moveto
  1151. xsize 0 rlineto
  1152. 0 0.1 ft rlineto
  1153. xsize neg 0 rlineto
  1154. closepath fill
  1155. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-sourcearchives}
  1156. 3.3.|0.5fe{ Source packages as archives}}}} |0f }} //0.0fe
  1157. @LP
  1158. As it exists on the FTP site, a Debian source package consists of
  1159. three related files. You must have the right versions of all three to
  1160. be able to use them.
  1161. @LP
  1162. {|0.5f {Debian source control file "-" {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}}}}
  1163. //1.0vx
  1164. @RawIndentedDisplay {
  1165. This file contains a series of fields, identified and separated just
  1166. like the fields in the control file of a binary package. The fields
  1167. are listed below; their syntax is described above, in
  1168. `Control files and their fields', page @PageOf{ch-controlfields}.
  1169. //1.0vx
  1170. {@RawBulletList
  1171. gap { 1.0vx }
  1172. @ListItem {
  1173. {{0.7 1.0} @Scale {Courier Bold} @Font {Source}}
  1174. }
  1175. @ListItem {
  1176. {{0.7 1.0} @Scale {Courier Bold} @Font {Version}}
  1177. }
  1178. @ListItem {
  1179. {{0.7 1.0} @Scale {Courier Bold} @Font {Maintainer}}
  1180. }
  1181. @ListItem {
  1182. {{0.7 1.0} @Scale {Courier Bold} @Font {Binary}}
  1183. }
  1184. @ListItem {
  1185. {{0.7 1.0} @Scale {Courier Bold} @Font {Architecture}}
  1186. }
  1187. @ListItem {
  1188. {{0.7 1.0} @Scale {Courier Bold} @Font {"Standards"--"Version"}}
  1189. }
  1190. @ListItem {
  1191. {{0.7 1.0} @Scale {Courier Bold} @Font {Files}}
  1192. }
  1193. @RawEndList}//0ve
  1194. @LP
  1195. The source package control file is generated by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}}
  1196. when it builds the source archive, from other files in the source
  1197. package, described above. When unpacking it is checked against the
  1198. files and directories in the other parts of the source package, as
  1199. described below.
  1200. }
  1201. //0fe //1.2fx
  1202. {|0.5f {Original source archive "-" {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}_{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"upstream-version"}}}}.orig.tar.gz}}}}
  1203. //1.0vx
  1204. @RawIndentedDisplay {
  1205. This is a compressed (with {{0.7 1.0} @Scale {Courier Bold} @Font {gzip ""--"9"}}) {{0.7 1.0} @Scale {Courier Bold} @Font {tar}} file containing
  1206. the source code from the upstream authors of the program. The tarfile
  1207. unpacks into a directory
  1208. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"upstream-version"}}}}.orig}}, and does not contain
  1209. files anywhere other than in there or in its subdirectories.
  1210. }
  1211. //0fe //1.2fx
  1212. {|0.5f {Debianisation diff "-" {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}_{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"version-revision"}}}}.diff.gz}}}}
  1213. //1.0vx
  1214. @RawIndentedDisplay {
  1215. This is a unified context diff ({{0.7 1.0} @Scale {Courier Bold} @Font {diff ""--"u"}}) giving the changes which
  1216. are required to turn the original source into the Debian source.
  1217. These changes may only include editing and creating plain files. The
  1218. permissions of files, the targets of symbolic links and the
  1219. characteristics of special files or pipes may not be changed and no
  1220. files may be removed or renamed.
  1221. @LP
  1222. All the directories in the diff must exist, except the {{0.7 1.0} @Scale {Courier Bold} @Font {debian}}
  1223. subdirectory of the top of the source tree, which will be created by
  1224. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} if necessary when unpacking.
  1225. @LP
  1226. The {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} program will automatically make the
  1227. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} file executable (see below).
  1228. }
  1229. //0fe
  1230. @LP
  1231. If there is no original source code "-" for example, if the package is
  1232. specially prepared for Debian or the Debian maintainer is the same as
  1233. the upstream maintainer "-" the format is slightly different: then there
  1234. is no diff, and the tarfile is named
  1235. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}_{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}.tar.gz}} and contains a directory
  1236. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}}.
  1237. @LP
  1238. @CNP
  1239. {
  1240. newpath 0 ysize 0.3 ft sub moveto
  1241. xsize 0 rlineto
  1242. 0 0.1 ft rlineto
  1243. xsize neg 0 rlineto
  1244. closepath fill
  1245. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s3.4}
  1246. 3.4.|0.5fe{ Unpacking a Debian source package without {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}}}}}} |0f }} //0.0fe
  1247. @LP
  1248. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source" ""--"x"}} is the recommended way to unpack a Debian source
  1249. package. However, if it is not available it is possible to unpack a
  1250. Debian source archive as follows:
  1251. //1.0vx
  1252. {@RawNumberedList
  1253. gap { 1.0vx }
  1254. @ListItem {
  1255. Untar the tarfile, which will create a {{0.7 1.0} @Scale {Courier Bold} @Font {.orig}} directory.
  1256. }
  1257. @ListItem {
  1258. Rename the {{0.7 1.0} @Scale {Courier Bold} @Font {.orig}} directory to
  1259. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}}.
  1260. }
  1261. @ListItem {
  1262. Create the subdirectory {{0.7 1.0} @Scale {Courier Bold} @Font {debian}} at the top of the source
  1263. tree.
  1264. }
  1265. @ListItem {
  1266. Apply the diff using {{0.7 1.0} @Scale {Courier Bold} @Font {patch ""--"p0"}}.
  1267. }
  1268. @ListItem {
  1269. Untar the tarfile again if you want a copy of the original
  1270. source code alongside the Debianised version.
  1271. }
  1272. @RawEndList}//0ve
  1273. @LP
  1274. It is not possible to generate a valid Debian source archive without
  1275. using {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}}. In particular, attempting to use
  1276. {{0.7 1.0} @Scale {Courier Bold} @Font {diff}} directly to generate the {{0.7 1.0} @Scale {Courier Bold} @Font {.diff.gz}} file will not work.
  1277. @LP
  1278. @CNP
  1279. @Heading +3p @Font { 1.2vx @Break { {@PageMark s3.4.1}
  1280. 3.4.1.|0.5fe{ Restrictions on objects in source packages}}}//0.2fe
  1281. @LP
  1282. The source package may not contain any device special files, sockets
  1283. or setuid or setgid files.{@FootNote{ Setgid directories are
  1284. allowed.}}
  1285. @LP
  1286. The source packaging tools manage the changes between the original and
  1287. Debianised source using {{0.7 1.0} @Scale {Courier Bold} @Font {diff}} and {{0.7 1.0} @Scale {Courier Bold} @Font {patch}}. Turning the
  1288. original source tree as included in the {{0.7 1.0} @Scale {Courier Bold} @Font {.orig.tar.gz}} into the
  1289. debianised source must not involve any changes which cannot be handled
  1290. by these tools. Problematic changes which cause {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} to
  1291. halt with an error when building the source package are:
  1292. //1.0vx
  1293. {@RawBulletList
  1294. gap { 1.0vx }
  1295. @ListItem {
  1296. Adding or removing symbolic links, sockets or pipes.
  1297. }
  1298. @ListItem {
  1299. Changing the targets of symbolic links.
  1300. }
  1301. @ListItem {
  1302. Creating directories, other than {{0.7 1.0} @Scale {Courier Bold} @Font {debian}}.
  1303. }
  1304. @ListItem {
  1305. Changes to the contents of binary files.
  1306. }
  1307. @RawEndList}//0ve
  1308. Changes which cause {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} to print a warning but continue
  1309. anyway are:
  1310. //1.0vx
  1311. {@RawBulletList
  1312. gap { 1.0vx }
  1313. @ListItem {
  1314. Removing files, directories or symlinks. {@FootNote{ Renaming a
  1315. file is not treated specially "-" it is seen as the removal of the old
  1316. file (which generates a warning, but is otherwise ignored), and the
  1317. creation of the new one.}}
  1318. }
  1319. @RawEndList}//0ve
  1320. Changes which are not represented, but which are not detected by
  1321. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}}, are:
  1322. //1.0vx
  1323. {@RawBulletList
  1324. gap { 1.0vx }
  1325. @ListItem {
  1326. Changing the permissions of files (other than
  1327. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}}) and directories.
  1328. }
  1329. @RawEndList}//0ve
  1330. @LP
  1331. The {{0.7 1.0} @Scale {Courier Bold} @Font {debian}} directory and {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} are handled
  1332. specially by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"source"}} "-" before applying the changes it will
  1333. create the {{0.7 1.0} @Scale {Courier Bold} @Font {debian}} directory, and afterwards it will make
  1334. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/rules"}} "world-exectuable."
  1335. @LP
  1336. @NP
  1337. {
  1338. newpath 0 ysize 0.3 ft sub moveto
  1339. xsize 0 rlineto
  1340. 0 0.2 ft rlineto
  1341. xsize neg 0 rlineto
  1342. closepath fill
  1343. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-controlfields}
  1344. 4.|0.5fe{ Control files and their fields}}}} |0f }} //0.0fe
  1345. @LP
  1346. Many of the tools in the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} suite manipulate data in a common
  1347. format, known as control files. Binary and source packages have
  1348. control data as do the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} files which control the
  1349. installation of uploaded files, and {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s internal databases
  1350. are in a similar format.
  1351. @LP
  1352. @CNP
  1353. {
  1354. newpath 0 ysize 0.3 ft sub moveto
  1355. xsize 0 rlineto
  1356. 0 0.1 ft rlineto
  1357. xsize neg 0 rlineto
  1358. closepath fill
  1359. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s4.1}
  1360. 4.1.|0.5fe{ Syntax of control files}}}} |0f }} //0.0fe
  1361. @LP
  1362. A file consists of one or more paragraphs of fields. The paragraphs
  1363. are separated by blank lines. Some control files only allow one
  1364. paragraph; others allow several, in which case each paragraph often
  1365. refers to a different package.
  1366. @LP
  1367. Each paragraph is a series of fields and values; each field consists
  1368. of a name, followed by a colon and the value. It ends at the end of
  1369. the line. Horizontal whitespace (spaces and tabs) may occur before or
  1370. after the value and is ignored there; it is conventional to put a
  1371. single space after the colon.
  1372. @LP
  1373. Some fields' values may span several lines; in this case each
  1374. continuation line {{Times Slope} @Font {must}} start with a space or tab. Any trailing
  1375. spaces or tabs at the end of individual lines of a field value are
  1376. ignored.
  1377. @LP
  1378. Except where otherwise stated only a single line of data is allowed
  1379. and whitespace is not significant in a field body. Whitespace may
  1380. never appear inside names (of packages, architectures, files or
  1381. anything else), version numbers or in between the characters of
  1382. "multi-character" version relationships.
  1383. @LP
  1384. Field names are not "case-sensitive," but it is usual to capitalise the
  1385. fields using mixed case as shown below.
  1386. @LP
  1387. Blank lines, or lines consisting only of spaces and tabs, are not
  1388. allowed within field values or between fields "-" that would mean a new
  1389. paragraph.
  1390. @LP
  1391. It is important to note that there are several fields which are
  1392. optional as far as {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} and the related tools are concerned,
  1393. but which must appear in every Debian package, or whose omission may
  1394. cause problems. When writing the control files for Debian packages
  1395. you {{Times Slope} @Font {must}} read the Debian policy manual in conjuction with the
  1396. details below and the list of fields for the particular file.
  1397. @LP
  1398. @CNP
  1399. {
  1400. newpath 0 ysize 0.3 ft sub moveto
  1401. xsize 0 rlineto
  1402. 0 0.1 ft rlineto
  1403. xsize neg 0 rlineto
  1404. closepath fill
  1405. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s4.2}
  1406. 4.2.|0.5fe{ List of fields
  1407. }}}} |0f }} //0.0fe
  1408. @LP
  1409. @CNP
  1410. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Package}
  1411. 4.2.1.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Package}}}}}//0.2fe
  1412. @LP
  1413. The name of the binary package. Package names consist of the
  1414. alphanumerics and {{0.7 1.0} @Scale {Courier Bold} @Font {+}} {{0.7 1.0} @Scale {Courier Bold} @Font {""--""}} {{0.7 1.0} @Scale {Courier Bold} @Font {.}} (plus, minus and full
  1415. stop).{@FootNote{ The characters {{0.7 1.0} @Scale {Courier Bold} @Font {"@"}} {{0.7 1.0} @Scale {Courier Bold} @Font {:}} {{0.7 1.0} @Scale {Courier Bold} @Font {=}} {{0.7 1.0} @Scale {Courier Bold} @Font {%}} {{0.7 1.0} @Scale {Courier Bold} @Font {_}} (at,
  1416. colon, equals, percent and underscore) used to be legal and are still
  1417. accepted when found in a package file, but may not be used in new
  1418. packages}}
  1419. @LP
  1420. They must be at least two characters and must start with an
  1421. alphanumeric. In current versions of dpkg they are sort of
  1422. "case-sensitive"{@FootNote{ This is a bug.}}; use lowercase
  1423. package names unless the package you're building (or referring to, in
  1424. other fields) is already using uppercase.
  1425. @LP
  1426. @CNP
  1427. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Version}
  1428. 4.2.2.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Version}}}}}//0.2fe
  1429. @LP
  1430. This lists the source or binary package's version number "-" see `Version numbering', page @PageOf{ch-versions}.
  1431. @LP
  1432. @CNP
  1433. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Architecture}
  1434. 4.2.3.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Architecture}}}}}//0.2fe
  1435. @LP
  1436. This is the architecture string; it is a single word for the CPU
  1437. architecture.
  1438. @LP
  1439. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will check the declared architecture of a binary package
  1440. against its own "compiled-in" value before it installs it.
  1441. @LP
  1442. The special value {{0.7 1.0} @Scale {Courier Bold} @Font {all}} indicates that the package is
  1443. "architecture-independent."
  1444. @LP
  1445. In the main {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/control"}} file in the source package, or in
  1446. the source package control file {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}}, a list of architectures
  1447. (separated by spaces) is also allowed, as is the special value
  1448. {{0.7 1.0} @Scale {Courier Bold} @Font {any}}. A list indicates that the source will build an
  1449. "architecture-dependent" package, and will only work correctly on the
  1450. listed architectures. {{0.7 1.0} @Scale {Courier Bold} @Font {any}} indicates that though the source
  1451. package isn't dependent on any particular architecture and should
  1452. compile fine on any one, the binary package(s) produced are not
  1453. "architecture-independent" but will instead be specific to whatever the
  1454. current build architecture is.
  1455. @LP
  1456. In a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file the {{0.7 1.0} @Scale {Courier Bold} @Font {Architecture}} field lists the
  1457. architecture(s) of the package(s) currently being uploaded. This will
  1458. be a list; if the source for the package is being uploaded too the
  1459. special entry {{0.7 1.0} @Scale {Courier Bold} @Font {source}} is also present.
  1460. @LP
  1461. The current build architecture can be determined using {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg
  1462. ""--""--"print"--"architecture"}}.{@FootNote{ This actually invokes
  1463. //1.0vx
  1464. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  1465. gcc ""--""--"print"--"libgcc"--"file"--"name"}}} //0.2fe
  1466. and parses and decomposes the output and looks the CPU type from the
  1467. GCC configuration in a table in {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}. This is so that it will
  1468. work if you're "cross-compiling."}}
  1469. This value is automatically used by {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}} when
  1470. building the control file for a binary package for which the source
  1471. control information doesn't specify architecture {{0.7 1.0} @Scale {Courier Bold} @Font {all}}.
  1472. @LP
  1473. There is a separate option, {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"print"--"installation"--"architecture"}},
  1474. for finding out what architecture {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} is willing to install.
  1475. This information is also in the output of {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"version"}}.
  1476. @LP
  1477. @CNP
  1478. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Maintainer}
  1479. 4.2.4.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Maintainer}}}}}//0.2fe
  1480. @LP
  1481. The package maintainer's name and email address. The name should come
  1482. first, then the email address inside angle brackets {{0.7 1.0} @Scale {Courier Bold} @Font {<>}} (in
  1483. RFC822 format).
  1484. @LP
  1485. If the maintainer's name contains a full stop then the whole field
  1486. will not work directly as an email address due to a misfeature in the
  1487. syntax specified in RFC822; a program using this field as an address
  1488. must check for this and correct the problem if necessary (for example
  1489. by putting the name in round brackets and moving it to the end, and
  1490. bringing the email address forward).
  1491. @LP
  1492. In a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file or parsed changelog data this contains the
  1493. name and email address of the person responsible for the particular
  1494. version in question "-" this may not be the package's usual maintainer.
  1495. @LP
  1496. This field is usually optional in as far as the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} are
  1497. concerned, but its absence when building packages usually generates a
  1498. warning.
  1499. @LP
  1500. @CNP
  1501. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Source}
  1502. 4.2.5.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Source}}}}}//0.2fe
  1503. @LP
  1504. This field identifies the source package name.
  1505. @LP
  1506. In a main source control information or a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} or {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}}
  1507. file or parsed changelog data this may contain only the name of the
  1508. source package.
  1509. @LP
  1510. In the control file of a binary package (or in a {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} file)
  1511. it may be followed by a version number in parentheses.{@FootNote{ It is
  1512. usual to leave a space after the package name if a version number is
  1513. specified.}} This version number may be omitted (and is, by
  1514. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"gencontrol"}}) if it has the same value as the {{0.7 1.0} @Scale {Courier Bold} @Font {Version}}
  1515. field of the binary package in question. The field itself may be
  1516. omitted from a binary package control file when the source package has
  1517. the same name and version as the binary package.
  1518. @LP
  1519. @CNP
  1520. @Heading +3p @Font { 1.2vx @Break { {@PageMark s4.2.6}
  1521. 4.2.6.|0.5fe{ Package interrelationship fields:
  1522. {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}
  1523. {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}}}}}//0.2fe
  1524. @LP
  1525. These fields describe the package's relationships with other packages.
  1526. Their syntax and semantics are described in `Declaring relationships between packages', page @PageOf{ch-relationships}.
  1527. @LP
  1528. @CNP
  1529. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Description}
  1530. 4.2.7.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Description}}}}}//0.2fe
  1531. @LP
  1532. In a binary package {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} file or main source control file
  1533. this field contains a description of the binary package, in a special
  1534. format. See `Descriptions of packages "-" the
  1535. {{0.7 1.0} @Scale {Courier Bold} @Font {Description}} field', page @PageOf{ch-descriptions} for details.
  1536. @LP
  1537. In a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file it contains a summary of the descriptions for
  1538. the packages being uploaded. The part of the field before the first
  1539. newline is empty; thereafter each line has the name of a binary
  1540. package and the summary description line from that binary package.
  1541. Each line is indented by one space.
  1542. @LP
  1543. @CNP
  1544. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Essential}
  1545. 4.2.8.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Essential}}}}}//0.2fe
  1546. @LP
  1547. This is a boolean field which may occur only in the control file of a
  1548. binary package (or in the {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} file) or in a "per-package"
  1549. fields paragraph of a main source control data file.
  1550. @LP
  1551. If set to {{0.7 1.0} @Scale {Courier Bold} @Font {yes}} then {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} and {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will refuse to
  1552. remove the package (though it can be upgraded "and/or" replaced). The
  1553. other possible value is {{0.7 1.0} @Scale {Courier Bold} @Font {no}}, which is the same as not having the
  1554. field at all.
  1555. @LP
  1556. @CNP
  1557. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-classification}
  1558. 4.2.9.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Section}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}}}}}//0.2fe
  1559. @LP
  1560. These two fields classify the package. The {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}} represents
  1561. how important that it is that the user have it installed; the
  1562. {{0.7 1.0} @Scale {Courier Bold} @Font {Section}} represents an application area into which the package has
  1563. been classified.
  1564. @LP
  1565. When they appear in the {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/control"}} file these fields give
  1566. values for the section and priority subfields of the {{0.7 1.0} @Scale {Courier Bold} @Font {Files}} field
  1567. of the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file, and give defaults for the section and
  1568. priority of the binary packages.
  1569. @LP
  1570. The section and priority are represented, though not as separate
  1571. fields, in the information for each file in the {{0.7 1.0} @Scale {Courier Bold} @Font {Files}} field of a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file. The
  1572. section value in a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file is used to decide where to
  1573. install a package in the FTP archive.
  1574. @LP
  1575. These fields are not used by by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} proper, but by
  1576. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} when it sorts packages and selects defaults. See the
  1577. Debian policy manual for the priorities in use and the criteria for
  1578. selecting the priority for a Debian package, and look at the Debian
  1579. FTP archive for a list of currently "in-use" priorities.
  1580. @LP
  1581. These fields may appear in binary package control files, in which case
  1582. they provide a default value in case the {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} files are
  1583. missing the information. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} and {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will only use
  1584. the value from a {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} file if they have no other information; a
  1585. value listed in a {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} file will always take precedence. By
  1586. default {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"genchanges"}} does not include the section and
  1587. priority in the control file of a binary package "-" use the {{0.7 1.0} @Scale {Courier Bold} @Font {""--"isp"}},
  1588. {{0.7 1.0} @Scale {Courier Bold} @Font {""--"is"}} or {{0.7 1.0} @Scale {Courier Bold} @Font {""--"ip"}} options to achieve this effect.
  1589. @LP
  1590. @CNP
  1591. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Binary}
  1592. 4.2.10.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Binary}}}}}//0.2fe
  1593. @LP
  1594. This field is a list of binary packages.
  1595. @LP
  1596. When it appears in the {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}} file it is the list of binary
  1597. packages which a source package can produce. It does not necessarily
  1598. produce all of these binary packages for every architecture. The
  1599. source control file doesn't contain details of which architectures are
  1600. appropriate for which of the binary packages.
  1601. @LP
  1602. When it appears in a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file it lists the names of the
  1603. binary packages actually being uploaded.
  1604. @LP
  1605. The syntax is a list of binary packages separated by
  1606. commas.{@FootNote{ A space after each comma is conventional.}}
  1607. Currently the packages must be separated using only spaces in the
  1608. {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file.
  1609. @LP
  1610. @CNP
  1611. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Installed-Size}
  1612. 4.2.11.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"Installed"--"Size"}}}}}//0.2fe
  1613. @LP
  1614. This field appears in the control files of binary packages, and in the
  1615. {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} files. It gives the total amount of disk space
  1616. required to install the named package.
  1617. @LP
  1618. The disk space is represented in kilobytes as a simple decimal number.
  1619. @LP
  1620. @CNP
  1621. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Files}
  1622. 4.2.12.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Files}}}}}//0.2fe
  1623. @LP
  1624. This field contains a list of files with information about each one.
  1625. The exact information and syntax varies with the context. In all
  1626. cases the the part of the field contents on the same line as the field
  1627. name is empty. The remainder of the field is one line per file, each
  1628. line being indented by one space and containing a number of "sub-fields"
  1629. separated by spaces.
  1630. @LP
  1631. In the {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}} (Debian source control) file each line contains the
  1632. MD5 checksum, size and filename of the tarfile and (if applicable)
  1633. diff file which make up the remainder of the source
  1634. package.{@FootNote{ That is, the parts which are not the
  1635. {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}}.}} The exact forms of the filenames are described
  1636. in `Source packages as archives', page @PageOf{s-sourcearchives}.
  1637. @LP
  1638. In the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file this contains one line per file being
  1639. uploaded. Each line contains the MD5 checksum, size, section and
  1640. priority and the filename. The section and priority are the values of
  1641. the corresponding fields in the main source control file "-" see `{{0.7 1.0} @Scale {Courier Bold} @Font {Section}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}}', page @PageOf{s-f-classification}. If no section or priority is specified then
  1642. {{0.7 1.0} @Scale {Courier Bold} @Font {""--""}} should be used, though section and priority values must be
  1643. specified for new packages to be installed properly.
  1644. @LP
  1645. The special value {{0.7 1.0} @Scale {Courier Bold} @Font {byhand}} for the section in a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file
  1646. indicates that the file in question is not an ordinary package file
  1647. and must by installed by hand by the distribution maintainers. If the
  1648. section is {{0.7 1.0} @Scale {Courier Bold} @Font {byhand}} the priority should be {{0.7 1.0} @Scale {Courier Bold} @Font {""--""}}.
  1649. @LP
  1650. If a new Debian revision of a package is being shipped and no new
  1651. original source archive is being distributed the {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}} must still
  1652. contain the {{0.7 1.0} @Scale {Courier Bold} @Font {Files}} field entry for the original source archive
  1653. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}""--""{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"upstream-version"}}}}.orig.tar.gz}}, but the
  1654. {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file should leave it out. In this case the original
  1655. source archive on the distribution site must match exactly,
  1656. "byte-for-byte," the original source archive which was used to generate
  1657. the {{0.7 1.0} @Scale {Courier Bold} @Font {.dsc}} file and diff which are being uploaded.
  1658. @LP
  1659. @CNP
  1660. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Standards-Version}
  1661. 4.2.13.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"Standards"--"Version"}}}}}//0.2fe
  1662. @LP
  1663. The most recent version of the standards (the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} programmers'
  1664. and policy manuals and associated texts) with which the package
  1665. complies. This is updated manually when editing the source package to
  1666. conform to newer standards; it can sometimes be used to tell when a
  1667. package needs attention.
  1668. @LP
  1669. Its format is the same as that of a version number except that no
  1670. epoch or Debian revision is allowed "-" see `Version numbering', page @PageOf{ch-versions}.
  1671. @LP
  1672. @CNP
  1673. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Distribution}
  1674. 4.2.14.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Distribution}}}}}//0.2fe
  1675. @LP
  1676. In a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file or parsed changelog output this contains the
  1677. "(space-separated)" name(s) of the distribution(s) where this version of
  1678. the package should be or was installed. Distribution names follow the
  1679. rules for package names. (See `{{0.7 1.0} @Scale {Courier Bold} @Font {Package}}', page @PageOf{s-f-Package}).
  1680. @LP
  1681. Current distribution values are {{0.7 1.0} @Scale {Courier Bold} @Font {stable}}, {{0.7 1.0} @Scale {Courier Bold} @Font {unstable}},
  1682. {{0.7 1.0} @Scale {Courier Bold} @Font {contrib}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"non"--"free"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {experimental}}.
  1683. @LP
  1684. @CNP
  1685. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Urgency}
  1686. 4.2.15.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Urgency}}}}}//0.2fe
  1687. @LP
  1688. This is a description of how important it is to upgrade to this
  1689. version from previous ones. It consists of a single keyword usually
  1690. taking one of the values {{0.7 1.0} @Scale {Courier Bold} @Font {LOW}}, {{0.7 1.0} @Scale {Courier Bold} @Font {MEDIUM}} or {{0.7 1.0} @Scale {Courier Bold} @Font {HIGH}}) followed
  1691. by an optional commentary (separated by a space) which is usually in
  1692. parentheses. For example:
  1693. //1.0vx
  1694. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  1695. Urgency: LOW (HIGH for diversions users)}}} //0.2fe
  1696. @LP
  1697. This field appears in the {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file and in parsed changelogs;
  1698. its value appears as the value of the {{0.7 1.0} @Scale {Courier Bold} @Font {urgency}} attribute in a
  1699. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}"-style" changelog (see `{{0.7 1.0} @Scale {Courier Bold} @Font {"debian/changelog"}}', page @PageOf{s-dpkgchangelog}).
  1700. @LP
  1701. Urgency keywords are not "case-sensitive."
  1702. @LP
  1703. @CNP
  1704. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Date}
  1705. 4.2.16.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Date}}}}}//0.2fe
  1706. @LP
  1707. In {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} files and parsed changelogs, this gives the date the
  1708. package was built or last edited.
  1709. @LP
  1710. @CNP
  1711. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Format}
  1712. 4.2.17.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Format}}}}}//0.2fe
  1713. @LP
  1714. This field occurs in {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} files, and specifies a format
  1715. revision for the file. The format described here is version {{0.7 1.0} @Scale {Courier Bold} @Font {1.5}}.
  1716. The syntax of the format value is the same as that of a package
  1717. version number except that no epoch or Debian revision is allowed "-"
  1718. see `Version numbering', page @PageOf{ch-versions}.
  1719. @LP
  1720. @CNP
  1721. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Changes}
  1722. 4.2.18.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Changes}}}}}//0.2fe
  1723. @LP
  1724. In a {{0.7 1.0} @Scale {Courier Bold} @Font {.changes}} file or parsed changelog this field contains the
  1725. "human-readable" changes data, describing the differences between the
  1726. last version and the current one.
  1727. @LP
  1728. There should be nothing in this field before the first newline; all
  1729. the subsequent lines must be indented by at least one space; blank
  1730. lines must be represented by a line consiting only of a space and a
  1731. full stop.
  1732. @LP
  1733. Each version's change information should be preceded by a `title' line
  1734. giving at least the version, distribution(s) and urgency, in a
  1735. "human-readable" way.
  1736. @LP
  1737. If data from several versions is being returned the entry for the most
  1738. recent version should be returned first, and entries should be
  1739. separated by the representation of a blank line (the `title' line may
  1740. also be followed by the representation of blank line).
  1741. @LP
  1742. @CNP
  1743. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Filename}
  1744. 4.2.19.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Filename}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"MSDOS"--"Filename"}}}}}//0.2fe
  1745. @LP
  1746. These fields in {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} files give the filename(s) of (the parts
  1747. of) a package in the distribution directories, relative to the root of
  1748. the Debian hierarchy. If the package has been split into several
  1749. parts the parts are all listed in order, separated by spaces.
  1750. @LP
  1751. @CNP
  1752. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Size}
  1753. 4.2.20.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Size}} and {{0.7 1.0} @Scale {Courier Bold} @Font {MD5sum}}}}}//0.2fe
  1754. @LP
  1755. These fields in {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} files give the size (in bytes, expressed
  1756. in decimal) and MD5 checksum of the file(s) which make(s) up a binary
  1757. package in the distribution. If the package is split into several
  1758. parts the values for the parts are listed in order, separated by
  1759. spaces.
  1760. @LP
  1761. @CNP
  1762. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Status}
  1763. 4.2.21.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Status}}}}}//0.2fe
  1764. @LP
  1765. This field in {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s status file records whether the user wants a
  1766. package installed, removed or left alone, whether it is broken
  1767. (requiring reinstallation) or not and what its current state on the
  1768. system is. Each of these pieces of information is a single word.
  1769. @LP
  1770. @CNP
  1771. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Config-Version}
  1772. 4.2.22.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {"Config"--"Version"}}}}}//0.2fe
  1773. @LP
  1774. If a package is not installed or not configured, this field in
  1775. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s status file records the last version of the package which
  1776. was successfully configured.
  1777. @LP
  1778. @CNP
  1779. @Heading +3p @Font { 1.2vx @Break { {@PageMark s-f-Conffiles}
  1780. 4.2.23.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Conffiles}}}}}//0.2fe
  1781. @LP
  1782. This field in {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s status file contains information about the
  1783. "automatically-managed" configuration files held by a package. This
  1784. field should {{Times Slope} @Font {not}} appear anywhere in a package!
  1785. @LP
  1786. @CNP
  1787. @Heading +3p @Font { 1.2vx @Break { {@PageMark s4.2.24}
  1788. 4.2.24.|0.5fe{ Obsolete fields}}}//0.2fe
  1789. @LP
  1790. These are still recognised by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} but should not appear anywhere
  1791. any more.
  1792. //1.0vx
  1793. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Revision}}}}
  1794. //1.0vx
  1795. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {"Package"--"Revision"}}}}
  1796. //1.0vx
  1797. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Package_Revision}}}}
  1798. //1.0vx
  1799. {|2f {
  1800. The Debian revision part of the package version was at one point in a
  1801. separate control file field. This field went through several names.
  1802. }}
  1803. //1.0vx
  1804. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Recommended}}}}
  1805. //1.0vx
  1806. {|2f {
  1807. Old name for {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}
  1808. }}
  1809. //1.0vx
  1810. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Optional}}}}
  1811. //1.0vx
  1812. {|2f {
  1813. Old name for {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}}.
  1814. }}
  1815. //1.0vx
  1816. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Class}}}}
  1817. //1.0vx
  1818. {|2f {
  1819. Old name for {{0.7 1.0} @Scale {Courier Bold} @Font {Priority}}.
  1820. }}
  1821. //0.2fe
  1822. @LP
  1823. @NP
  1824. {
  1825. newpath 0 ysize 0.3 ft sub moveto
  1826. xsize 0 rlineto
  1827. 0 0.2 ft rlineto
  1828. xsize neg 0 rlineto
  1829. closepath fill
  1830. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-versions}
  1831. 5.|0.5fe{ Version numbering}}}} |0f }} //0.0fe
  1832. @LP
  1833. Every package has a version number, in its {{0.7 1.0} @Scale {Courier Bold} @Font {Version}} control file
  1834. field.
  1835. @LP
  1836. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} imposes an ordering on version numbers, so that it can tell
  1837. whether packages are being "up-" or downgraded and so that {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}
  1838. can tell whether a package it finds available is newer than the one
  1839. installed on the system. The version number format has the most
  1840. significant parts (as far as comparison is concerned) at the
  1841. beginning.
  1842. @LP
  1843. The version number format is:
  1844. [{{Times Slope} @Font {epoch}}{{0.7 1.0} @Scale {Courier Bold} @Font {:}}]{{Times Slope} @Font {"upstream-version"}}[{{0.7 1.0} @Scale {Courier Bold} @Font {""--""}}{{Times Slope} @Font {"debian-revision"}}].
  1845. @LP
  1846. The three components here are:
  1847. @LP
  1848. {|0.5f {{{Times Slope} @Font {epoch}}}}
  1849. //1.0vx
  1850. @RawIndentedDisplay {
  1851. This is a single unsigned integer, which should usually be small. It
  1852. may be omitted, in which case zero is assumed. If it is omitted then
  1853. the {{Times Slope} @Font {"upstream-version"}} may not contain any colons.
  1854. @LP
  1855. It is provided to allow mistakes in the version numbers of older
  1856. versions of a package, and also a package's previous version numbering
  1857. schemes, to be left behind.
  1858. @LP
  1859. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will not usually display the epoch unless it is essential
  1860. "(non-zero," or if the {{Times Slope} @Font {"upstream-version"}} contains a colon);
  1861. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} does not display epochs at all in the main part of the
  1862. package selection display.
  1863. }
  1864. //0fe //1.2fx
  1865. {|0.5f {{{Times Slope} @Font {"upstream-version"}}}}
  1866. //1.0vx
  1867. @RawIndentedDisplay {
  1868. This is the main part of the version. It is usually version number of
  1869. the original (`upstream') package of which the {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} file has been
  1870. made, if this is applicable. Usually this will be in the same format
  1871. as that specified by the upstream author(s); however, it may need to
  1872. be reformatted to fit into {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s format and comparison scheme.
  1873. @LP
  1874. The comparison behaviour of {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} with respect to the
  1875. {{Times Slope} @Font {"upstream-version"}} is described below. The {{Times Slope} @Font {"upstream-version"}}
  1876. portion of the version number is mandatory.
  1877. @LP
  1878. The {{Times Slope} @Font {"upstream-version"}} may contain only alphanumerics and the
  1879. characters {{0.7 1.0} @Scale {Courier Bold} @Font {+}} {{0.7 1.0} @Scale {Courier Bold} @Font {.}} {{0.7 1.0} @Scale {Courier Bold} @Font {""--""}} {{0.7 1.0} @Scale {Courier Bold} @Font {:}} (full stop, plus, hyphen,
  1880. colon) and should start with a digit. If there is no
  1881. {{Times Slope} @Font {"debian-revision"}} then hyphens are not allowed; if there is no
  1882. {{Times Slope} @Font {epoch}} then colons are not allowed.
  1883. }
  1884. //0fe //1.2fx
  1885. {|0.5f {{{Times Slope} @Font {"debian-revision"}}}}
  1886. //1.0vx
  1887. @RawIndentedDisplay {
  1888. This part of the version represents the version of the modifications
  1889. that were made to the package to make it a Debian binary package. It
  1890. is in the same format as the {{Times Slope} @Font {"upstream-version"}} and {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  1891. compares it in the same way.
  1892. @LP
  1893. It is optional; if it isn't present then the {{Times Slope} @Font {"upstream-version"}}
  1894. may not contain a hyphen. This format represents the case where a
  1895. piece of software was written specifically to be turned into a Debian
  1896. binary package, and so there is only one `debianization' of it and
  1897. therefore no revision indication is required.
  1898. @LP
  1899. It is conventional to restart the {{Times Slope} @Font {"debian-revision"}} at {{0.7 1.0} @Scale {Courier Bold} @Font {1}} each
  1900. time the {{Times Slope} @Font {"upstream-version"}} is increased.
  1901. @LP
  1902. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will break the {{Times Slope} @Font {"upstream-version"}} and
  1903. {{Times Slope} @Font {"debian-revision"}} apart at the last hyphen in the string. The
  1904. absence of a {{Times Slope} @Font {"debian-revision"}} compares earlier than the presence
  1905. of one (but note that the {{Times Slope} @Font {"debian-revision"}} is the least
  1906. significant part of the version number).
  1907. @LP
  1908. The {{Times Slope} @Font {"debian-revision"}} may contain only alphanumerics and the
  1909. characters {{0.7 1.0} @Scale {Courier Bold} @Font {+}} and {{0.7 1.0} @Scale {Courier Bold} @Font {.}} (plus and full stop).
  1910. }
  1911. //0fe
  1912. @LP
  1913. The {{Times Slope} @Font {"upstream-version"}} and {{Times Slope} @Font {"debian-revision"}} parts are
  1914. compared by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} using the same algorithm:
  1915. @LP
  1916. The strings are compared from left to right.
  1917. @LP
  1918. First the initial part of each string consisting entirely of "non-digit"
  1919. characters is determined. These two parts (one of which may be empty)
  1920. are compared lexically. If a difference is found it is returned. The
  1921. lexical comparison is a comparison of ASCII values modified so that
  1922. all the letters sort earlier than all the "non-letters."
  1923. @LP
  1924. Then the initial part of the remainder of each string which consists
  1925. entirely of digit characters is determined. The numerical values of
  1926. these two parts are compared, and any difference found is returned as
  1927. the result of the comparison. For these purposes an empty string
  1928. (which can only occur at the end of one or both version strings being
  1929. compared) counts as zero.
  1930. @LP
  1931. These two steps are repeated (chopping initial "non-digit" strings and
  1932. initial digit strings off from the start) until a difference is found
  1933. or both strings are exhausted.
  1934. @LP
  1935. Note that the purpose of epochs is to allow us to leave behind
  1936. mistakes in version numbering, and to cope with situations where the
  1937. version numbering changes. It is {{Times Slope} @Font {not}} there to cope with version
  1938. numbers containing strings of letters which {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} cannot interpret
  1939. (such as {{0.7 1.0} @Scale {Courier Bold} @Font {ALPHA}} or {{0.7 1.0} @Scale {Courier Bold} @Font {"pre"--""}}), or with silly orderings (the author
  1940. of this manual has heard of a package whose versions went {{0.7 1.0} @Scale {Courier Bold} @Font {1.1}},
  1941. {{0.7 1.0} @Scale {Courier Bold} @Font {1.2}}, {{0.7 1.0} @Scale {Courier Bold} @Font {1.3}}, {{0.7 1.0} @Scale {Courier Bold} @Font {1}}, {{0.7 1.0} @Scale {Courier Bold} @Font {2.1}}, {{0.7 1.0} @Scale {Courier Bold} @Font {2.2}}, {{0.7 1.0} @Scale {Courier Bold} @Font {2}} and so forth).
  1942. @LP
  1943. If an upstream package has problematic version numbers they should be
  1944. converted to a sane form for use in the {{0.7 1.0} @Scale {Courier Bold} @Font {Version}} field.
  1945. @LP
  1946. @NP
  1947. {
  1948. newpath 0 ysize 0.3 ft sub moveto
  1949. xsize 0 rlineto
  1950. 0 0.2 ft rlineto
  1951. xsize neg 0 rlineto
  1952. closepath fill
  1953. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-maintainerscripts}
  1954. 6.|0.5fe{ Package maintainer scripts
  1955. and installation procedure}}}} |0f }} //0.0fe
  1956. @LP
  1957. @CNP
  1958. {
  1959. newpath 0 ysize 0.3 ft sub moveto
  1960. xsize 0 rlineto
  1961. 0 0.1 ft rlineto
  1962. xsize neg 0 rlineto
  1963. closepath fill
  1964. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s6.1}
  1965. 6.1.|0.5fe{ Introduction to package maintainer scripts}}}} |0f }} //0.0fe
  1966. @LP
  1967. It is possible supply scripts as part of a package which {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  1968. will run for you when your package is installed, upgraded or removed.
  1969. @LP
  1970. These scripts should be the files {{0.7 1.0} @Scale {Courier Bold} @Font {preinst}}, {{0.7 1.0} @Scale {Courier Bold} @Font {postinst}},
  1971. {{0.7 1.0} @Scale {Courier Bold} @Font {prerm}} and {{0.7 1.0} @Scale {Courier Bold} @Font {postrm}} in the control area of the package. They
  1972. must be proper exectuable files; if they are scripts (which is
  1973. recommended) they must start with the usual {{0.7 1.0} @Scale {Courier Bold} @Font {"#!"}} convention. They
  1974. should be readable and executable to anyone, and not "world-writeable."
  1975. @LP
  1976. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} looks at the exit status from these scripts. It is
  1977. important that they exit with a "non-zero" status if there is an error,
  1978. so that {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} can stop its processing. For shell scripts this
  1979. means that you {{Times Slope} @Font {almost always}} need to use {{0.7 1.0} @Scale {Courier Bold} @Font {set ""--"e"}} (this is
  1980. usually true when writing shell scripts, in fact). It is also
  1981. important, of course, that they don't exit with a "non-zero" status if
  1982. everything went well.
  1983. @LP
  1984. It is necessary for the error recovery procedures that the scripts be
  1985. idempotent: ie, invoking the same script several times in the same
  1986. situation should do no harm. If the first call failed, or aborted
  1987. half way through for some reason, the second call should merely do the
  1988. things that were left undone the first time, if any, and exit with a
  1989. success status.
  1990. @LP
  1991. When a package is upgraded a combination of the scripts from the old
  1992. and new packages is called in amongst the other steps of the upgrade
  1993. procedure. If your scripts are going to be at all complicated you
  1994. need to be aware of this, and may need to check the arguments to your
  1995. scripts.
  1996. @LP
  1997. Broadly speaking the {{0.7 1.0} @Scale {Courier Bold} @Font {preinst}} is called before (a particular
  1998. version of) a package is installed, and the {{0.7 1.0} @Scale {Courier Bold} @Font {postinst}} afterwards;
  1999. the {{0.7 1.0} @Scale {Courier Bold} @Font {prerm}} before (a version of) a package is removed and the
  2000. {{0.7 1.0} @Scale {Courier Bold} @Font {postrm}} afterwards.
  2001. @LP
  2002. @CNP
  2003. {
  2004. newpath 0 ysize 0.3 ft sub moveto
  2005. xsize 0 rlineto
  2006. 0 0.1 ft rlineto
  2007. xsize neg 0 rlineto
  2008. closepath fill
  2009. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-mscriptsinstact}
  2010. 6.2.|0.5fe{ Summary of ways maintainer scripts are called}}}} |0f }} //0.0fe
  2011. @LP
  2012. {@RawBulletList
  2013. gap { 1.0vx }
  2014. @ListItem {
  2015. {{Times Slope} @Font {"new-preinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {install}}
  2016. }
  2017. @ListItem {
  2018. {{Times Slope} @Font {"new-preinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {install}} {{Times Slope} @Font {"old-version"}}
  2019. }
  2020. @ListItem {
  2021. {{Times Slope} @Font {"new-preinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {upgrade}} {{Times Slope} @Font {"old-version"}}
  2022. }
  2023. @ListItem {
  2024. {{Times Slope} @Font {"old-preinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"upgrade"}} {{Times Slope} @Font {"new-version"}}
  2025. }
  2026. @RawEndList}//0ve
  2027. @LP
  2028. {@RawBulletList
  2029. gap { 1.0vx }
  2030. @ListItem {
  2031. {{Times Slope} @Font {postinst}} {{0.7 1.0} @Scale {Courier Bold} @Font {configure}} {{Times Slope} @Font {"most-recently-configured-version"}}
  2032. }
  2033. @ListItem {
  2034. {{Times Slope} @Font {"old-postinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"upgrade"}} {{Times Slope} @Font {new version}}
  2035. }
  2036. @ListItem {
  2037. {{Times Slope} @Font {"conflictor's-postinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"remove"}}
  2038. {{0.7 1.0} @Scale {Courier Bold} @Font {"in"--"favour"}} {{Times Slope} @Font {package}} {{Times Slope} @Font {"new-version"}}
  2039. }
  2040. @ListItem {
  2041. {{Times Slope} @Font {"deconfigured's-postinst"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"deconfigure"}}
  2042. {{0.7 1.0} @Scale {Courier Bold} @Font {"in"--"favour"}} {{Times Slope} @Font {"failed-install-package"}} {{Times Slope} @Font {version}}
  2043. {{0.7 1.0} @Scale {Courier Bold} @Font {removing}} {{Times Slope} @Font {"conflicting-package"}} {{Times Slope} @Font {version}}
  2044. }
  2045. @RawEndList}//0ve
  2046. @LP
  2047. {@RawBulletList
  2048. gap { 1.0vx }
  2049. @ListItem {
  2050. {{Times Slope} @Font {prerm}} {{0.7 1.0} @Scale {Courier Bold} @Font {remove}}
  2051. }
  2052. @ListItem {
  2053. {{Times Slope} @Font {"old-prerm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {upgrade}} {{Times Slope} @Font {"new-version"}}
  2054. }
  2055. @ListItem {
  2056. {{Times Slope} @Font {"new-prerm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"failed"--"upgrade"}} {{Times Slope} @Font {"old-version"}}
  2057. }
  2058. @ListItem {
  2059. {{Times Slope} @Font {"conflictor's-prerm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {remove}} {{0.7 1.0} @Scale {Courier Bold} @Font {"in"--"favour"}}
  2060. {{Times Slope} @Font {package}} {{Times Slope} @Font {"new-version"}}
  2061. }
  2062. @ListItem {
  2063. {{Times Slope} @Font {"deconfigured's-prerm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {deconfigure}}
  2064. {{0.7 1.0} @Scale {Courier Bold} @Font {"in"--"favour"}} {{Times Slope} @Font {"package-being-installed"}} {{Times Slope} @Font {version}}
  2065. {{0.7 1.0} @Scale {Courier Bold} @Font {removing}} {{Times Slope} @Font {"conflicting-package"}} {{Times Slope} @Font {version}}
  2066. }
  2067. @RawEndList}//0ve
  2068. @LP
  2069. {@RawBulletList
  2070. gap { 1.0vx }
  2071. @ListItem {
  2072. {{Times Slope} @Font {postrm}} {{0.7 1.0} @Scale {Courier Bold} @Font {remove}}
  2073. }
  2074. @ListItem {
  2075. {{Times Slope} @Font {postrm}} {{0.7 1.0} @Scale {Courier Bold} @Font {purge}}
  2076. }
  2077. @ListItem {
  2078. {{Times Slope} @Font {"old-postrm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {upgrade}} {{Times Slope} @Font {"new-version"}}
  2079. }
  2080. @ListItem {
  2081. {{Times Slope} @Font {"new-postrm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"failed"--"upgrade"}} {{Times Slope} @Font {"old-version"}}
  2082. }
  2083. @ListItem {
  2084. {{Times Slope} @Font {"new-postrm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"install"}}
  2085. }
  2086. @ListItem {
  2087. {{Times Slope} @Font {"new-postrm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"install"}} {{Times Slope} @Font {"old-version"}}
  2088. }
  2089. @ListItem {
  2090. {{Times Slope} @Font {"new-postrm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {"abort"--"upgrade"}} {{Times Slope} @Font {"old-version"}}
  2091. }
  2092. @ListItem {
  2093. {{Times Slope} @Font {"disappearer's-postrm"}} {{0.7 1.0} @Scale {Courier Bold} @Font {disappear}} {{Times Slope} @Font {overwriter}} {{Times Slope} @Font {"new-version"}}
  2094. }
  2095. @RawEndList}//0ve
  2096. @LP
  2097. @CNP
  2098. {
  2099. newpath 0 ysize 0.3 ft sub moveto
  2100. xsize 0 rlineto
  2101. 0 0.1 ft rlineto
  2102. xsize neg 0 rlineto
  2103. closepath fill
  2104. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s6.3}
  2105. 6.3.|0.5fe{ Details of unpack phase of installation or upgrade}}}} |0f }} //0.0fe
  2106. @LP
  2107. The procedure on "installation/upgrade/overwrite/disappear" (ie, when
  2108. running {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"unpack"}}, or the unpack stage of {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg
  2109. ""--""--"install"}}) is as follows. In each case if an error occurs the
  2110. actions in are general run backwards "-" this means that the maintainer
  2111. scripts are run with different arguments in reverse order. These are
  2112. the `error unwind' calls listed below.
  2113. @LP
  2114. {@RawNumberedList
  2115. @ListItem {
  2116. {@RawRomanList
  2117. @ListItem {
  2118. If a version the package is already
  2119. installed, call
  2120. //1.0vx
  2121. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2122. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"prerm"}}}} upgrade {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"version"}}}}}}} //0.2fe
  2123. }
  2124. @ListItem {
  2125. If this gives an error (ie, a "non-zero" exit status), dpkg will
  2126. attempt instead:
  2127. //1.0vx
  2128. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2129. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"prerm"}}}} "failed"--"upgrade" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"version"}}}}}}} //0.2fe
  2130. Error unwind, for both the above cases:
  2131. //1.0vx
  2132. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2133. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"postinst"}}}} "abort"--"upgrade" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"version"}}}}}}} //0.2fe
  2134. }
  2135. @RawEndList}//0ve
  2136. }
  2137. @ListItem {
  2138. If a `conflicting' package is being removed at the same time:
  2139. @LP
  2140. {@RawRomanList
  2141. @ListItem {
  2142. If any packages depended on that conflicting package and
  2143. {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"auto"--"deconfigure"}} is specified, call, for each such package:
  2144. //1.0vx
  2145. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2146. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"deconfigured's"--"prerm"}}}} deconfigure "\\"
  2147. "in"--"favour" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"package"--"being"--"installed"}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}} "\\"
  2148. removing {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"conflicting"--"package"}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}}} //0.2fe
  2149. Error unwind:
  2150. //1.0vx
  2151. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2152. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"deconfigured's"--"postinst"}}}} "abort"--"deconfigure" "\\"
  2153. "in"--"favour" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"package"--"being"--"installed"--"but"--"failed"}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}} "\\"
  2154. removing {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"conflicting"--"package"}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {version}}}}}}} //0.2fe
  2155. The deconfigured packages are marked as requiring configuration, so
  2156. that if {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"install"}} is used they will be configured again if
  2157. possible.
  2158. }
  2159. @ListItem {
  2160. To prepare for removal of the conflicting package, call:
  2161. //1.0vx
  2162. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2163. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"conflictor's"--"prerm"}}}} remove "in"--"favour" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"version"}}}}}}} //0.2fe
  2164. Error unwind:
  2165. //1.0vx
  2166. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2167. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"conflictor's"--"postinst"}}}} "abort"--"remove" "\\"
  2168. "in"--"favour" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"version"}}}}}}} //0.2fe
  2169. }
  2170. @RawEndList}//0ve
  2171. }
  2172. @ListItem {
  2173. {@RawRomanList
  2174. @ListItem {
  2175. If the package is being upgraded, call:
  2176. //1.0vx
  2177. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2178. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"preinst"}}}} upgrade {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"version"}}}}}}} //0.2fe
  2179. }
  2180. @ListItem {
  2181. Otherwise, if the package had some configuration files from a previous
  2182. version installed (ie, it is in the `configuration files only' state):
  2183. //1.0vx
  2184. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2185. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"preinst"}}}} install {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"version"}}}}}}} //0.2fe
  2186. }
  2187. @ListItem {
  2188. Otherwise (ie, the package was completely purged):
  2189. //1.0vx
  2190. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2191. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"preinst"}}}} install}}} //0.2fe
  2192. Error unwind versions, respectively:
  2193. //1.0vx
  2194. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2195. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"postrm"}}}} "abort"--"upgrade" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"version"}}}}
  2196. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"postrm"}}}} "abort"--"install" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"version"}}}}
  2197. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"postrm"}}}} "abort"--"install"}}} //0.2fe
  2198. }
  2199. @RawEndList}//0ve
  2200. }
  2201. @ListItem {
  2202. The new package's files are unpacked, overwriting any that may be on
  2203. the system already, for example any from the old version of the same
  2204. package or from another package (backups of the old files are left
  2205. around, and if anything goes wrong dpkg will attempt to put them back
  2206. as part of the error unwind).
  2207. @LP
  2208. It is an error for a package to contains files which are on the system
  2209. in another package, unless {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} is used (see
  2210. `{{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} "-" overwriting files and replacing packages', page @PageOf{s-replaces}). Currently the {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"force"--"overwrite"}} flag is
  2211. enabled, downgrading it to a warning, but this may not always be the
  2212. case.
  2213. @LP
  2214. Packages which overwrite each other's files produce behaviour which
  2215. though deterministic is hard for the system administrator to
  2216. understand. It can easily lead to `missing' programs if, for example,
  2217. a package is installed which overwrites a file from another package,
  2218. and is then removed again.{@FootNote{ Part of the problem is due to what
  2219. is arguably a bug in {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}.}}
  2220. }
  2221. @ListItem {
  2222. {@RawRomanList
  2223. @ListItem {
  2224. If the package is being upgraded, call
  2225. //1.0vx
  2226. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2227. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"postrm"}}}} upgrade {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"version"}}}}}}} //0.2fe
  2228. }
  2229. @ListItem {
  2230. If this fails, {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will attempt:
  2231. //1.0vx
  2232. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2233. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"postrm"}}}} "failed"--"upgrade" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"version"}}}}}}} //0.2fe
  2234. Error unwind, for both cases:
  2235. //1.0vx
  2236. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2237. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"old"--"preinst"}}}} "abort"--"upgrade" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"new"--"version"}}}}}}} //0.2fe
  2238. }
  2239. @RawEndList}//0ve
  2240. @LP
  2241. This is the point of no return "-" if {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} gets this far, it won't
  2242. back off past this point if an error occurs. This will leave the
  2243. package in a fairly bad state, which will require a successful
  2244. reinstallation to clear up, but it's when {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} starts doing
  2245. things that are irreversible.
  2246. }
  2247. @ListItem {
  2248. Any files which were in the old version of the package but not in the
  2249. new are removed.
  2250. }
  2251. @ListItem {
  2252. The new file list replaces the old.
  2253. }
  2254. @ListItem {
  2255. The new maintainer scripts replace the old.
  2256. }
  2257. @ListItem {
  2258. Any packages all of whose files have been overwritten during the
  2259. installation, and which aren't required for dependencies, are considered
  2260. to have been removed. For each such package,
  2261. @LP
  2262. {@RawRomanList
  2263. @ListItem {
  2264. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} calls:
  2265. //1.0vx
  2266. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2267. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"disappearer's"--"postrm"}}}} disappear "\\"
  2268. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {overwriter}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"overwriter"--"version"}}}}}}} //0.2fe
  2269. }
  2270. @ListItem {
  2271. The package's maintainer scripts are removed.
  2272. }
  2273. @ListItem {
  2274. It is noted in the status database as being in a sane state, namely
  2275. not installed (any conffiles it may have are ignored, rather than
  2276. being removed by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}). Note that disappearing packages do not
  2277. have their prerm called, because {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} doesn't know in advance
  2278. that the package is going to vanish.
  2279. }
  2280. @RawEndList}//0ve
  2281. }
  2282. @ListItem {
  2283. Any files in the package we're unpacking that are also listed in the
  2284. file lists of other packages are removed from those lists. (This will
  2285. lobotomise the file list of the `conflicting' package if there is one.)
  2286. }
  2287. @ListItem {
  2288. The backup files made during installation, above, are deleted.
  2289. }
  2290. @ListItem {
  2291. The new package's status is now sane, and recorded as `unpacked'. Here
  2292. is another point of no return "-" if the conflicting package's removal
  2293. fails we do not unwind the rest of the installation; the conflicting
  2294. package is left in a "half-removed" limbo.
  2295. }
  2296. @ListItem {
  2297. If there was a conflicting package we go and do the removal actions
  2298. (described below), starting with the removal of the conflicting
  2299. package's files (any that are also in the package being installed
  2300. have already been removed from the conflicting package's file list,
  2301. and so do not get removed now).
  2302. }
  2303. @RawEndList}//0ve
  2304. @LP
  2305. @CNP
  2306. {
  2307. newpath 0 ysize 0.3 ft sub moveto
  2308. xsize 0 rlineto
  2309. 0 0.1 ft rlineto
  2310. xsize neg 0 rlineto
  2311. closepath fill
  2312. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s6.4}
  2313. 6.4.|0.5fe{ Details of configuration}}}} |0f }} //0.0fe
  2314. @LP
  2315. When we configure a package (this happens with {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"install"}}, or
  2316. with {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"configure"}}), we first update the conffiles and then call:
  2317. //1.0vx
  2318. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2319. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {postinst}}}} configure {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"most"--"recently"--"configured"--"version"}}}}}}} //0.2fe
  2320. @LP
  2321. No attempt is made to unwind after errors during configuration.
  2322. @LP
  2323. If there is no most recently configured version {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will pass a
  2324. null argument; older versions of dpkg may pass
  2325. {{0.7 1.0} @Scale {Courier Bold} @Font {<unknown>}} (including the angle brackets) in this case.
  2326. Even older ones do not pass a second argument at all, under any
  2327. circumstances.
  2328. @LP
  2329. @CNP
  2330. {
  2331. newpath 0 ysize 0.3 ft sub moveto
  2332. xsize 0 rlineto
  2333. 0 0.1 ft rlineto
  2334. xsize neg 0 rlineto
  2335. closepath fill
  2336. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s6.5}
  2337. 6.5.|0.5fe{ Details of removal "and/or" configuration purging}}}} |0f }} //0.0fe
  2338. @LP
  2339. {@RawNumberedList
  2340. @ListItem {
  2341. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2342. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {prerm}}}} remove}}} //0.2fe
  2343. }
  2344. @ListItem {
  2345. The package's files are removed (except conffiles).
  2346. }
  2347. @ListItem {
  2348. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2349. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {postrm}}}} remove}}} //0.2fe
  2350. }
  2351. @ListItem {
  2352. All the maintainer scripts except the postrm are removed.
  2353. @LP
  2354. If we aren't purging the package we stop here. Note that packages
  2355. which have no postrm and no conffiles are automatically purged when
  2356. removed, as there is no difference except for the {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} status.
  2357. }
  2358. @ListItem {
  2359. The conffiles and any backup files ({{0.7 1.0} @Scale {Courier Bold} @Font {~}}"-files," {{0.7 1.0} @Scale {Courier Bold} @Font {"#*#"}} files,
  2360. {{0.7 1.0} @Scale {Courier Bold} @Font {%}}"-files," {{0.7 1.0} @Scale {Courier Bold} @Font {".dpkg"--"{old,new,tmp}"}}, etc.) are removed.
  2361. }
  2362. @ListItem {
  2363. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2364. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {postrm}}}} purge}}} //0.2fe
  2365. }
  2366. @ListItem {
  2367. The package's file list is removed.
  2368. }
  2369. @RawEndList}//0ve
  2370. @LP
  2371. No attempt is made to unwind after errors during removal.
  2372. @LP
  2373. @NP
  2374. {
  2375. newpath 0 ysize 0.3 ft sub moveto
  2376. xsize 0 rlineto
  2377. 0 0.2 ft rlineto
  2378. xsize neg 0 rlineto
  2379. closepath fill
  2380. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-descriptions}
  2381. 7.|0.5fe{ Descriptions of packages "-" the
  2382. {{0.7 1.0} @Scale {Courier Bold} @Font {Description}} field}}}} |0f }} //0.0fe
  2383. @LP
  2384. The {{0.7 1.0} @Scale {Courier Bold} @Font {Description}} control file field is used by {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} when
  2385. the user is selecting which packages to install and by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  2386. when it displays information about the status of packages and so
  2387. forth. It is included on the FTP site in the {{0.7 1.0} @Scale {Courier Bold} @Font {Packages}} files,
  2388. and may also be used by the Debian WWW pages.
  2389. @LP
  2390. The description is intended to describe the program to a user who has
  2391. never met it before so that they know whether they want to install it.
  2392. It should also give information about the significant dependencies and
  2393. conflicts between this package and others, so that the user knows why
  2394. these dependencies and conflicts have been declared.
  2395. @LP
  2396. The field's format is as follows:
  2397. //1.0vx
  2398. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2399. Description: {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {single line synopsis}}}}
  2400. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {extended description over several lines}}}}}}} //0.2fe
  2401. @LP
  2402. The synopsis is often printed in lists of packages and so forth, and
  2403. should be as informative as possible. Every package should also have
  2404. an extended description.
  2405. @LP
  2406. @CNP
  2407. {
  2408. newpath 0 ysize 0.3 ft sub moveto
  2409. xsize 0 rlineto
  2410. 0 0.1 ft rlineto
  2411. xsize neg 0 rlineto
  2412. closepath fill
  2413. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s7.1}
  2414. 7.1.|0.5fe{ Types of formatting line in the extended description}}}} |0f }} //0.0fe
  2415. @LP
  2416. {@RawBulletList
  2417. @ListItem {
  2418. Those starting with a single space are part of a paragraph.
  2419. Successive lines of this form will be "word-wrapped" when displayed.
  2420. The leading space will usually be stripped off.
  2421. }
  2422. @ListItem {
  2423. Those starting with two or more spaces. These will be displayed
  2424. verbatim. If the display cannot be panned horizontally the
  2425. displaying program will linewrap them `hard' (ie, without taking
  2426. account of word breaks). If it can they will be allowed to trail
  2427. off to the right. None, one or two initial spaces may be deleted,
  2428. but the number of spaces deleted from each line will be the same
  2429. (so that you can have indenting work correctly, for example).
  2430. }
  2431. @ListItem {
  2432. Those containing a single space followed by a single full stop
  2433. character. These are rendered as blank lines. This is the {{Times Slope} @Font {only}}
  2434. way to get a blank line "-" see below.
  2435. }
  2436. @ListItem {
  2437. Those containing a space, a full stop and some more characters. These
  2438. are for future expansion. Do not use them.
  2439. }
  2440. @RawEndList}//0ve
  2441. @LP
  2442. @CNP
  2443. {
  2444. newpath 0 ysize 0.3 ft sub moveto
  2445. xsize 0 rlineto
  2446. 0 0.1 ft rlineto
  2447. xsize neg 0 rlineto
  2448. closepath fill
  2449. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s7.2}
  2450. 7.2.|0.5fe{ Notes about writing descriptions}}}} |0f }} //0.0fe
  2451. @LP
  2452. {{Times Slope} @Font {Always}} start extended description lines with at least one
  2453. whitespace character. Fields in the control file and in the Packages
  2454. file are separated by field names starting in the first column, just
  2455. as message header fields are in RFC822. Forgetting the whitespace
  2456. will cause {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"deb"}}{@FootNote{ Version 0.93.23 or
  2457. later.}} to produce a syntax error when trying to build the
  2458. package. If you force it to build anyway {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will refuse to
  2459. install the resulting mess.
  2460. @LP
  2461. {{Times Slope} @Font {Do not}} include any completely {{Times Slope} @Font {empty}} lines. These separate
  2462. different records in the Packages file and different packages in the
  2463. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/control"}} file, and are forbidden in package control
  2464. files. See the previous paragraph for what happens if you get this
  2465. wrong.
  2466. @LP
  2467. The single line synopsis should be kept brief "-" certainly under 80
  2468. characters. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} displays between 25 and 49 characters
  2469. without panning if you're using an "80-column" terminal, depending on
  2470. what display options are in effect.
  2471. @LP
  2472. Do not include the package name in the synopsis line. The display
  2473. software knows how to display this already, and you do not need to
  2474. state it. Remember that in many situations the user may only see
  2475. the synopsis line "-" make it as informative as you can.
  2476. @LP
  2477. The extended description should describe what the package does and
  2478. how it relates to the rest of the system (in terms of, for
  2479. example, which subsystem it is which part of).
  2480. @LP
  2481. The blurb that comes with a program in its announcements "and/or"
  2482. {{0.7 1.0} @Scale {Courier Bold} @Font {README}} files is rarely suitable for use in a description. It
  2483. is usually aimed at people who are already in the community where the
  2484. package is used. The description field needs to make sense to anyone,
  2485. even people who have no idea about any of the
  2486. things the package deals with.
  2487. @LP
  2488. Put important information first, both in the synopis and extended
  2489. description. Sometimes only the first part of the synopsis or of
  2490. the description will be displayed. You can assume that there will
  2491. usually be a way to see the whole extended description.
  2492. @LP
  2493. You may include information about dependencies and so forth in the
  2494. extended description, if you wish.
  2495. @LP
  2496. Do not use tab characters. Their effect is not predictable.
  2497. @LP
  2498. Do not try to linewrap the summary (the part on the same line as the
  2499. field name {{0.7 1.0} @Scale {Courier Bold} @Font {Description}}) into the extended description. This will
  2500. not work correctly when the full description is displayed, and makes
  2501. no sense where only the summary is available.
  2502. @LP
  2503. @CNP
  2504. {
  2505. newpath 0 ysize 0.3 ft sub moveto
  2506. xsize 0 rlineto
  2507. 0 0.1 ft rlineto
  2508. xsize neg 0 rlineto
  2509. closepath fill
  2510. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s7.3}
  2511. 7.3.|0.5fe{ Example description in control file for Smail}}}} |0f }} //0.0fe
  2512. @LP
  2513. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2514. Package: smail
  2515. Version: "3.1.29.1"--"13"
  2516. Maintainer: Ian Jackson <"iwj10@cus.cam.ac.uk">
  2517. Recommends: pine "|" mailx "|" elm "|" emacs "|" "mail"--"user"--"agent"
  2518. Suggests: metamail
  2519. Depends: cron, libc5
  2520. Conflicts: sendmail
  2521. Provides: "mail"--"transport"--"agent"
  2522. Description: Electronic mail transport system.
  2523. Smail is the recommended mail transport agent (MTA) for Debian.
  2524. .
  2525. An MTA is the innards of the mail system ""--"" it takes messages from
  2526. "user"--"friendly" mailer programs and arranges for them to be delivered
  2527. locally or passed on to other systems as required.
  2528. .
  2529. In order to make use of it you must have one or more user level
  2530. mailreader programs such as elm, pine, mailx or Emacs (which has Rmail
  2531. and VM as mailreaders) installed. If you wish to send messages other
  2532. than just to other users of your system you must also have appropriate
  2533. and VM as mailreaders) installed. If you wish to send messages other
  2534. than just to other users of your system you must also have appropriate
  2535. networking support, in the form of IP or UUCP.}}} //0.2fe
  2536. @LP
  2537. @NP
  2538. {
  2539. newpath 0 ysize 0.3 ft sub moveto
  2540. xsize 0 rlineto
  2541. 0 0.2 ft rlineto
  2542. xsize neg 0 rlineto
  2543. closepath fill
  2544. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-relationships}
  2545. 8.|0.5fe{ Declaring relationships between packages}}}} |0f }} //0.0fe
  2546. @LP
  2547. Packages can declare in their control file that they have certain
  2548. relationships to other packages "-" for example, that they may not be
  2549. installed at the same time as certain other packages, "and/or" that they
  2550. depend on the presence of others, or that they should overwrite files
  2551. in certain other packages if present.
  2552. @LP
  2553. This is done using the {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}},
  2554. {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} control file fields.
  2555. @LP
  2556. @CNP
  2557. {
  2558. newpath 0 ysize 0.3 ft sub moveto
  2559. xsize 0 rlineto
  2560. 0 0.1 ft rlineto
  2561. xsize neg 0 rlineto
  2562. closepath fill
  2563. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-depsyntax}
  2564. 8.1.|0.5fe{ Syntax of relationship fields}}}} |0f }} //0.0fe
  2565. @LP
  2566. These fields all have a uniform syntax. They are a list of package
  2567. names separated by commas.
  2568. @LP
  2569. In {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}} and {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}
  2570. (the fields which declare dependencies of the package in which they
  2571. occur on other packages) these package names may also be lists of
  2572. alternative package names, separated by vertical bar symbols {{0.7 1.0} @Scale {Courier Bold} @Font {"|"}}
  2573. (pipe symbols).
  2574. @LP
  2575. All the fields except {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}} may restrict their applicability
  2576. to particular versions of each named package. This is done in
  2577. parentheses after each individual package name; the parentheses should
  2578. contain a relation from the list below followed by a version number,
  2579. in the format described in `Version numbering', page @PageOf{ch-versions}.
  2580. @LP
  2581. The relations allowed are
  2582. {{0.7 1.0} @Scale {Courier Bold} @Font {<<}},
  2583. {{0.7 1.0} @Scale {Courier Bold} @Font {<=}},
  2584. {{0.7 1.0} @Scale {Courier Bold} @Font {=}},
  2585. {{0.7 1.0} @Scale {Courier Bold} @Font {>=}} and
  2586. {{0.7 1.0} @Scale {Courier Bold} @Font {>>}}
  2587. for strictly earlier, earlier or equal, exactly equal, later or equal
  2588. and strictly later, respectively. The forms {{0.7 1.0} @Scale {Courier Bold} @Font {<}} and {{0.7 1.0} @Scale {Courier Bold} @Font {>}}
  2589. were used to mean "earlier/later" or equal, rather than strictly
  2590. "earlier/later," so they should not appear in new packages (though
  2591. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} still supports them).
  2592. @LP
  2593. Whitespace may appear at any point in the version specification, and
  2594. must appear where it's necessary to disambiguate; it is not otherwise
  2595. significant. For consistency and in case of future changes to
  2596. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} it is recommended that a single space be used after a
  2597. version relationship and before a version number; it is usual also to
  2598. put a single space after each comma, on either side of each vertical
  2599. bar, and before each open parenthesis.
  2600. @LP
  2601. For example:
  2602. //1.0vx
  2603. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2604. Package: metamail
  2605. Version: "2.7"--"3"
  2606. Depends: libc5 (>= "5.2.18"--"4)," "mime"--"support," csh "|" tcsh}}} //0.2fe
  2607. @LP
  2608. @CNP
  2609. {
  2610. newpath 0 ysize 0.3 ft sub moveto
  2611. xsize 0 rlineto
  2612. 0 0.1 ft rlineto
  2613. xsize neg 0 rlineto
  2614. closepath fill
  2615. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s8.2}
  2616. 8.2.|0.5fe{ Dependencies "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}}, {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}}}}} |0f }} //0.0fe
  2617. @LP
  2618. These four fields are used to declare a dependency by one package on
  2619. another. They appear in the depending package's control file.
  2620. @LP
  2621. All but {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}} (discussed below) take effect {{Times Slope} @Font {only}} when
  2622. a package is to be configured. They do not prevent a package being on
  2623. the system in an unconfigured state while its dependencies are
  2624. unsatisfied, and it is possible to replace a package whose
  2625. dependencies are satisfied and which is properly installed with a
  2626. different version whose dependencies are not and cannot be satisfied;
  2627. when this is done the depending package will be left unconfigured
  2628. (since attempts to configure it will give errors) and will not
  2629. function properly.
  2630. @LP
  2631. For this reason packages in an installation run are usually all
  2632. unpacked first and all configured later; this gives later versions of
  2633. packages with dependencies on later versions of other packages the
  2634. opportunity to have their dependencies satisfied.
  2635. @LP
  2636. Thus {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}} allows package maintainers to impose an order in
  2637. which packages should be configured.
  2638. @LP
  2639. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}}}
  2640. //1.0vx
  2641. @RawIndentedDisplay {
  2642. This declares an absolute dependency.
  2643. @LP
  2644. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will not configure
  2645. packages whose dependencies aren't satisfied. If it is asked to make
  2646. an installation which would cause an installed package's dependencies
  2647. to become unsatisfied it will complain{@FootNote{ Current versions
  2648. (1.2.4) of {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} have a bug in this area which will cause some of
  2649. these problems to be ignored.}}, unless
  2650. {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"auto"--"deconfigure"}} is specified, in which case those packages
  2651. will be deconfigured before the installation proceeds.
  2652. @LP
  2653. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} makes it hard for the user to select packages for
  2654. installation, removal or upgrade in a way that would mean that
  2655. packages' {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}} fields would be unsatisfied. The user can
  2656. override this if they wish, for example if they know that {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}
  2657. has an "out-of-date" view of the real package relationships.
  2658. @LP
  2659. The {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}} field should be used if the "depended-on" package is
  2660. required for the depending package to provide a significant amount of
  2661. functionality.
  2662. }
  2663. //0fe //1.2fx
  2664. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}}}
  2665. //1.0vx
  2666. @RawIndentedDisplay {
  2667. This declares a strong, but not absolute, dependency.
  2668. @LP
  2669. {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}} is ignored by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}, so that users using the
  2670. "command-line" (who are presumed to know what they're doing) will not be
  2671. impeded.
  2672. @LP
  2673. It is treated by {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} exactly as {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}} is; this makes
  2674. it hard for the user to select things so as to leave {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}
  2675. fields unsatisfied, but they are able to do so by being persistent.
  2676. @LP
  2677. The {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}} field should list packages that would be found
  2678. together with this one in all but unusual installations.
  2679. }
  2680. //0fe //1.2fx
  2681. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}}}}
  2682. //1.0vx
  2683. @RawIndentedDisplay {
  2684. This is used to declare that one package may be more useful with one
  2685. or more others. Using this field tells the packaging system and the
  2686. user that the listed packages are be related to this one and can
  2687. perhaps enhance its usefulness, but that installing this one without
  2688. them is perfectly reasonable.
  2689. @LP
  2690. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will offer suggsted packages to the system administrator
  2691. when they select the suggesting package, but the default is not to
  2692. install the suggested package.
  2693. }
  2694. //0fe //1.2fx
  2695. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}}}
  2696. //1.0vx
  2697. @RawIndentedDisplay {
  2698. This field is like {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, except that it also forces {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  2699. to complete installation of the packages named before even starting
  2700. the installation of the package which declares the predependency.
  2701. @LP
  2702. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} checks for predependencies when it is doing an
  2703. installation run, and will attempt to find the packages which are
  2704. required to be installed first and do so in the right order.
  2705. @LP
  2706. However, this process is slow (because it requires repeated
  2707. invocations of {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}) and troublesome (because it requires
  2708. guessing where to find the appropriate files).
  2709. @LP
  2710. For these reasons, and because this field imposes restrictions on the
  2711. order in which packages may be unpacked (which can be difficult for
  2712. installations from multipart media, for example), {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}}
  2713. should be used sparingly, preferably only by packages whose premature
  2714. upgrade or installation would hamper the ability of the system to
  2715. continue with any upgrade that might be in progress.
  2716. @LP
  2717. When the package declaring it is being configured, a
  2718. {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Dependency"}} will be considered satisfied only if the depending
  2719. package has been correctly configured, just as if an ordinary
  2720. {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}} had been used.
  2721. @LP
  2722. However, when a package declaring a predependency is being unpacked
  2723. the predependency can be satisfied even if the "depended-on" package(s)
  2724. are only unpacked or "half-configured," provided that they have been
  2725. configured correctly at some point in the past (and not removed or
  2726. partially removed since). In this case both the "previously-configured"
  2727. and currently unpacked or "half-configured" versions must satisfy any
  2728. version clause in the {{0.7 1.0} @Scale {Courier Bold} @Font {"Pre"--"Depends"}} field.
  2729. }
  2730. //0fe
  2731. @LP
  2732. @CNP
  2733. @Heading +3p @Font { 1.2vx @Break { {@PageMark s8.2.1}
  2734. 8.2.1.|0.5fe{ Dependencies on shared libraries}}}//0.2fe
  2735. @LP
  2736. The dependency fields listed above are used by packages which need
  2737. shared libraries to declare dependencies on the appropriate packages.
  2738. @LP
  2739. These dependencies are usually determined automatically using
  2740. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"shlibdeps"}} and inserted in the package control file using
  2741. the control file substitution variables mechanism; see `{{0.7 1.0} @Scale {Courier Bold} @Font {"debian/substvars"}} and variable substitutions', page @PageOf{s-srcsubstvars} and `Tools for processing source packages', page @PageOf{s-sourcetools}.
  2742. @LP
  2743. @CNP
  2744. @Heading +3p @Font { 1.2vx @Break { {@PageMark s8.2.2}
  2745. 8.2.2.|0.5fe{ Deconfiguration due to removal during bulk installations}}}//0.2fe
  2746. @LP
  2747. If {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} would like to remove a package due to a conflict, as
  2748. described above, but this would violate a dependency of some other
  2749. package on the system, {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will usually not remove the
  2750. conflicting package and halt with an error.
  2751. @LP
  2752. However, if the {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"auto"--"deconfigure"}} ({{0.7 1.0} @Scale {Courier Bold} @Font {""--"B"}}) option is used
  2753. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will automatically `deconfigure' the package with the
  2754. problematic dependency, so that the conflicting package can be removed
  2755. and the package we're trying to install can be installed. If
  2756. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} is being asked to install packages (rather than just
  2757. unpacking them) it will try to reconfigure the package when it has
  2758. unpacked all its arguments, in the hope that one of the other packages
  2759. it is installing will satisfy the problematic dependency.
  2760. @LP
  2761. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} supplies this argument to {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} when it invokes it,
  2762. so that bulk installations proceed smoothly.
  2763. @LP
  2764. @CNP
  2765. {
  2766. newpath 0 ysize 0.3 ft sub moveto
  2767. xsize 0 rlineto
  2768. 0 0.1 ft rlineto
  2769. xsize neg 0 rlineto
  2770. closepath fill
  2771. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-conflicts}
  2772. 8.3.|0.5fe{ Alternative packages "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}}}}}} |0f }} //0.0fe
  2773. @LP
  2774. When one package declares a conflict with another {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will
  2775. refuse to allow them to be installed on the system at the same time.
  2776. @LP
  2777. If one package is to be installed, the other must be removed first "-"
  2778. if the package being installed is marked as replacing (`{{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} "-" overwriting files and replacing packages', page @PageOf{s-replaces}) the one on the system, or the one on the system is
  2779. marked as deselected, or both packages are marked {{0.7 1.0} @Scale {Courier Bold} @Font {Essential}}, then
  2780. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will automatically remove the package which is causing the
  2781. conflict, otherwise it will halt the installation of the new package
  2782. with an error.
  2783. @LP
  2784. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} makes it hard to select conflicting packages, though the
  2785. user can override this if they wish. If they do not override it then
  2786. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will select one of the packages for removal, and the user
  2787. must make sure it is the right one. In the future {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will
  2788. look for the presence of a {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} field to help decide which
  2789. package should be installed and which removed.
  2790. @LP
  2791. A package will not cause a conflict merely because its configuration
  2792. files are still installed; it must be at least "half-installed."
  2793. @LP
  2794. A special exception is made for packages which declare a conflict with
  2795. their own package name, or with a virtual package which they provide
  2796. (see below): this does not prevent their installation, and allows a
  2797. package to conflict with others providing a replacement for it. You
  2798. use this feature when you want the package in question to be the only
  2799. package providing something.
  2800. @LP
  2801. A {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}} entry should almost never have an `earlier than'
  2802. version clause. This would prevent {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} from upgrading or
  2803. installing the package which declared such a conflict until the
  2804. upgrade or removal of the "conflicted-with" package had been completed.
  2805. This aspect of installation ordering is not handled by {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}},
  2806. so that the use {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}} in this way is likely to cause problems
  2807. for `bulk run' upgrades and installations.
  2808. @LP
  2809. @CNP
  2810. {
  2811. newpath 0 ysize 0.3 ft sub moveto
  2812. xsize 0 rlineto
  2813. 0 0.1 ft rlineto
  2814. xsize neg 0 rlineto
  2815. closepath fill
  2816. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-virtual}
  2817. 8.4.|0.5fe{ Virtual packages "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}}}}}} |0f }} //0.0fe
  2818. @LP
  2819. As well as the names of actual (`concrete') packages, the package
  2820. relationship fields {{0.7 1.0} @Scale {Courier Bold} @Font {Depends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Recommends}}, {{0.7 1.0} @Scale {Courier Bold} @Font {Suggests}} and
  2821. {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}} may mention virtual packages.
  2822. @LP
  2823. A virtual package is one which appears in the {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}} control
  2824. file field of another package. The effect is as if the package(s)
  2825. which provide a particular virtual package name had been listed by
  2826. name everywhere were the virtual package name appears.
  2827. @LP
  2828. If there are both a real and a virtual package of the same name then
  2829. the dependency may be satisfied (or the conflict caused) by either the
  2830. real package or any of the virtual packages which provide it. This is
  2831. so that, for example, supposing we have
  2832. //1.0vx
  2833. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2834. Package: vm
  2835. Depends: emacs}}} //0.2fe
  2836. and someone else releases an xemacs package they can say
  2837. //1.0vx
  2838. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2839. Package: xemacs
  2840. Provides: emacs}}} //0.2fe
  2841. and all will work in the interim (until a purely virtual package name
  2842. is decided on and the {{0.7 1.0} @Scale {Courier Bold} @Font {emacs}} and {{0.7 1.0} @Scale {Courier Bold} @Font {vm}} packages are changed to
  2843. use it).
  2844. @LP
  2845. If a dependency or a conflict has a version number attached then only
  2846. real packages will be considered to see whether the relationship is
  2847. satisfied (or the prohibition violated, for a conflict) "-" it is
  2848. assumed that a real package which provides virtual package is not of
  2849. the `right' version. So, a {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}} field may not contain
  2850. version numbers, and the version number of the concrete package which
  2851. provides a particular virtual package will not be looked at when
  2852. considering a dependency on or conflict with the virtual package name.
  2853. @LP
  2854. If you want to specify which of a set of real packages should be the
  2855. default to satisfy a particular dependency on a virtual package, you
  2856. should list the real package as alternative before the virtual.
  2857. @LP
  2858. @CNP
  2859. {
  2860. newpath 0 ysize 0.3 ft sub moveto
  2861. xsize 0 rlineto
  2862. 0 0.1 ft rlineto
  2863. xsize neg 0 rlineto
  2864. closepath fill
  2865. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s-replaces}
  2866. 8.5.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} "-" overwriting files and replacing packages}}}} |0f }} //0.0fe
  2867. @LP
  2868. The {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} control file field has two purposes, which come into
  2869. play in different situations.
  2870. @LP
  2871. Virtual packages (`Virtual packages "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Provides}}', page @PageOf{s-virtual}) are not considered when looking
  2872. at a {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} field "-" the packages declared as being replaced
  2873. must be mentioned by their real names.
  2874. @LP
  2875. @CNP
  2876. @Heading +3p @Font { 1.2vx @Break { {@PageMark s8.5.1}
  2877. 8.5.1.|0.5fe{ Overwriting files in other packages}}}//0.2fe
  2878. @LP
  2879. Firstly, as mentioned before, it is usually an error for a package to
  2880. contains files which are on the system in another package, though
  2881. currently the {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"force"--"overwrite"}} flag is enabled by default,
  2882. downgrading the error to a warning,
  2883. @LP
  2884. If the overwriting package declares that it replaces the one
  2885. containing the file being overwritten then {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will proceed, and
  2886. replace the file from the old package with that from the new. The
  2887. file will no longer be listed as `owned' by the old package.
  2888. @LP
  2889. If a package is completely replaced in this way, so that {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  2890. does not know of any files it still contains, it is considered to have
  2891. disappeared. It will be marked as not wanted on the system (selected
  2892. for removal) and not installed. Any conffiles details noted in the
  2893. package will be ignored, as they will have been taken over by the
  2894. replacing package(s). The package's {{0.7 1.0} @Scale {Courier Bold} @Font {postrm}} script will be run to
  2895. allow the package to do any final cleanup required.
  2896. See `Summary of ways maintainer scripts are called', page @PageOf{s-mscriptsinstact}.
  2897. @LP
  2898. In the future {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will discard files which overwrite those from
  2899. another package which declares that it replaces the one being
  2900. installed (so that you can install an older version of a package
  2901. without problems).
  2902. @LP
  2903. This usage of {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} only takes effect when both packages are
  2904. at least partially on the system at once, so that it can only happen
  2905. if they do not conflict or if the conflict has been overridden.
  2906. @LP
  2907. @CNP
  2908. @Heading +3p @Font { 1.2vx @Break { {@PageMark s8.5.2}
  2909. 8.5.2.|0.5fe{ Replacing whole packages, forcing their removal}}}//0.2fe
  2910. @LP
  2911. Secondly, {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}} allows {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} and {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} to resolve
  2912. which package should be removed when a conflict "-" see
  2913. `Alternative packages "-" {{0.7 1.0} @Scale {Courier Bold} @Font {Conflicts}} and {{0.7 1.0} @Scale {Courier Bold} @Font {Replaces}}', page @PageOf{s-conflicts}. This usage only takes effect when the two
  2914. packages {{Times Slope} @Font {do}} conflict, so that the two effects do not interfere
  2915. with each other.
  2916. @LP
  2917. @CNP
  2918. {
  2919. newpath 0 ysize 0.3 ft sub moveto
  2920. xsize 0 rlineto
  2921. 0 0.1 ft rlineto
  2922. xsize neg 0 rlineto
  2923. closepath fill
  2924. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s8.6}
  2925. 8.6.|0.5fe{ Defaults for satisfying dependencies "-" ordering}}}} |0f }} //0.0fe
  2926. @LP
  2927. Ordering is significant in dependency fields.
  2928. @LP
  2929. Usually dselect will suggest to the user that they select the package
  2930. with the most `fundamental' class (eg, it will prefer Base packages to
  2931. Optional ones), or the one that they `most wanted' to select in some
  2932. sense.
  2933. @LP
  2934. In the absence of other information {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will offer a
  2935. default selection of the first named package in a list of
  2936. alternatives.
  2937. @LP
  2938. However, there is no way to specify the `order' of several packages
  2939. which all provide the same thing, when that thing is listed as a
  2940. dependency.
  2941. @LP
  2942. Therefore a dependency on a virtual package should contain a concrete
  2943. package name as the first alternative, so that this is the default.
  2944. @LP
  2945. For example, consider the set of packages:
  2946. //1.0vx
  2947. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2948. Package: glibcdoc
  2949. Recommends: "info"--"browser"
  2950. Package: info
  2951. Provides: "info"--"browser"
  2952. Package: emacs
  2953. Provides: "info"--"browser"}}} //0.2fe
  2954. @LP
  2955. If {{0.7 1.0} @Scale {Courier Bold} @Font {emacs}} and {{0.7 1.0} @Scale {Courier Bold} @Font {info}} both have the same priority then
  2956. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s choice is essentially random. Better would be
  2957. //1.0vx
  2958. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  2959. Package: glibcdoc
  2960. Recommends: info "|" "info"--"browser"}}} //0.2fe
  2961. so that {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} defaults to selecting the lightweight standalone
  2962. info browser.
  2963. @LP
  2964. @NP
  2965. {
  2966. newpath 0 ysize 0.3 ft sub moveto
  2967. xsize 0 rlineto
  2968. 0 0.2 ft rlineto
  2969. xsize neg 0 rlineto
  2970. closepath fill
  2971. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-conffiles}
  2972. 9.|0.5fe{ Configuration file handling}}}} |0f }} //0.0fe
  2973. @LP
  2974. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} can do a certain amount of automatic handling of package
  2975. configuration files.
  2976. @LP
  2977. Whether this mechanism is appropriate depends on a number of factors,
  2978. but basically there are two approaches to any particular configuration
  2979. file.
  2980. @LP
  2981. The easy method is to ship a "best-effort" configuration in the package,
  2982. and use {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s conffile mechanism to handle updates. If the user
  2983. is unlikely to want to edit the file, but you need them to be able to
  2984. without losing their changes, and a new package with a changed version
  2985. of the file is only released infrequently, this is a good approach.
  2986. @LP
  2987. The hard method is to build the configuration file from scratch in the
  2988. {{0.7 1.0} @Scale {Courier Bold} @Font {postinst}} script, and to take the responsibility for fixing any
  2989. mistakes made in earlier versions of the package automatically. This
  2990. will be appropriate if the file is likely to need to be different on
  2991. each system.
  2992. @LP
  2993. @CNP
  2994. {
  2995. newpath 0 ysize 0.3 ft sub moveto
  2996. xsize 0 rlineto
  2997. 0 0.1 ft rlineto
  2998. xsize neg 0 rlineto
  2999. closepath fill
  3000. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s9.1}
  3001. 9.1.|0.5fe{ Automatic handling of configuration files by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}}}}} |0f }} //0.0fe
  3002. @LP
  3003. A package may contain a control area file called {{0.7 1.0} @Scale {Courier Bold} @Font {conffiles}}. This
  3004. file should be a list of filenames of configuration files needing
  3005. automatic handling, separated by newlines. The filenames should be
  3006. absolute pathnames, and the files referred to should actually exist in
  3007. the package.
  3008. @LP
  3009. When a package is upgraded {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will process the configuration
  3010. files during the configuration stage, shortly before it runs the
  3011. package's {{0.7 1.0} @Scale {Courier Bold} @Font {postinst}} script,
  3012. @LP
  3013. For each file it checks to see whether the version of the file
  3014. included in the package is the same as the one that was included in
  3015. the last version of the package (the one that is being upgraded
  3016. from); it also compares the version currently installed on the system
  3017. with the one shipped with the last version.
  3018. @LP
  3019. If neither the user nor the package maintainer has changed the file,
  3020. it is left alone. If one or the other has changed their version, then
  3021. the changed version is preferred "-" ie, if the user edits their file,
  3022. but the package maintainer doesn't ship a different version, the
  3023. user's changes will stay, silently, but if the maintainer ships a new
  3024. version and the user hasn't edited it the new version will be
  3025. installed (with an informative message). If both have changed their
  3026. version the user is prompted about the problem and must resolve the
  3027. differences themselves.
  3028. @LP
  3029. The comparisons are done by calculating the MD5 message digests of the
  3030. files, and storing the MD5 of the file as it was included in the most
  3031. recent version of the package.
  3032. @LP
  3033. When a package is installed for the first time {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will install
  3034. the file that comes with it, unless that would mean overwriting a file
  3035. already on the filesystem.
  3036. @LP
  3037. However, note that {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will {{Times Slope} @Font {not}} replace a conffile that
  3038. was removed by the user (or by a script). This is necessary because
  3039. with some programs a missing file produces an effect hard or
  3040. impossible to achieve in another way, so that a missing file needs to
  3041. be kept that way if the user did it.
  3042. @LP
  3043. Note that a package should {{Times Slope} @Font {not}} modify a {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}"-handled"
  3044. conffile in its maintainer scripts. Doing this will lead to
  3045. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} giving the user confusing and possibly dangerous options
  3046. for conffile update when the package is upgraded.
  3047. @LP
  3048. @CNP
  3049. {
  3050. newpath 0 ysize 0.3 ft sub moveto
  3051. xsize 0 rlineto
  3052. 0 0.1 ft rlineto
  3053. xsize neg 0 rlineto
  3054. closepath fill
  3055. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s9.2}
  3056. 9.2.|0.5fe{ "Fully-featured" maintainer script configuration handling}}}} |0f }} //0.0fe
  3057. @LP
  3058. For files which contain "site-specific" information such as the hostname
  3059. and networking details and so forth, it is better to create the file
  3060. in the package's {{0.7 1.0} @Scale {Courier Bold} @Font {postinst}} script.
  3061. @LP
  3062. This will typically involve examining the state of the rest of the
  3063. system to determine values and other information, and may involve
  3064. prompting the user for some information which can't be obtained some
  3065. other way.
  3066. @LP
  3067. When using this method there are a couple of important issues which
  3068. should be considered:
  3069. @LP
  3070. If you discover a bug in the program which generates the configuration
  3071. file, or if the format of the file changes from one version to the
  3072. next, you will have to arrange for the postinst script to do something
  3073. sensible "-" usually this will mean editing the installed configuration
  3074. file to remove the problem or change the syntax. You will have to do
  3075. this very carefully, since the user may have changed the file, perhaps
  3076. to fix the very problem that your script is trying to deal with "-" you
  3077. will have to detect these situations and deal with them correctly.
  3078. @LP
  3079. If you do go down this route it's probably a good idea to make the
  3080. program that generates the configuration file(s) a separate program in
  3081. {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/sbin"}}, by convention called {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}config}} and
  3082. then run that if appropriate from the "post-installation" script. The
  3083. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}config}} program should not unquestioningly overwrite
  3084. an existing configuration "-" if its mode of operation is geared towards
  3085. setting up a package for the first time (rather than any arbitrary
  3086. reconfiguration later) you should have it check whether the
  3087. configuration already exists, and require a {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"force"}} flag to
  3088. overwrite it.
  3089. @LP
  3090. @NP
  3091. {
  3092. newpath 0 ysize 0.3 ft sub moveto
  3093. xsize 0 rlineto
  3094. 0 0.2 ft rlineto
  3095. xsize neg 0 rlineto
  3096. closepath fill
  3097. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-alternatives}
  3098. 10.|0.5fe{ Alternative versions of an interface "-"
  3099. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives"}}}}}} |0f }} //0.0fe
  3100. @LP
  3101. When several packages all provide different versions of the same
  3102. program or file it is useful to have the system select a default, but
  3103. to allow the system administrator to change it and have their
  3104. decisions respected.
  3105. @LP
  3106. For example, there are several versions of the {{0.7 1.0} @Scale {Courier Bold} @Font {vi}} editor, and
  3107. there is no reason to prevent all of them from being installed at
  3108. once, each under their own name ({{0.7 1.0} @Scale {Courier Bold} @Font {nvi}}, {{0.7 1.0} @Scale {Courier Bold} @Font {vim}} or whatever).
  3109. Nevertheless it is desirable to have the name {{0.7 1.0} @Scale {Courier Bold} @Font {vi}} refer to
  3110. something, at least by default.
  3111. @LP
  3112. If all the packages involved cooperate, this can be done with
  3113. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives"}}.
  3114. @LP
  3115. Each package provides its own version under its own name, and calls
  3116. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives"}} in its postinst to register its version
  3117. (and again in its prerm to deregister it).
  3118. @LP
  3119. See the manpage {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives(8)"}} for
  3120. details.
  3121. @LP
  3122. If {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives"}} does not seem appropriate you may wish
  3123. to consider using diversions instead.
  3124. @LP
  3125. @NP
  3126. {
  3127. newpath 0 ysize 0.3 ft sub moveto
  3128. xsize 0 rlineto
  3129. 0 0.2 ft rlineto
  3130. xsize neg 0 rlineto
  3131. closepath fill
  3132. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-diversions}
  3133. 11.|0.5fe{ Diversions "-" overriding a package's version of a file}}}} |0f }} //0.0fe
  3134. @LP
  3135. It is possible to have {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} not overwrite a file when it
  3136. reinstalls the package it belongs to, and to have it put the file from
  3137. the package somewhere else instead.
  3138. @LP
  3139. This can be used locally to override a package's version of a file, or
  3140. by one package to override another's version (or provide a wrapper for
  3141. it).
  3142. @LP
  3143. Before deciding to use a diversion, read `Alternative versions of an interface "-"
  3144. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"alternatives"}}', page @PageOf{ch-alternatives} to
  3145. see if you really want a diversion rather than several alternative
  3146. versions of a program.
  3147. @LP
  3148. There is a diversion list, which is read by {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}, and updated
  3149. by a special program {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"divert"}}. Please see {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"divert(8)"}} for full details of its operation.
  3150. @LP
  3151. When a package wishes to divert a file from another, it should call
  3152. {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"divert"}} in its preinst to add the diversion and rename the
  3153. existing file. For example, supposing that a {{0.7 1.0} @Scale {Courier Bold} @Font {smailwrapper}}
  3154. package wishes to install a wrapper around {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/sbin/smail"}}:
  3155. //1.0vx
  3156. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3157. if [ install = "\"$1\"" ]; then
  3158. "dpkg"--"divert" ""--""--"package" smailwrapper ""--""--"add" ""--""--"rename" "\\"
  3159. ""--""--"divert" "/usr/sbin/smail.real" "/usr/sbin/smail"
  3160. fi}}} //0.2fe
  3161. Testing {{0.7 1.0} @Scale {Courier Bold} @Font {$1}} is necessary so that the script doesn't try to add the
  3162. diversion again when {{0.7 1.0} @Scale {Courier Bold} @Font {smailwrapper}} is upgraded. The
  3163. {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"package" smailwrapper}} ensures that {{0.7 1.0} @Scale {Courier Bold} @Font {smailwrapper}}'s copy of
  3164. {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/sbin/smail"}} can bypass the diversion and get installed as
  3165. the true version.
  3166. @LP
  3167. The postrm has to do the reverse:
  3168. //1.0vx
  3169. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3170. if [ remove = "\"$1\"" ]; then
  3171. "dpkg"--"divert" ""--""--"package" smailwrapper ""--""--"remove" ""--""--"rename" "\\"
  3172. ""--""--"divert" "/usr/sbin/smail.real" "/usr/sbin/smail"
  3173. fi}}} //0.2fe
  3174. @LP
  3175. Do not attempt to divert a file which is vitally important for the
  3176. system's operation "-" when using {{0.7 1.0} @Scale {Courier Bold} @Font {"dpkg"--"divert"}} there is a time,
  3177. after it has been diverted but before {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} has installed the
  3178. new version, when the file does not exist.
  3179. @LP
  3180. @NP
  3181. {
  3182. newpath 0 ysize 0.3 ft sub moveto
  3183. xsize 0 rlineto
  3184. 0 0.2 ft rlineto
  3185. xsize neg 0 rlineto
  3186. closepath fill
  3187. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-sharedlibs}
  3188. 12.|0.5fe{ Shared libraries}}}} |0f }} //0.0fe
  3189. @LP
  3190. Packages containing shared libraries must be constructed with a little
  3191. care to make sure that the shared library is always available. This
  3192. is especially important for packages whose shared libraries are
  3193. vitally important, such as the libc.
  3194. @LP
  3195. Firstly, your package should install the shared libraries under their
  3196. normal names. For example, the {{0.7 1.0} @Scale {Courier Bold} @Font {libgdbm1}} package should install
  3197. {{0.7 1.0} @Scale {Courier Bold} @Font {libgdbm.so.1.7.3}} as {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/lib/libgdbm.so.1.7.3"}}. The
  3198. files should not be renamed or relinked by any prerm or postrm
  3199. scripts; {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} will take care of renaming things safely without
  3200. affecting running programs, and attempts to interfere with this are
  3201. likely to lead to problems.
  3202. @LP
  3203. Secondly, your package should include the symlink that {{0.7 1.0} @Scale {Courier Bold} @Font {ldconfig}}
  3204. would create for the shared libraries. For example, the {{0.7 1.0} @Scale {Courier Bold} @Font {libgdbm1}}
  3205. package should include a symlink from {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/lib/libgdbm.so.1"}}
  3206. to {{0.7 1.0} @Scale {Courier Bold} @Font {libgdbm.so.1.7.3}}. This is needed so that {{0.7 1.0} @Scale {Courier Bold} @Font {ld.so}} can find
  3207. the library in between the time {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} installs it and
  3208. {{0.7 1.0} @Scale {Courier Bold} @Font {ldconfig}} is run in the {{0.7 1.0} @Scale {Courier Bold} @Font {postinst}} script. Futhermore, and {{Times Slope} @Font {this
  3209. is very important}}, the symlink must be placed before the library it
  3210. points to in the {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} file. Currently the way to ensure the
  3211. ordering is done properly is to create the symlink in the appropriate
  3212. {{0.7 1.0} @Scale {Courier Bold} @Font {"debian/tmp/.../lib"}} directory before installing the library
  3213. when you build the package.
  3214. @LP
  3215. If you do the above your package does not need to call {{0.7 1.0} @Scale {Courier Bold} @Font {ldconfig}}
  3216. in its maintainer scripts. It is especially important not to call
  3217. {{0.7 1.0} @Scale {Courier Bold} @Font {ldconfig}} in the postrm or preinst scripts in the case where the
  3218. package is being upgraded (see the programmer's manual), as
  3219. {{0.7 1.0} @Scale {Courier Bold} @Font {ldconfig}} will see the temporary names that {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} uses for the
  3220. files while it is installing them and will make the shared library
  3221. links point to them, just before {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} continues the installation
  3222. and removes the links!
  3223. @LP
  3224. @NP
  3225. {
  3226. newpath 0 ysize 0.3 ft sub moveto
  3227. xsize 0 rlineto
  3228. 0 0.2 ft rlineto
  3229. xsize neg 0 rlineto
  3230. closepath fill
  3231. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-sysvinit}
  3232. 13.|0.5fe{ Configuration of {{0.7 1.0} @Scale {Courier Bold} @Font {init}}}}}} |0f }} //0.0fe
  3233. @LP
  3234. @CNP
  3235. {
  3236. newpath 0 ysize 0.3 ft sub moveto
  3237. xsize 0 rlineto
  3238. 0 0.1 ft rlineto
  3239. xsize neg 0 rlineto
  3240. closepath fill
  3241. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s13.1}
  3242. 13.1.|0.5fe{ Introduction to the {{0.7 1.0} @Scale {Courier Bold} @Font {init.d}} scheme}}}} |0f }} //0.0fe
  3243. @LP
  3244. The {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}} directory contains the scripts executed by
  3245. {{0.7 1.0} @Scale {Courier Bold} @Font {init}} when init state (or `runlevel') is changed (see {{0.7 1.0} @Scale {Courier Bold} @Font {init(8)}}).
  3246. @LP
  3247. These scripts are be referenced by symbolic links in the
  3248. {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} directories. When changing runlevels, init
  3249. looks in the directory {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} for the scripts it
  3250. should execute, where {{Times Slope} @Font {n}} is the runlevel that is being changed
  3251. to.
  3252. @LP
  3253. The names of the links all have the form {{0.7 1.0} @Scale {Courier Bold} @Font {S{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {mm}}}}{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {script}}}}}} or
  3254. {{0.7 1.0} @Scale {Courier Bold} @Font {K{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {mm}}}}{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {script}}}}}} where {{Times Slope} @Font {mm}} is a "two-digit" number and
  3255. {{Times Slope} @Font {script}} is the name of the script (this should be the same as the
  3256. name of the actual script in {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}}.
  3257. When {{0.7 1.0} @Scale {Courier Bold} @Font {init}} changes runlevel first the targets of the links whose
  3258. names starting with a {{0.7 1.0} @Scale {Courier Bold} @Font {K}} are executed, each with the single
  3259. argument {{0.7 1.0} @Scale {Courier Bold} @Font {stop}}, followed by the scripts prefixed with an {{0.7 1.0} @Scale {Courier Bold} @Font {S}},
  3260. each with the single argument {{0.7 1.0} @Scale {Courier Bold} @Font {start}}. The {{0.7 1.0} @Scale {Courier Bold} @Font {K}} links are
  3261. responsible for killing services and the {{0.7 1.0} @Scale {Courier Bold} @Font {S}} link for starting
  3262. services upon entering the runlevel.
  3263. @LP
  3264. For example, if we are changing from runlevel 2 to runlevel 3, init
  3265. will first execute all of the {{0.7 1.0} @Scale {Courier Bold} @Font {K}} prefixed scripts it finds in
  3266. {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc3.d"}}, and then all of the {{0.7 1.0} @Scale {Courier Bold} @Font {S}} prefixed scripts. The
  3267. links starting with {{0.7 1.0} @Scale {Courier Bold} @Font {K}} will cause the "referred-to" file to be
  3268. executed with an argument of {{0.7 1.0} @Scale {Courier Bold} @Font {stop}}, and the {{0.7 1.0} @Scale {Courier Bold} @Font {S}} links with an
  3269. argument of {{0.7 1.0} @Scale {Courier Bold} @Font {start}}.
  3270. @LP
  3271. The "two-digit" number {{Times Slope} @Font {mm}} is used to decide which order to start
  3272. and stop things in "-" "low-numbered" links have their scripts run first.
  3273. For example, the {{0.7 1.0} @Scale {Courier Bold} @Font {K20}} scripts will be executed before the {{0.7 1.0} @Scale {Courier Bold} @Font {K30}}
  3274. scripts. This is used when a certain service must be started before
  3275. another. For example, the name server {{0.7 1.0} @Scale {Courier Bold} @Font {bind}} might need to be
  3276. started before the news server {{0.7 1.0} @Scale {Courier Bold} @Font {inn}} so that {{0.7 1.0} @Scale {Courier Bold} @Font {inn}} can set
  3277. up its access lists. In this case, the script that starts {{0.7 1.0} @Scale {Courier Bold} @Font {bind}}
  3278. should have a lower number than the script that starts {{0.7 1.0} @Scale {Courier Bold} @Font {inn}} so
  3279. that it runs first:
  3280. //1.0vx
  3281. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3282. "/etc/rc2.d/S17bind"
  3283. "/etc/rc2.d/S70inn"}}} //0.2fe
  3284. @LP
  3285. @CNP
  3286. {
  3287. newpath 0 ysize 0.3 ft sub moveto
  3288. xsize 0 rlineto
  3289. 0 0.1 ft rlineto
  3290. xsize neg 0 rlineto
  3291. closepath fill
  3292. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s13.2}
  3293. 13.2.|0.5fe{ Writing {{0.7 1.0} @Scale {Courier Bold} @Font {init.d}} scripts}}}} |0f }} //0.0fe
  3294. @LP
  3295. Packages can and should place scripts in {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}} to start
  3296. or stop services at boot time or during a change of runlevel. These
  3297. scripts should be named {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d/"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}}}}, and they
  3298. should accept one argument, saying what to do: {{0.7 1.0} @Scale {Courier Bold} @Font {start}}, meaning to
  3299. starts the service, or {{0.7 1.0} @Scale {Courier Bold} @Font {stop}}, to stop the service. Optionally
  3300. they can support {{0.7 1.0} @Scale {Courier Bold} @Font {reload}} which causes the configuration to be
  3301. reloaded.
  3302. @LP
  3303. The {{0.7 1.0} @Scale {Courier Bold} @Font {init.d}} scripts should ensure that they will behave sensibly
  3304. if invoked with {{0.7 1.0} @Scale {Courier Bold} @Font {start}} when the service is already running, or
  3305. with {{0.7 1.0} @Scale {Courier Bold} @Font {stop}} when it isn't, and that they don't kill
  3306. "unfortunately-named" user processes. The best way to achieve this is
  3307. usually to use {{0.7 1.0} @Scale {Courier Bold} @Font {"start"--"stop"--"daemon"}}.
  3308. @LP
  3309. These scripts should not fail obscurely when the configuration files
  3310. remain but the package has been removed, as the default in {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}
  3311. is to leave configuration files on the system after the package has
  3312. been removed. Only when it is executed with the {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"purge"}} option
  3313. will dpkg remove configuration files. Therefore, you should include a
  3314. {{0.7 1.0} @Scale {Courier Bold} @Font {test}} statement at the top of the script, like this:
  3315. //1.0vx
  3316. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3317. test ""--"f" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {"program"--"executed"--"later"--"in"--"script"}}}} "||" exit 0}}} //0.2fe
  3318. @LP
  3319. @CNP
  3320. {
  3321. newpath 0 ysize 0.3 ft sub moveto
  3322. xsize 0 rlineto
  3323. 0 0.1 ft rlineto
  3324. xsize neg 0 rlineto
  3325. closepath fill
  3326. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s13.3}
  3327. 13.3.|0.5fe{ Managing the {{0.7 1.0} @Scale {Courier Bold} @Font {rc{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} links "-" {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}}}}}} |0f }} //0.0fe
  3328. @LP
  3329. A program is provided, {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}}, to make it easier for
  3330. package maintainers to arrange for the proper creation and removal of
  3331. {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} symbolic links from their postinst and postrm
  3332. scripts.
  3333. @LP
  3334. You should use this script to make changes to {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}}
  3335. and {{Times Slope} @Font {never}} include any {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} symbolic links in
  3336. the actual archive.
  3337. @LP
  3338. By default {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}} will start services in each of the
  3339. "multi-user" state runlevels (2, 3, 4, and 5) and stop them in the halt
  3340. runlevel (0), the "single-user" runlevel (1) and the reboot runlevel
  3341. (6). The system administrator will have the opportunity to customize
  3342. runlevels by simply adding, moving, or removing the symbolic links in
  3343. {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}}.
  3344. @LP
  3345. To get the default behaviour for your package, put in your postinst
  3346. script
  3347. //1.0vx
  3348. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3349. "update"--"rc.d" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}} default >"/dev/null"}}} //0.2fe
  3350. and in your postrm
  3351. //1.0vx
  3352. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3353. if [ purge = "\"$1\"" ]; then
  3354. "update"--"rc.d" {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {package}}}} remove >"/dev/null"
  3355. fi}}} //0.2fe
  3356. @LP
  3357. This will use a default sequence number of 20. If it does not matter
  3358. when or in which order the script is run, use this default. If it
  3359. does, then you should talk to the maintainer of the {{0.7 1.0} @Scale {Courier Bold} @Font {sysvinit}}
  3360. package or post to {{0.7 1.0} @Scale {Courier Bold} @Font {"debian"--"devel"}}, and they will help you choose
  3361. a number.
  3362. @LP
  3363. For more information about using {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}}, please consult its
  3364. manpage {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d(8)"}}.
  3365. @LP
  3366. @CNP
  3367. {
  3368. newpath 0 ysize 0.3 ft sub moveto
  3369. xsize 0 rlineto
  3370. 0 0.1 ft rlineto
  3371. xsize neg 0 rlineto
  3372. closepath fill
  3373. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s13.4}
  3374. 13.4.|0.5fe{ "Boot-time" initialisation "-" {{0.7 1.0} @Scale {Courier Bold} @Font {rc.boot}}}}}} |0f }} //0.0fe
  3375. @LP
  3376. There is another directory, {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc.boot"}}, which contains
  3377. scripts which are run once per machine boot. This facility is
  3378. provided for initialisation of hardware devices, cleaning up of
  3379. leftover files, and so forth.
  3380. @LP
  3381. For example, the {{0.7 1.0} @Scale {Courier Bold} @Font {kbd}} package provides a script here for
  3382. initialising the keyboard layout and console font and mode.
  3383. @LP
  3384. The files in {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc.boot"}} should {{Times Slope} @Font {not}} be links into
  3385. {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}} "-" they should be the scripts themselves.
  3386. @LP
  3387. {{0.7 1.0} @Scale {Courier Bold} @Font {rc.boot}} should {{Times Slope} @Font {not}} be used for starting "general-purpose"
  3388. daemons and similar activities. This should be done using the
  3389. {{0.7 1.0} @Scale {Courier Bold} @Font {rc{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}.d}} scheme, above, so that the services can be started
  3390. and stopped cleanly when the runlevel changes or the machine is to be
  3391. shut down or rebooted.
  3392. @LP
  3393. @CNP
  3394. {
  3395. newpath 0 ysize 0.3 ft sub moveto
  3396. xsize 0 rlineto
  3397. 0 0.1 ft rlineto
  3398. xsize neg 0 rlineto
  3399. closepath fill
  3400. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s13.5}
  3401. 13.5.|0.5fe{ Notes}}}} |0f }} //0.0fe
  3402. @LP
  3403. {{Times Slope} @Font {Do not}} include the {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}".d/*"}} symbolic links in
  3404. the {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} filesystem archive! {{Times Slope} @Font {This will cause problems!}}
  3405. You should create them with {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}}, as above.
  3406. @LP
  3407. {{Times Slope} @Font {Do not}} include the {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/rc"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {n}}}}".d/*"}} symbolic links in
  3408. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}}'s conffiles list! {{Times Slope} @Font {This will cause problems!}}
  3409. {{Times Slope} @Font {Do}}, however, include the {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}} scripts in conffiles.
  3410. @LP
  3411. @CNP
  3412. {
  3413. newpath 0 ysize 0.3 ft sub moveto
  3414. xsize 0 rlineto
  3415. 0 0.1 ft rlineto
  3416. xsize neg 0 rlineto
  3417. closepath fill
  3418. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s13.6}
  3419. 13.6.|0.5fe{ Example}}}} |0f }} //0.0fe
  3420. @LP
  3421. The {{0.7 1.0} @Scale {Courier Bold} @Font {bind}} DNS (nameserver) package wants to make sure that the
  3422. nameserver is running in multiuser runlevels, and is properly shut
  3423. down with the system. It puts a script in {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}}, naming
  3424. the script appropriately {{0.7 1.0} @Scale {Courier Bold} @Font {bind}}. As you can see, the script
  3425. interprets the argument {{0.7 1.0} @Scale {Courier Bold} @Font {reload}} to send the nameserver a {{0.7 1.0} @Scale {Courier Bold} @Font {HUP}}
  3426. signal (causing it to reload its configuration); this way the user can
  3427. say {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d/bind" reload}} to reload the nameserver.
  3428. @LP
  3429. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3430. "#!/bin/sh"
  3431. "#" Original version by Robert Leslie <"rob@mars.org">, edited by iwj
  3432. test ""--"x" "/usr/sbin/named" "||" exit 0
  3433. case "\"$1\"" in
  3434. start)
  3435. test ""--"f" "/etc/named.boot" ""--"a" ""--"f" "/var/named/boot.options" "||" exit 0
  3436. "start"--"stop"--"daemon" ""--""--"start" ""--""--"verbose" ""--""--"exec" "/usr/sbin/named"
  3437. ;;
  3438. stop)
  3439. "start"--"stop"--"daemon" ""--""--"stop" ""--""--"verbose" "\\"
  3440. ""--""--"pidfile" "/var/run/named.pid" ""--""--"exec" "/usr/sbin/named"
  3441. ;;
  3442. reload)
  3443. "start"--"stop"--"daemon" ""--""--"stop" ""--""--"signal" 1 ""--""--"verbose" "\\"
  3444. ""--""--"pidfile" "/var/run/named.pid" ""--""--"exec" "/usr/sbin/named"
  3445. ;;
  3446. *)
  3447. echo "\"Usage:" "/etc/init.d/bind" "{start|stop|reload}\"" ">&2"
  3448. exit 1
  3449. ;;
  3450. esac
  3451. exit 0}}} //0.2fe
  3452. @LP
  3453. Another example on which to base your {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d"}} scripts is in
  3454. {{0.7 1.0} @Scale {Courier Bold} @Font {"/etc/init.d/skeleton"}}.
  3455. @LP
  3456. If this package is happy with the default setup from
  3457. {{0.7 1.0} @Scale {Courier Bold} @Font {"update"--"rc.d"}}, namely an ordering number of 20 and having named
  3458. running in all runlevels, it can say in its postinst:
  3459. //1.0vx
  3460. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3461. "update"--"rc.d" bind default ">/dev/null"}}} //0.2fe
  3462. And in its postrm, to remove the links when the package is purged:
  3463. //1.0vx
  3464. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3465. if [ purge = "\"$1\"" ]; then
  3466. "update"--"rc.d" acct remove ">/dev/null"
  3467. fi}}} //0.2fe
  3468. @LP
  3469. @NP
  3470. {
  3471. newpath 0 ysize 0.3 ft sub moveto
  3472. xsize 0 rlineto
  3473. 0 0.2 ft rlineto
  3474. xsize neg 0 rlineto
  3475. closepath fill
  3476. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +5p @Font { 1.2vx @Break { {@PageMark ch-methif}
  3477. 14.|0.5fe{ {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s interface to its installation methods}}}} |0f }} //0.0fe
  3478. @LP
  3479. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} calls scripts from its installation methods when it
  3480. needs to actually access data from the distribution. The core program
  3481. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} itself just calls these scripts and provides the
  3482. package and access method selection interfaces. The installation
  3483. methods are responsible for invoking {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} as appropriate.
  3484. @LP
  3485. Each installation method has three scripts:
  3486. //1.0vx
  3487. {@RawBulletList
  3488. gap { 1.0vx }
  3489. @ListItem {
  3490. Setup installation parameters.
  3491. }
  3492. @ListItem {
  3493. Update list of available packages.
  3494. }
  3495. @ListItem {
  3496. Install.
  3497. }
  3498. @RawEndList}//0ve
  3499. @LP
  3500. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} searches for methods in {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/lib/dpkg/methods"}}
  3501. and {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/local/lib/dpkg/methods"}}.
  3502. @LP
  3503. @CNP
  3504. {
  3505. newpath 0 ysize 0.3 ft sub moveto
  3506. xsize 0 rlineto
  3507. 0 0.1 ft rlineto
  3508. xsize neg 0 rlineto
  3509. closepath fill
  3510. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s14.1}
  3511. 14.1.|0.5fe{ Functions of the method scripts}}}} |0f }} //0.0fe
  3512. @LP
  3513. The setup script is run just after the user has chosen an installation
  3514. method. It should prompt the user for parameters like the site to
  3515. "NFS-mount" or FTP from, the directory to use, or the directory or
  3516. filesystem where the {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} files can be found, or the tape or
  3517. floppy device to install from. It should store the responses under
  3518. {{0.7 1.0} @Scale {Courier Bold} @Font {"/var/lib/dpkg/methods"}} "-" see below. If no available
  3519. packages list is available it should perhaps offer to scan the
  3520. available packages.
  3521. @LP
  3522. The update script should obtain a list of available packages if
  3523. possible, and run {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"update"--"avail"}}, {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"merge"--"avail"}}
  3524. "and/or" {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"forget"--"old"--"unavail"}} to load it into {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} and
  3525. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s database of available packages. If no packages list
  3526. was available and the user was offered and accepted the option of
  3527. scanning the actual files available this scan should be done here,
  3528. using {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"record"--"avail"}}.
  3529. @LP
  3530. The install script should feed all the available {{0.7 1.0} @Scale {Courier Bold} @Font {.deb}} files to
  3531. {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"iGOEB"}} (this is equivalent to {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg ""--""--"install"
  3532. ""--""--"refuse"--"downgrade" ""--""--"selected"--"only" ""--""--"skip"--"same"--"version"
  3533. ""--""--"auto"--"deconfigure"}}). The {{0.7 1.0} @Scale {Courier Bold} @Font {""--"R"}} ({{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"recursive"}}) option for
  3534. traversing subdirectories may also be useful here).
  3535. @LP
  3536. If any of these scripts needs to display a message for the user, it
  3537. should wait for the user to hit `return' before exiting so that
  3538. dselect doesn't immediately rewrite the screen.
  3539. @LP
  3540. If a method script succeeds (returns a zero exit status)
  3541. {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will return immediately to the main menu, with the
  3542. `next' option highlighted ready for the user to select it. If it
  3543. fails {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} will display a message and wait for the user to
  3544. hit return.
  3545. @LP
  3546. @CNP
  3547. {
  3548. newpath 0 ysize 0.3 ft sub moveto
  3549. xsize 0 rlineto
  3550. 0 0.1 ft rlineto
  3551. xsize neg 0 rlineto
  3552. closepath fill
  3553. } @Graphic { //1.6f @HAdjust { @HContract {@Heading +4p @Font { 1.2vx @Break { {@PageMark s14.2}
  3554. 14.2.|0.5fe{ Location and arguments of the method scripts}}}} |0f }} //0.0fe
  3555. @LP
  3556. A set of scripts (henceforth known as a group) may provide several
  3557. methods on the `main menu' with different behaviour. For example,
  3558. there might be a generic "get-packages-by-FTP" group which might provide
  3559. methods in the main menu for installation directly from one of the
  3560. Debian mirror sites as well as for installation from a "user-specified"
  3561. site.
  3562. @LP
  3563. Each group of methods implemented by the same set of scripts should
  3564. have a subdirectory {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/lib/dpkg/methods/"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {group}}}}}} or
  3565. {{0.7 1.0} @Scale {Courier Bold} @Font {"/usr/local/lib/dpkg/methods/"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {group}}}}}}, containing:
  3566. //1.0vx
  3567. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {names}}}}
  3568. //1.0vx
  3569. {|2f {
  3570. a list of "user-visible" methods provided by these scripts.
  3571. }}
  3572. //1.0vx
  3573. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {setup}}}}
  3574. //1.0vx
  3575. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {update}}}}
  3576. //1.0vx
  3577. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {install}}}}
  3578. //1.0vx
  3579. {|2f {
  3580. executable programs, the scripts themselves.
  3581. }}
  3582. //1.0vx
  3583. {|0.5f {{{0.7 1.0} @Scale {Courier Bold} @Font {desc.{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {option}}}}}}}}
  3584. //1.0vx
  3585. {|2f {
  3586. description file.
  3587. }}
  3588. //0.2fe
  3589. @LP
  3590. {{0.7 1.0} @Scale {Courier Bold} @Font {names}} will be formatted as a list of lines, each containing:
  3591. //1.0vx
  3592. {@RawIndentedDisplay lines @Break { {0.7 1.0} @Scale {Courier Bold} @Font {
  3593. {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {sequence}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {method}}}} {{1.4285714285 1.0} @Scale {{{Times Slope} @Font {summary}}}}}}} //0.2fe
  3594. @LP
  3595. {{Times Slope} @Font {sequence}} is a "two-digit" number that will be used much like
  3596. {{0.7 1.0} @Scale {Courier Bold} @Font {rc.d}} prefixes to control the order in the main menu. If in doubt
  3597. use 50.
  3598. @LP
  3599. {{Times Slope} @Font {method}} is a name which is displayed by {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} as the
  3600. name of the method, and which will be passed to {{0.7 1.0} @Scale {Courier Bold} @Font {setup}},
  3601. {{0.7 1.0} @Scale {Courier Bold} @Font {update}} and {{0.7 1.0} @Scale {Courier Bold} @Font {unpack}} as their first argument.
  3602. @LP
  3603. {{Times Slope} @Font {summary}} is the brief description string for {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s menu.
  3604. @LP
  3605. Each of the three scripts gets the same three arguments: {{Times Slope} @Font {vardir}},
  3606. {{Times Slope} @Font {group}} and {{Times Slope} @Font {method}}. {{Times Slope} @Font {vardir}} is the base directory for
  3607. storing {{0.7 1.0} @Scale {Courier Bold} @Font {dpkg}} and {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}}'s state, usually
  3608. {{0.7 1.0} @Scale {Courier Bold} @Font {"/var/lib/dpkg"}}; this is passed in so that the {{0.7 1.0} @Scale {Courier Bold} @Font {""--""--"admindir"}}
  3609. option to {{0.7 1.0} @Scale {Courier Bold} @Font {dselect}} is honoured).
  3610. @LP
  3611. Each option may have an extended description in
  3612. {{0.7 1.0} @Scale {Courier Bold} @Font {desc.{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {option}}}}}}. This should be formatted like the extended
  3613. description part of a {{0.7 1.0} @Scale {Courier Bold} @Font {Description}} field entry {{Times Slope} @Font {shifted one
  3614. character to the left}}.
  3615. @LP
  3616. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {vardir}}}}"/methods"}} will exist, and a method group may use a
  3617. {{0.7 1.0} @Scale {Courier Bold} @Font {{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {vardir}}}}"/methods/"{{1.4285714285 1.0} @Scale {{{Times Slope} @Font {group}}}}}} directory to store its state.
  3618. @LP
  3619. The group name and method name must follow the rules for C identifiers.
  3620. @End @Text