/usr/share/doc/ubuntu-policy/policy.html/ap-pkg-sourcepkg.html is in ubuntu-policy 3.8.2.0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Ubuntu Policy Manual - Source packages (from old Packaging Manual)</title>
<link href="index.html" rel="start">
<link href="ap-pkg-binarypkg.html" rel="prev">
<link href="ap-pkg-controlfields.html" rel="next">
<link href="index.html#contents" rel="contents">
<link href="index.html#copyright" rel="copyright">
<link href="ch-scope.html" rel="chapter" title="1 About this manual">
<link href="ch-archive.html" rel="chapter" title="2 The Ubuntu Archive">
<link href="ch-binary.html" rel="chapter" title="3 Binary packages">
<link href="ch-source.html" rel="chapter" title="4 Source packages">
<link href="ch-controlfields.html" rel="chapter" title="5 Control files and their fields">
<link href="ch-maintainerscripts.html" rel="chapter" title="6 Package maintainer scripts and installation procedure">
<link href="ch-relationships.html" rel="chapter" title="7 Declaring relationships between packages">
<link href="ch-sharedlibs.html" rel="chapter" title="8 Shared libraries">
<link href="ch-opersys.html" rel="chapter" title="9 The Operating System">
<link href="ch-files.html" rel="chapter" title="10 Files">
<link href="ch-customized-programs.html" rel="chapter" title="11 Customized programs">
<link href="ch-docs.html" rel="chapter" title="12 Documentation">
<link href="ap-pkg-scope.html" rel="appendix" title="A Introduction and scope of these appendices">
<link href="ap-pkg-binarypkg.html" rel="appendix" title="B Binary packages (from old Packaging Manual)">
<link href="ap-pkg-sourcepkg.html" rel="appendix" title="C Source packages (from old Packaging Manual)">
<link href="ap-pkg-controlfields.html" rel="appendix" title="D Control files and their fields (from old Packaging Manual)">
<link href="ap-pkg-conffiles.html" rel="appendix" title="E Configuration file handling (from old Packaging Manual)">
<link href="ap-pkg-alternatives.html" rel="appendix" title="F Alternative versions of an interface - <code>update-alternatives</code> (from old Packaging Manual)">
<link href="ap-pkg-diversions.html" rel="appendix" title="G Diversions - overriding a package's version of a file (from old Packaging Manual)">
<link href="ch-scope.html#s1.1" rel="section" title="1.1 Scope">
<link href="ch-scope.html#s1.2" rel="section" title="1.2 New versions of this document">
<link href="ch-scope.html#s-authors" rel="section" title="1.3 Authors and Maintainers">
<link href="ch-scope.html#s-related" rel="section" title="1.4 Related documents">
<link href="ch-scope.html#s-definitions" rel="section" title="1.5 Definitions">
<link href="ch-archive.html#s-ulp" rel="section" title="2.1 The Ubuntu Licensing Policy">
<link href="ch-archive.html#s-sections" rel="section" title="2.2 Archive areas">
<link href="ch-archive.html#s-pkgcopyright" rel="section" title="2.3 Copyright considerations">
<link href="ch-archive.html#s-subsections" rel="section" title="2.4 Sections">
<link href="ch-archive.html#s-priorities" rel="section" title="2.5 Priorities">
<link href="ch-binary.html#s3.1" rel="section" title="3.1 The package name">
<link href="ch-binary.html#s-versions" rel="section" title="3.2 The version of a package">
<link href="ch-binary.html#s3.3" rel="section" title="3.3 The maintainer of a package">
<link href="ch-binary.html#s-descriptions" rel="section" title="3.4 The description of a package">
<link href="ch-binary.html#s3.5" rel="section" title="3.5 Dependencies">
<link href="ch-binary.html#s-virtual_pkg" rel="section" title="3.6 Virtual packages">
<link href="ch-binary.html#s3.7" rel="section" title="3.7 Base system">
<link href="ch-binary.html#s3.8" rel="section" title="3.8 Essential packages">
<link href="ch-binary.html#s-maintscripts" rel="section" title="3.9 Maintainer Scripts">
<link href="ch-source.html#s-standardsversion" rel="section" title="4.1 Standards conformance">
<link href="ch-source.html#s-pkg-relations" rel="section" title="4.2 Package relationships">
<link href="ch-source.html#s4.3" rel="section" title="4.3 Changes to the upstream sources">
<link href="ch-source.html#s-dpkgchangelog" rel="section" title="4.4 Ubuntu changelog: <code>debian/changelog</code>">
<link href="ch-source.html#s-dpkgcopyright" rel="section" title="4.5 Copyright: <code>debian/copyright</code>">
<link href="ch-source.html#s4.6" rel="section" title="4.6 Error trapping in makefiles">
<link href="ch-source.html#s-timestamps" rel="section" title="4.7 Time Stamps">
<link href="ch-source.html#s-restrictions" rel="section" title="4.8 Restrictions on objects in source packages">
<link href="ch-source.html#s-debianrules" rel="section" title="4.9 Main building script: <code>debian/rules</code>">
<link href="ch-source.html#s-substvars" rel="section" title="4.10 Variable substitutions: <code>debian/substvars</code>">
<link href="ch-source.html#s-debianwatch" rel="section" title="4.11 Optional upstream source location: <code>debian/watch</code>">
<link href="ch-source.html#s-debianfiles" rel="section" title="4.12 Generated files list: <code>debian/files</code>">
<link href="ch-source.html#s-embeddedfiles" rel="section" title="4.13 Convenience copies of code">
<link href="ch-source.html#s-readmesource" rel="section" title="4.14 Source package handling: <code>debian/README.source</code>">
<link href="ch-controlfields.html#s-controlsyntax" rel="section" title="5.1 Syntax of control files">
<link href="ch-controlfields.html#s-sourcecontrolfiles" rel="section" title="5.2 Source package control files -- <code>debian/control</code>">
<link href="ch-controlfields.html#s-binarycontrolfiles" rel="section" title="5.3 Binary package control files -- <code>DEBIAN/control</code>">
<link href="ch-controlfields.html#s-debiansourcecontrolfiles" rel="section" title="5.4 Debian source control files -- <samp>.dsc</samp>">
<link href="ch-controlfields.html#s-debianchangesfiles" rel="section" title="5.5 Debian changes files -- <code>.changes</code>">
<link href="ch-controlfields.html#s-controlfieldslist" rel="section" title="5.6 List of fields">
<link href="ch-controlfields.html#s5.7" rel="section" title="5.7 User-defined fields">
<link href="ch-maintainerscripts.html#s6.1" rel="section" title="6.1 Introduction to package maintainer scripts">
<link href="ch-maintainerscripts.html#s-idempotency" rel="section" title="6.2 Maintainer scripts idempotency">
<link href="ch-maintainerscripts.html#s-controllingterminal" rel="section" title="6.3 Controlling terminal for maintainer scripts">
<link href="ch-maintainerscripts.html#s-exitstatus" rel="section" title="6.4 Exit status">
<link href="ch-maintainerscripts.html#s-mscriptsinstact" rel="section" title="6.5 Summary of ways maintainer scripts are called">
<link href="ch-maintainerscripts.html#s-unpackphase" rel="section" title="6.6 Details of unpack phase of installation or upgrade">
<link href="ch-maintainerscripts.html#s-configdetails" rel="section" title="6.7 Details of configuration">
<link href="ch-maintainerscripts.html#s-removedetails" rel="section" title="6.8 Details of removal and/or configuration purging">
<link href="ch-relationships.html#s-depsyntax" rel="section" title="7.1 Syntax of relationship fields">
<link href="ch-relationships.html#s-binarydeps" rel="section" title="7.2 Binary Dependencies - <samp>Depends</samp>, <samp>Recommends</samp>, <samp>Suggests</samp>, <samp>Enhances</samp>, <samp>Pre-Depends</samp>">
<link href="ch-relationships.html#s-breaks" rel="section" title="7.3 Packages which break other packages - <samp>Breaks</samp>">
<link href="ch-relationships.html#s-conflicts" rel="section" title="7.4 Conflicting binary packages - <samp>Conflicts</samp>">
<link href="ch-relationships.html#s-virtual" rel="section" title="7.5 Virtual packages - <samp>Provides</samp>">
<link href="ch-relationships.html#s-replaces" rel="section" title="7.6 Overwriting files and replacing packages - <samp>Replaces</samp>">
<link href="ch-relationships.html#s-sourcebinarydeps" rel="section" title="7.7 Relationships between source and binary packages - <samp>Build-Depends</samp>, <samp>Build-Depends-Indep</samp>, <samp>Build-Conflicts</samp>, <samp>Build-Conflicts-Indep</samp>">
<link href="ch-sharedlibs.html#s-sharedlibs-runtime" rel="section" title="8.1 Run-time shared libraries">
<link href="ch-sharedlibs.html#s-sharedlibs-support-files" rel="section" title="8.2 Shared library support files">
<link href="ch-sharedlibs.html#s-sharedlibs-static" rel="section" title="8.3 Static libraries">
<link href="ch-sharedlibs.html#s-sharedlibs-dev" rel="section" title="8.4 Development files">
<link href="ch-sharedlibs.html#s-sharedlibs-intradeps" rel="section" title="8.5 Dependencies between the packages of the same library">
<link href="ch-sharedlibs.html#s-sharedlibs-shlibdeps" rel="section" title="8.6 Dependencies between the library and other packages - the <samp>shlibs</samp> system">
<link href="ch-opersys.html#s9.1" rel="section" title="9.1 File system hierarchy">
<link href="ch-opersys.html#s9.2" rel="section" title="9.2 Users and groups">
<link href="ch-opersys.html#s-sysvinit" rel="section" title="9.3 System run levels and <code>init.d</code> scripts">
<link href="ch-opersys.html#s9.4" rel="section" title="9.4 Console messages from <code>init.d</code> scripts">
<link href="ch-opersys.html#s9.5" rel="section" title="9.5 Cron jobs">
<link href="ch-opersys.html#s-menus" rel="section" title="9.6 Menus">
<link href="ch-opersys.html#s-mime" rel="section" title="9.7 Multimedia handlers">
<link href="ch-opersys.html#s9.8" rel="section" title="9.8 Keyboard configuration">
<link href="ch-opersys.html#s9.9" rel="section" title="9.9 Environment variables">
<link href="ch-opersys.html#s-doc-base" rel="section" title="9.10 Registering Documents using doc-base">
<link href="ch-files.html#s10.1" rel="section" title="10.1 Binaries">
<link href="ch-files.html#s-libraries" rel="section" title="10.2 Libraries">
<link href="ch-files.html#s10.3" rel="section" title="10.3 Shared libraries">
<link href="ch-files.html#s-scripts" rel="section" title="10.4 Scripts">
<link href="ch-files.html#s10.5" rel="section" title="10.5 Symbolic links">
<link href="ch-files.html#s10.6" rel="section" title="10.6 Device files">
<link href="ch-files.html#s-config-files" rel="section" title="10.7 Configuration files">
<link href="ch-files.html#s10.8" rel="section" title="10.8 Log files">
<link href="ch-files.html#s10.9" rel="section" title="10.9 Permissions and owners">
<link href="ch-customized-programs.html#s-arch-spec" rel="section" title="11.1 Architecture specification strings">
<link href="ch-customized-programs.html#s11.2" rel="section" title="11.2 Daemons">
<link href="ch-customized-programs.html#s11.3" rel="section" title="11.3 Using pseudo-ttys and modifying wtmp, utmp and lastlog">
<link href="ch-customized-programs.html#s11.4" rel="section" title="11.4 Editors and pagers">
<link href="ch-customized-programs.html#s-web-appl" rel="section" title="11.5 Web servers and applications">
<link href="ch-customized-programs.html#s-mail-transport-agents" rel="section" title="11.6 Mail transport, delivery and user agents">
<link href="ch-customized-programs.html#s11.7" rel="section" title="11.7 News system configuration">
<link href="ch-customized-programs.html#s11.8" rel="section" title="11.8 Programs for the X Window System">
<link href="ch-customized-programs.html#s-perl" rel="section" title="11.9 Perl programs and modules">
<link href="ch-customized-programs.html#s-emacs" rel="section" title="11.10 Emacs lisp programs">
<link href="ch-customized-programs.html#s11.11" rel="section" title="11.11 Games">
<link href="ch-docs.html#s12.1" rel="section" title="12.1 Manual pages">
<link href="ch-docs.html#s12.2" rel="section" title="12.2 Info documents">
<link href="ch-docs.html#s12.3" rel="section" title="12.3 Additional documentation">
<link href="ch-docs.html#s12.4" rel="section" title="12.4 Preferred documentation formats">
<link href="ch-docs.html#s-copyrightfile" rel="section" title="12.5 Copyright information">
<link href="ch-docs.html#s12.6" rel="section" title="12.6 Examples">
<link href="ch-docs.html#s-changelogs" rel="section" title="12.7 Changelog files">
<link href="ap-pkg-binarypkg.html#s-pkg-bincreating" rel="section" title="B.1 Creating package files - <code>dpkg-deb</code>">
<link href="ap-pkg-binarypkg.html#s-pkg-controlarea" rel="section" title="B.2 Package control information files">
<link href="ap-pkg-binarypkg.html#s-pkg-controlfile" rel="section" title="B.3 The main control information file: <samp>control</samp>">
<link href="ap-pkg-binarypkg.html#sB.4" rel="section" title="B.4 Time Stamps">
<link href="ap-pkg-sourcepkg.html#s-pkg-sourcetools" rel="section" title="C.1 Tools for processing source packages">
<link href="ap-pkg-sourcepkg.html#s-pkg-sourcetree" rel="section" title="C.2 The Debianised source tree">
<link href="ap-pkg-sourcepkg.html#s-pkg-sourcearchives" rel="section" title="C.3 Source packages as archives">
<link href="ap-pkg-sourcepkg.html#sC.4" rel="section" title="C.4 Unpacking a Debian source package without <code>dpkg-source</code>">
<link href="ap-pkg-controlfields.html#sD.1" rel="section" title="D.1 Syntax of control files">
<link href="ap-pkg-controlfields.html#sD.2" rel="section" title="D.2 List of fields">
<link href="ap-pkg-conffiles.html#sE.1" rel="section" title="E.1 Automatic handling of configuration files by <code>dpkg</code>">
<link href="ap-pkg-conffiles.html#sE.2" rel="section" title="E.2 Fully-featured maintainer script configuration handling">
<link href="ch-archive.html#s-main" rel="subsection" title="2.2.1 The main archive area">
<link href="ch-archive.html#s-restricted" rel="subsection" title="2.2.2 The restricted archive area">
<link href="ch-archive.html#s-universe" rel="subsection" title="2.2.3 The universe archive area">
<link href="ch-archive.html#s-multiverse" rel="subsection" title="2.2.4 The multiverse archive area">
<link href="ch-binary.html#s3.2.1" rel="subsection" title="3.2.1 Version numbers based on dates">
<link href="ch-binary.html#s-synopsis" rel="subsection" title="3.4.1 The single line synopsis">
<link href="ch-binary.html#s-extendeddesc" rel="subsection" title="3.4.2 The extended description">
<link href="ch-binary.html#s-maintscriptprompt" rel="subsection" title="3.9.1 Prompting in maintainer scripts">
<link href="ch-source.html#s-debianrules-options" rel="subsection" title="4.9.1 <code>debian/rules</code> and <samp>DEB_BUILD_OPTIONS</samp>">
<link href="ch-controlfields.html#s-f-Source" rel="subsection" title="5.6.1 <samp>Source</samp>">
<link href="ch-controlfields.html#s-f-Maintainer" rel="subsection" title="5.6.2 <samp>Maintainer</samp>">
<link href="ch-controlfields.html#s-f-Uploaders" rel="subsection" title="5.6.3 <samp>Uploaders</samp>">
<link href="ch-controlfields.html#s-f-Changed-By" rel="subsection" title="5.6.4 <samp>Changed-By</samp>">
<link href="ch-controlfields.html#s-f-Section" rel="subsection" title="5.6.5 <samp>Section</samp>">
<link href="ch-controlfields.html#s-f-Priority" rel="subsection" title="5.6.6 <samp>Priority</samp>">
<link href="ch-controlfields.html#s-f-Package" rel="subsection" title="5.6.7 <samp>Package</samp>">
<link href="ch-controlfields.html#s-f-Architecture" rel="subsection" title="5.6.8 <samp>Architecture</samp>">
<link href="ch-controlfields.html#s-f-Essential" rel="subsection" title="5.6.9 <samp>Essential</samp>">
<link href="ch-controlfields.html#s5.6.10" rel="subsection" title="5.6.10 Package interrelationship fields: <samp>Depends</samp>, <samp>Pre-Depends</samp>, <samp>Recommends</samp>, <samp>Suggests</samp>, <samp>Breaks</samp>, <samp>Conflicts</samp>, <samp>Provides</samp>, <samp>Replaces</samp>, <samp>Enhances</samp>">
<link href="ch-controlfields.html#s-f-Standards-Version" rel="subsection" title="5.6.11 <samp>Standards-Version</samp>">
<link href="ch-controlfields.html#s-f-Version" rel="subsection" title="5.6.12 <samp>Version</samp>">
<link href="ch-controlfields.html#s-f-Description" rel="subsection" title="5.6.13 <samp>Description</samp>">
<link href="ch-controlfields.html#s-f-Distribution" rel="subsection" title="5.6.14 <samp>Distribution</samp>">
<link href="ch-controlfields.html#s-f-Date" rel="subsection" title="5.6.15 <samp>Date</samp>">
<link href="ch-controlfields.html#s-f-Format" rel="subsection" title="5.6.16 <samp>Format</samp>">
<link href="ch-controlfields.html#s-f-Urgency" rel="subsection" title="5.6.17 <samp>Urgency</samp>">
<link href="ch-controlfields.html#s-f-Changes" rel="subsection" title="5.6.18 <samp>Changes</samp>">
<link href="ch-controlfields.html#s-f-Binary" rel="subsection" title="5.6.19 <samp>Binary</samp>">
<link href="ch-controlfields.html#s-f-Installed-Size" rel="subsection" title="5.6.20 <samp>Installed-Size</samp>">
<link href="ch-controlfields.html#s-f-Files" rel="subsection" title="5.6.21 <samp>Files</samp>">
<link href="ch-controlfields.html#s-f-Closes" rel="subsection" title="5.6.22 <samp>Closes</samp>">
<link href="ch-controlfields.html#s-f-Launchpad-Bugs-Fixed" rel="subsection" title="5.6.23 <samp>Launchpad-Bugs-Fixed</samp>">
<link href="ch-controlfields.html#s-f-Homepage" rel="subsection" title="5.6.24 <samp>Homepage</samp>">
<link href="ch-relationships.html#s7.6.1" rel="subsection" title="7.6.1 Overwriting files in other packages">
<link href="ch-relationships.html#s7.6.2" rel="subsection" title="7.6.2 Replacing whole packages, forcing their removal">
<link href="ch-sharedlibs.html#s-ldconfig" rel="subsection" title="8.1.1 <samp>ldconfig</samp>">
<link href="ch-sharedlibs.html#s8.6.1" rel="subsection" title="8.6.1 The <samp>shlibs</samp> files present on the system">
<link href="ch-sharedlibs.html#s8.6.2" rel="subsection" title="8.6.2 How to use <code>dpkg-shlibdeps</code> and the <code>shlibs</code> files">
<link href="ch-sharedlibs.html#s-shlibs" rel="subsection" title="8.6.3 The <code>shlibs</code> File Format">
<link href="ch-sharedlibs.html#s8.6.4" rel="subsection" title="8.6.4 Providing a <code>shlibs</code> file">
<link href="ch-sharedlibs.html#s-shlibslocal" rel="subsection" title="8.6.5 Writing the <code>debian/shlibs.local</code> file">
<link href="ch-opersys.html#s-fhs" rel="subsection" title="9.1.1 File System Structure">
<link href="ch-opersys.html#s9.1.2" rel="subsection" title="9.1.2 Site-specific programs">
<link href="ch-opersys.html#s9.1.3" rel="subsection" title="9.1.3 The system-wide mail directory">
<link href="ch-opersys.html#s9.2.1" rel="subsection" title="9.2.1 Introduction">
<link href="ch-opersys.html#s9.2.2" rel="subsection" title="9.2.2 UID and GID classes">
<link href="ch-opersys.html#s-/etc/init.d" rel="subsection" title="9.3.1 Introduction">
<link href="ch-opersys.html#s9.3.2" rel="subsection" title="9.3.2 Writing the scripts">
<link href="ch-opersys.html#s9.3.3" rel="subsection" title="9.3.3 Interfacing with the initscript system">
<link href="ch-opersys.html#s9.3.3.1" rel="subsection" title="9.3.3.1 Managing the links">
<link href="ch-opersys.html#s9.3.3.2" rel="subsection" title="9.3.3.2 Running initscripts">
<link href="ch-opersys.html#s9.3.4" rel="subsection" title="9.3.4 Boot-time initialization">
<link href="ch-opersys.html#s9.3.5" rel="subsection" title="9.3.5 Example">
<link href="ch-files.html#s10.7.1" rel="subsection" title="10.7.1 Definitions">
<link href="ch-files.html#s10.7.2" rel="subsection" title="10.7.2 Location">
<link href="ch-files.html#s10.7.3" rel="subsection" title="10.7.3 Behavior">
<link href="ch-files.html#s10.7.4" rel="subsection" title="10.7.4 Sharing configuration files">
<link href="ch-files.html#s10.7.5" rel="subsection" title="10.7.5 User configuration files ("dotfiles")">
<link href="ch-files.html#s10.9.1" rel="subsection" title="10.9.1 The use of <code>dpkg-statoverride</code>">
<link href="ch-customized-programs.html#s11.8.1" rel="subsection" title="11.8.1 Providing X support and package priorities">
<link href="ch-customized-programs.html#s11.8.2" rel="subsection" title="11.8.2 Packages providing an X server">
<link href="ch-customized-programs.html#s11.8.3" rel="subsection" title="11.8.3 Packages providing a terminal emulator">
<link href="ch-customized-programs.html#s11.8.4" rel="subsection" title="11.8.4 Packages providing a window manager">
<link href="ch-customized-programs.html#s11.8.5" rel="subsection" title="11.8.5 Packages providing fonts">
<link href="ch-customized-programs.html#s11.8.6" rel="subsection" title="11.8.6 Application defaults files">
<link href="ch-customized-programs.html#s11.8.7" rel="subsection" title="11.8.7 Installation directory issues">
<link href="ch-customized-programs.html#s11.8.8" rel="subsection" title="11.8.8 The OSF/Motif and OpenMotif libraries">
<link href="ch-customized-programs.html#s11.8.9" rel="subsection" title="11.8.9 Icon caching">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-source" rel="subsection" title="C.1.1 <code>dpkg-source</code> - packs and unpacks Debian source packages">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-buildpackage" rel="subsection" title="C.1.2 <code>dpkg-buildpackage</code> - overall package-building control script">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-gencontrol" rel="subsection" title="C.1.3 <code>dpkg-gencontrol</code> - generates binary package control files">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-shlibdeps" rel="subsection" title="C.1.4 <code>dpkg-shlibdeps</code> - calculates shared library dependencies">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-distaddfile" rel="subsection" title="C.1.5 <code>dpkg-distaddfile</code> - adds a file to <code>debian/files</code>">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-genchanges" rel="subsection" title="C.1.6 <code>dpkg-genchanges</code> - generates a <code>.changes</code> upload control file">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-parsechangelog" rel="subsection" title="C.1.7 <code>dpkg-parsechangelog</code> - produces parsed representation of a changelog">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkg-architecture" rel="subsection" title="C.1.8 <code>dpkg-architecture</code> - information about the build and host system">
<link href="ap-pkg-sourcepkg.html#s-pkg-debianrules" rel="subsection" title="C.2.1 <code>debian/rules</code> - the main building script">
<link href="ap-pkg-sourcepkg.html#s-pkg-dpkgchangelog" rel="subsection" title="C.2.2 <code>debian/changelog</code>">
<link href="ap-pkg-sourcepkg.html#sC.2.2.1" rel="subsection" title="C.2.2.1 Defining alternative changelog formats">
<link href="ap-pkg-sourcepkg.html#s-pkg-srcsubstvars" rel="subsection" title="C.2.3 <code>debian/substvars</code> and variable substitutions">
<link href="ap-pkg-sourcepkg.html#sC.2.4" rel="subsection" title="C.2.4 <code>debian/files</code>">
<link href="ap-pkg-sourcepkg.html#sC.2.5" rel="subsection" title="C.2.5 <code>debian/tmp</code>">
<link href="ap-pkg-sourcepkg.html#sC.4.1" rel="subsection" title="C.4.1 Restrictions on objects in source packages">
<link href="ap-pkg-controlfields.html#s-pkg-f-Filename" rel="subsection" title="D.2.1 <samp>Filename</samp> and <samp>MSDOS-Filename</samp>">
<link href="ap-pkg-controlfields.html#s-pkg-f-Size" rel="subsection" title="D.2.2 <samp>Size</samp> and <samp>MD5sum</samp>">
<link href="ap-pkg-controlfields.html#s-pkg-f-Status" rel="subsection" title="D.2.3 <samp>Status</samp>">
<link href="ap-pkg-controlfields.html#s-pkg-f-Config-Version" rel="subsection" title="D.2.4 <samp>Config-Version</samp>">
<link href="ap-pkg-controlfields.html#s-pkg-f-Conffiles" rel="subsection" title="D.2.5 <samp>Conffiles</samp>">
<link href="ap-pkg-controlfields.html#sD.2.6" rel="subsection" title="D.2.6 Obsolete fields">
</head>
<body>
<p><a name="ap-pkg-sourcepkg"></a></p>
<hr>
<p>
[ <a href="ap-pkg-binarypkg.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-scope.html">1</a> ]
[ <a href="ch-archive.html">2</a> ]
[ <a href="ch-binary.html">3</a> ]
[ <a href="ch-source.html">4</a> ]
[ <a href="ch-controlfields.html">5</a> ]
[ <a href="ch-maintainerscripts.html">6</a> ]
[ <a href="ch-relationships.html">7</a> ]
[ <a href="ch-sharedlibs.html">8</a> ]
[ <a href="ch-opersys.html">9</a> ]
[ <a href="ch-files.html">10</a> ]
[ <a href="ch-customized-programs.html">11</a> ]
[ <a href="ch-docs.html">12</a> ]
[ <a href="ap-pkg-scope.html">A</a> ]
[ <a href="ap-pkg-binarypkg.html">B</a> ]
[ C ]
[ <a href="ap-pkg-controlfields.html">D</a> ]
[ <a href="ap-pkg-conffiles.html">E</a> ]
[ <a href="ap-pkg-alternatives.html">F</a> ]
[ <a href="ap-pkg-diversions.html">G</a> ]
[ <a href="ap-pkg-controlfields.html">next</a> ]
</p>
<hr>
<h1>
Ubuntu Policy Manual
<br>Appendix C - Source packages (from old Packaging Manual)</h1>
<hr>
<p>
The Debian binary packages in the distribution are generated from Debian
sources, which are in a special format to assist the easy and automatic
building of binaries.
</p>
<hr>
<h2><a name="s-pkg-sourcetools"></a>C.1 Tools for processing source packages</h2>
<p>
Various tools are provided for manipulating source packages; they pack and
unpack sources and help build of binary packages and help manage the
distribution of new versions.
</p>
<p>
They are introduced and typical uses described here; see
<code>dpkg-source(1)</code> for full documentation about their arguments and
operation.
</p>
<p>
For examples of how to construct a Debian source package, and how to use those
utilities that are used by Debian source packages, please see the
<code>hello</code> example package.
</p>
<hr>
<h3><a name="s-pkg-dpkg-source"></a>C.1.1 <code>dpkg-source</code> - packs and unpacks Debian source packages</h3>
<p>
This program is frequently used by hand, and is also called from
package-independent automated building scripts such as
<code>dpkg-buildpackage</code>.
</p>
<p>
To unpack a package it is typically invoked with
</p>
<pre>
dpkg-source -x <var>.../path/to/filename</var>.dsc
</pre>
<p>
with the <code><var>filename</var>.tar.gz</code> and
<code><var>filename</var>.diff.gz</code> (if applicable) in the same directory.
It unpacks into <code><var>package</var>-<var>version</var></code>, and if
applicable <code><var>package</var>-<var>version</var>.orig</code>, in the
current directory.
</p>
<p>
To create a packed source archive it is typically invoked:
</p>
<pre>
dpkg-source -b <var>package</var>-<var>version</var>
</pre>
<p>
This will create the <code>.dsc</code>, <code>.tar.gz</code> and
<code>.diff.gz</code> (if appropriate) in the current directory.
<code>dpkg-source</code> does not clean the source tree first - this must be
done separately if it is required.
</p>
<p>
See also <a href="#s-pkg-sourcearchives">Source packages as archives, Section
C.3</a>.
</p>
<hr>
<h3><a name="s-pkg-dpkg-buildpackage"></a>C.1.2 <code>dpkg-buildpackage</code> - overall package-building control script</h3>
<p>
<code>dpkg-buildpackage</code> is a script which invokes
<code>dpkg-source</code>, the <code>debian/rules</code> targets
<samp>clean</samp>, <samp>build</samp> and <samp>binary</samp>,
<code>dpkg-genchanges</code> and <code>gpg</code> (or <code>pgp</code>) to
build a signed source and binary package upload.
</p>
<p>
It is usually invoked by hand from the top level of the built or unbuilt source
directory. It may be invoked with no arguments; useful arguments include:
</p>
<dl>
<dt><samp>-uc</samp>, <samp>-us</samp></dt>
<dd>
<p>
Do not sign the <samp>.changes</samp> file or the source package
<samp>.dsc</samp> file, respectively.
</p>
</dd>
<dt><samp>-p<var>sign-command</var></samp></dt>
<dd>
<p>
Invoke <var>sign-command</var> instead of finding <samp>gpg</samp> or
<samp>pgp</samp> on the <code>PATH</code>. <var>sign-command</var> must behave
just like <code>gpg</code> or <samp>pgp</samp>.
</p>
</dd>
<dt><samp>-r<var>root-command</var></samp></dt>
<dd>
<p>
When root privilege is required, invoke the command <var>root-command</var>.
<var>root-command</var> should invoke its first argument as a command, from the
<code>PATH</code> if necessary, and pass its second and subsequent arguments to
the command it calls. If no <var>root-command</var> is supplied then
<var>dpkg-buildpackage</var> will take no special action to gain root
privilege, so that for most packages it will have to be invoked as root to
start with.
</p>
</dd>
<dt><samp>-b</samp>, <samp>-B</samp></dt>
<dd>
<p>
Two types of binary-only build and upload - see <code>dpkg-source(1)</code>.
</p>
</dd>
</dl>
<hr>
<h3><a name="s-pkg-dpkg-gencontrol"></a>C.1.3 <code>dpkg-gencontrol</code> - generates binary package control files</h3>
<p>
This program is usually called from <code>debian/rules</code> (see <a
href="#s-pkg-sourcetree">The Debianised source tree, Section C.2</a>) in the
top level of the source tree.
</p>
<p>
This is usually done just before the files and directories in the temporary
directory tree where the package is being built have their permissions and
ownerships set and the package is constructed using <code>dpkg-deb/</code> [<a
href="footnotes.html#f101" name="fr101">101</a>].
</p>
<p>
<code>dpkg-gencontrol</code> must be called after all the files which are to go
into the package have been placed in the temporary build directory, so that its
calculation of the installed size of a package is correct.
</p>
<p>
It is also necessary for <code>dpkg-gencontrol</code> to be run after
<code>dpkg-shlibdeps</code> so that the variable substitutions created by
<code>dpkg-shlibdeps</code> in <code>debian/substvars</code> are available.
</p>
<p>
For a package which generates only one binary package, and which builds it in
<code>debian/tmp</code> relative to the top of the source package, it is
usually sufficient to call <code>dpkg-gencontrol</code>.
</p>
<p>
Sources which build several binaries will typically need something like:
</p>
<pre>
dpkg-gencontrol -Pdebian/tmp-<var>pkg</var> -p<var>package</var>
</pre>
<p>
The <samp>-P</samp> tells <code>dpkg-gencontrol</code> that the package is
being built in a non-default directory, and the <samp>-p</samp> tells it which
package's control file should be generated.
</p>
<p>
<code>dpkg-gencontrol</code> also adds information to the list of files in
<code>debian/files</code>, for the benefit of (for example) a future invocation
of <code>dpkg-genchanges</code>.
</p>
<hr>
<h3><a name="s-pkg-dpkg-shlibdeps"></a>C.1.4 <code>dpkg-shlibdeps</code> - calculates shared library dependencies</h3>
<p>
This program is usually called from <code>debian/rules</code> just before
<code>dpkg-gencontrol</code> (see <a href="#s-pkg-sourcetree">The Debianised
source tree, Section C.2</a>), in the top level of the source tree.
</p>
<p>
Its arguments are executables and shared libraries [<a
href="footnotes.html#f102" name="fr102">102</a>] for which shared library
dependencies should be included in the binary package's control file.
</p>
<p>
If some of the found shared libraries should only warrant a
<samp>Recommends</samp> or <samp>Suggests</samp>, or if some warrant a
<samp>Pre-Depends</samp>, this can be achieved by using the
<samp>-d<var>dependency-field</var></samp> option before those executable(s).
(Each <samp>-d</samp> option takes effect until the next <samp>-d</samp>.)
</p>
<p>
<code>dpkg-shlibdeps</code> does not directly cause the output control file to
be modified. Instead by default it adds to the <code>debian/substvars</code>
file variable settings like <samp>shlibs:Depends</samp>. These variable
settings must be referenced in dependency fields in the appropriate
per-binary-package sections of the source control file.
</p>
<p>
For example, a package that generates an essential part which requires
dependencies, and optional parts that which only require a recommendation,
would separate those two sets of dependencies into two different fields.[<a
href="footnotes.html#f103" name="fr103">103</a>] It can say in its
<code>debian/rules</code>:
</p>
<pre>
dpkg-shlibdeps -dDepends <var>program anotherprogram ...</var> \
-dRecommends <var>optionalpart anotheroptionalpart</var>
</pre>
<p>
and then in its main control file <code>debian/control</code>:
</p>
<pre>
<var>...</var>
Depends: ${shlibs:Depends}
Recommends: ${shlibs:Recommends}
<var>...</var>
</pre>
<p>
Sources which produce several binary packages with different shared library
dependency requirements can use the <samp>-p<var>varnameprefix</var></samp>
option to override the default <samp>shlibs:</samp> prefix (one invocation of
<code>dpkg-shlibdeps</code> per setting of this option). They can thus produce
several sets of dependency variables, each of the form
<samp><var>varnameprefix</var>:<var>dependencyfield</var></samp>, which can be
referred to in the appropriate parts of the binary package control files.
</p>
<hr>
<h3><a name="s-pkg-dpkg-distaddfile"></a>C.1.5 <code>dpkg-distaddfile</code> - adds a file to <code>debian/files</code></h3>
<p>
Some packages' uploads need to include files other than the source and binary
package files.
</p>
<p>
<code>dpkg-distaddfile</code> adds a file to the <code>debian/files</code> file
so that it will be included in the <code>.changes</code> file when
<code>dpkg-genchanges</code> is run.
</p>
<p>
It is usually invoked from the <samp>binary</samp> target of
<code>debian/rules</code>:
</p>
<pre>
dpkg-distaddfile <var>filename</var> <var>section</var> <var>priority</var>
</pre>
<p>
The <var>filename</var> is relative to the directory where
<code>dpkg-genchanges</code> will expect to find it - this is usually the
directory above the top level of the source tree. The
<code>debian/rules</code> target should put the file there just before or just
after calling <code>dpkg-distaddfile</code>.
</p>
<p>
The <var>section</var> and <var>priority</var> are passed unchanged into the
resulting <code>.changes</code> file.
</p>
<hr>
<h3><a name="s-pkg-dpkg-genchanges"></a>C.1.6 <code>dpkg-genchanges</code> - generates a <code>.changes</code> upload control file</h3>
<p>
This program is usually called by package-independent automatic building
scripts such as <code>dpkg-buildpackage</code>, but it may also be called by
hand.
</p>
<p>
It is usually called in the top level of a built source tree, and when invoked
with no arguments will print out a straightforward <code>.changes</code> file
based on the information in the source package's changelog and control file and
the binary and source packages which should have been built.
</p>
<hr>
<h3><a name="s-pkg-dpkg-parsechangelog"></a>C.1.7 <code>dpkg-parsechangelog</code> - produces parsed representation of a changelog</h3>
<p>
This program is used internally by <code>dpkg-source</code> et al. It may also
occasionally be useful in <code>debian/rules</code> and elsewhere. It parses a
changelog, <code>debian/changelog</code> by default, and prints a control-file
format representation of the information in it to standard output.
</p>
<hr>
<h3><a name="s-pkg-dpkg-architecture"></a>C.1.8 <code>dpkg-architecture</code> - information about the build and host system</h3>
<p>
This program can be used manually, but is also invoked by
<samp>dpkg-buildpackage</samp> or <code>debian/rules</code> to set environment
or make variables which specify the build and host architecture for the package
building process.
</p>
<hr>
<h2><a name="s-pkg-sourcetree"></a>C.2 The Debianised source tree</h2>
<p>
The source archive scheme described later is intended to allow a Debianised
source tree with some associated control information to be reproduced and
transported easily. The Debianised source tree is a version of the original
program with certain files added for the benefit of the Debianisation process,
and with any other changes required made to the rest of the source code and
installation scripts.
</p>
<p>
The extra files created for Debian are in the subdirectory <code>debian</code>
of the top level of the Debianised source tree. They are described below.
</p>
<hr>
<h3><a name="s-pkg-debianrules"></a>C.2.1 <code>debian/rules</code> - the main building script</h3>
<p>
See <a href="ch-source.html#s-debianrules">Main building script:
<code>debian/rules</code>, Section 4.9</a>.
</p>
<hr>
<h3><a name="s-pkg-dpkgchangelog"></a>C.2.2 <code>debian/changelog</code></h3>
<p>
See <a href="ch-source.html#s-dpkgchangelog">Ubuntu changelog:
<code>debian/changelog</code>, Section 4.4</a>.
</p>
<hr>
<h4><a name="sC.2.2.1"></a>C.2.2.1 Defining alternative changelog formats</h4>
<p>
It is possible to use a different format to the standard one, by providing a
parser for the format you wish to use.
</p>
<p>
In order to have <samp>dpkg-parsechangelog</samp> run your parser, you must
include a line within the last 40 lines of your file matching the Perl regular
expression: <samp>\schangelog-format:\s+([0-9a-z]+)\W</samp> The part in
parentheses should be the name of the format. For example, you might say:
</p>
<pre>
@@@ changelog-format: joebloggs @@@
</pre>
<p>
Changelog format names are non-empty strings of alphanumerics.
</p>
<p>
If such a line exists then <samp>dpkg-parsechangelog</samp> will look for the
parser as <code>/usr/lib/dpkg/parsechangelog/<var>format-name</var></code> or
<code>/usr/local/lib/dpkg/parsechangelog/<var>format-name</var></code>; it is
an error for it not to find it, or for it not to be an executable program. The
default changelog format is <samp>dpkg</samp>, and a parser for it is provided
with the <samp>dpkg</samp> package.
</p>
<p>
The parser will be invoked with the changelog open on standard input at the
start of the file. It should read the file (it may seek if it wishes) to
determine the information required and return the parsed information to
standard output in the form of a series of control fields in the standard
format. By default it should return information about only the most recent
version in the changelog; it should accept a <samp>-v<var>version</var></samp>
option to return changes information from all versions present <em>strictly
after</em> <var>version</var>, and it should then be an error for
<var>version</var> not to be present in the changelog.
</p>
<p>
The fields are:
</p>
<ul>
<li>
<p>
<a href="ch-controlfields.html#s-f-Source"><samp>Source</samp></a>
</p>
</li>
<li>
<p>
<a href="ch-controlfields.html#s-f-Version"><samp>Version</samp></a>
(mandatory)
</p>
</li>
<li>
<p>
<a href="ch-controlfields.html#s-f-Distribution"><samp>Distribution</samp></a>
(mandatory)
</p>
</li>
<li>
<p>
<a href="ch-controlfields.html#s-f-Urgency"><samp>Urgency</samp></a>
(mandatory)
</p>
</li>
<li>
<p>
<a href="ch-controlfields.html#s-f-Maintainer"><samp>Maintainer</samp></a>
(mandatory)
</p>
</li>
<li>
<p>
<a href="ch-controlfields.html#s-f-Date"><samp>Date</samp></a>
</p>
</li>
<li>
<p>
<a href="ch-controlfields.html#s-f-Changes"><samp>Changes</samp></a>
(mandatory)
</p>
</li>
</ul>
<p>
If several versions are being returned (due to the use of <samp>-v</samp>), the
urgency value should be of the highest urgency code listed at the start of any
of the versions requested followed by the concatenated (space-separated)
comments from all the versions requested; the maintainer, version, distribution
and date should always be from the most recent version.
</p>
<p>
For the format of the <samp>Changes</samp> field see <a
href="ch-controlfields.html#s-f-Changes"><samp>Changes</samp>, Section
5.6.18</a>.
</p>
<p>
If the changelog format which is being parsed always or almost always leaves a
blank line between individual change notes these blank lines should be stripped
out, so as to make the resulting output compact.
</p>
<p>
If the changelog format does not contain date or package name information this
information should be omitted from the output. The parser should not attempt
to synthesize it or find it from other sources.
</p>
<p>
If the changelog does not have the expected format the parser should exit with
a nonzero exit status, rather than trying to muddle through and possibly
generating incorrect output.
</p>
<p>
A changelog parser may not interact with the user at all.
</p>
<hr>
<h3><a name="s-pkg-srcsubstvars"></a>C.2.3 <code>debian/substvars</code> and variable substitutions</h3>
<p>
See <a href="ch-source.html#s-substvars">Variable substitutions:
<code>debian/substvars</code>, Section 4.10</a>.
</p>
<hr>
<h3><a name="sC.2.4"></a>C.2.4 <code>debian/files</code></h3>
<p>
See <a href="ch-source.html#s-debianfiles">Generated files list:
<code>debian/files</code>, Section 4.12</a>.
</p>
<hr>
<h3><a name="sC.2.5"></a>C.2.5 <code>debian/tmp</code></h3>
<p>
This is the canonical temporary location for the construction of binary
packages by the <samp>binary</samp> target. The directory <code>tmp</code>
serves as the root of the file system tree as it is being constructed (for
example, by using the package's upstream makefiles install targets and
redirecting the output there), and it also contains the <samp>DEBIAN</samp>
subdirectory. See <a href="ap-pkg-binarypkg.html#s-pkg-bincreating">Creating
package files - <code>dpkg-deb</code>, Section B.1</a>.
</p>
<p>
If several binary packages are generated from the same source tree it is usual
to use several <code>debian/tmp<var>something</var></code> directories, for
example <code>tmp-a</code> or <code>tmp-doc</code>.
</p>
<p>
Whatever <code>tmp</code> directories are created and used by
<samp>binary</samp> must of course be removed by the <samp>clean</samp> target.
</p>
<hr>
<h2><a name="s-pkg-sourcearchives"></a>C.3 Source packages as archives</h2>
<p>
As it exists on the FTP site, a Debian source package consists of three related
files. You must have the right versions of all three to be able to use them.
</p>
<dl>
<dt>Debian source control file - <samp>.dsc</samp></dt>
<dd>
<p>
This file is a control file used by <code>dpkg-source</code> to extract a
source package. See <a
href="ch-controlfields.html#s-debiansourcecontrolfiles">Debian source control
files -- <samp>.dsc</samp>, Section 5.4</a>.
</p>
</dd>
</dl>
<dl>
<dt>Original source archive - <code><var>package</var>_<var>upstream-version</var>.orig.tar.gz</code></dt>
<dd>
<p>
This is a compressed (with <samp>gzip -9</samp>) <code>tar</code> file
containing the source code from the upstream authors of the program.
</p>
</dd>
</dl>
<dl>
<dt>Debianisation diff - <code><var>package</var>_<var>upstream_version-revision</var>.diff.gz</code></dt>
<dd>
<p>
This is a unified context diff (<samp>diff -u</samp>) giving the changes which
are required to turn the original source into the Debian source. These changes
may only include editing and creating plain files. The permissions of files,
the targets of symbolic links and the characteristics of special files or pipes
may not be changed and no files may be removed or renamed.
</p>
<p>
All the directories in the diff must exist, except the <code>debian</code>
subdirectory of the top of the source tree, which will be created by
<code>dpkg-source</code> if necessary when unpacking.
</p>
<p>
The <code>dpkg-source</code> program will automatically make the
<code>debian/rules</code> file executable (see below).
</p>
</dd>
</dl>
<p>
If there is no original source code - for example, if the package is specially
prepared for Debian or the Debian maintainer is the same as the upstream
maintainer - the format is slightly different: then there is no diff, and the
tarfile is named <code><var>package</var>_<var>version</var>.tar.gz</code>, and
preferably contains a directory named
<code><var>package</var>-<var>version</var></code>.
</p>
<hr>
<h2><a name="sC.4"></a>C.4 Unpacking a Debian source package without <code>dpkg-source</code></h2>
<p>
<samp>dpkg-source -x</samp> is the recommended way to unpack a Debian source
package. However, if it is not available it is possible to unpack a Debian
source archive as follows:
</p>
<!-- ol type="1" start="1" -->
<li>
<p>
Untar the tarfile, which will create a <code>.orig</code> directory.
</p>
</li>
<li>
<p>
Rename the <code>.orig</code> directory to
<code><var>package</var>-<var>version</var></code>.
</p>
</li>
<li>
<p>
Create the subdirectory <code>debian</code> at the top of the source tree.
</p>
</li>
<li>
<p>
Apply the diff using <samp>patch -p0</samp>.
</p>
</li>
<li>
<p>
Untar the tarfile again if you want a copy of the original source code
alongside the Debianised version.
</p>
</li>
</ol>
<p>
It is not possible to generate a valid Debian source archive without using
<code>dpkg-source</code>. In particular, attempting to use <code>diff</code>
directly to generate the <code>.diff.gz</code> file will not work.
</p>
<hr>
<h3><a name="sC.4.1"></a>C.4.1 Restrictions on objects in source packages</h3>
<p>
The source package may not contain any hard links [<a
href="footnotes.html#f104" name="fr104">104</a>] [<a href="footnotes.html#f105"
name="fr105">105</a>], device special files, sockets or setuid or setgid files.
[<a href="footnotes.html#f106" name="fr106">106</a>]
</p>
<p>
The source packaging tools manage the changes between the original and
Debianised source using <code>diff</code> and <code>patch</code>. Turning the
original source tree as included in the <code>.orig.tar.gz</code> into the
debianised source must not involve any changes which cannot be handled by these
tools. Problematic changes which cause <code>dpkg-source</code> to halt with
an error when building the source package are:
</p>
<ul>
<li>
<p>
Adding or removing symbolic links, sockets or pipes.
</p>
</li>
<li>
<p>
Changing the targets of symbolic links.
</p>
</li>
<li>
<p>
Creating directories, other than <code>debian</code>.
</p>
</li>
<li>
<p>
Changes to the contents of binary files.
</p>
</li>
</ul>
<p>
Changes which cause <code>dpkg-source</code> to print a warning but continue
anyway are:
</p>
<ul>
<li>
<p>
Removing files, directories or symlinks. [<a href="footnotes.html#f107"
name="fr107">107</a>]
</p>
</li>
<li>
<p>
Changed text files which are missing the usual final newline (either in the
original or the modified source tree).
</p>
</li>
</ul>
<p>
Changes which are not represented, but which are not detected by
<code>dpkg-source</code>, are:
</p>
<ul>
<li>
<p>
Changing the permissions of files (other than <code>debian/rules</code>) and
directories.
</p>
</li>
</ul>
<p>
The <code>debian</code> directory and <code>debian/rules</code> are handled
specially by <code>dpkg-source</code> - before applying the changes it will
create the <code>debian</code> directory, and afterwards it will make
<code>debian/rules</code> world-executable.
</p>
<hr>
<p>
[ <a href="ap-pkg-binarypkg.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-scope.html">1</a> ]
[ <a href="ch-archive.html">2</a> ]
[ <a href="ch-binary.html">3</a> ]
[ <a href="ch-source.html">4</a> ]
[ <a href="ch-controlfields.html">5</a> ]
[ <a href="ch-maintainerscripts.html">6</a> ]
[ <a href="ch-relationships.html">7</a> ]
[ <a href="ch-sharedlibs.html">8</a> ]
[ <a href="ch-opersys.html">9</a> ]
[ <a href="ch-files.html">10</a> ]
[ <a href="ch-customized-programs.html">11</a> ]
[ <a href="ch-docs.html">12</a> ]
[ <a href="ap-pkg-scope.html">A</a> ]
[ <a href="ap-pkg-binarypkg.html">B</a> ]
[ C ]
[ <a href="ap-pkg-controlfields.html">D</a> ]
[ <a href="ap-pkg-conffiles.html">E</a> ]
[ <a href="ap-pkg-alternatives.html">F</a> ]
[ <a href="ap-pkg-diversions.html">G</a> ]
[ <a href="ap-pkg-controlfields.html">next</a> ]
</p>
<hr>
<p>
Ubuntu Policy Manual
</p>
<address>
version 3.8.2.0ubuntu1, 2009-06-19<br>
<br>
<a href="ch-scope.html#s-authors">The Debian Policy Mailing List</a><br>
<a href="ch-scope.html#s-authors">The Ubuntu Developers Mailing List</a><br>
<br>
</address>
<hr>
</body>
</html>
|