old-www/HOWTO/Debian-Binary-Package-Build.../x60.html

390 lines
7.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Package Structure</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Debian Binary Package Building HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Getting Started"
HREF="x48.html"><LINK
REL="NEXT"
TITLE="Hands On"
HREF="x88.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Debian Binary Package Building HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x48.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x88.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN60"
></A
>3. Package Structure</H1
><P
>&#13; Let's examine one example package a little bit closer. E.g. file '<TT
CLASS="literal"
>parted_1.4.24-4_i386.deb</TT
>'
contains these three files:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;$ ar tv parted_1.4.24-4_i386.deb
rw-r--r-- 0/0 4 Mar 28 13:46 2002 debian-binary
rw-r--r-- 0/0 1386 Mar 28 13:46 2002 control.tar.gz
rw-r--r-- 0/0 39772 Mar 28 13:46 2002 data.tar.gz
</PRE
></FONT
></TD
></TR
></TABLE
><P
>&#13;Now we can start to extract all files including the content of the tar files.
</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN66"
></A
>3.1. debian-binary</H2
><P
>&#13;The content of this file is "2.0\n". This states the version of the deb file format.
For 2.0 all other lines get ignored.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN69"
></A
>3.2. data.tar.gz</H2
><P
>&#13;The 'data.tar.gz' file contains all the files that will be installed with their
destination paths:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;drwxr-xr-x root/root 0 2002-03-28 13:44:57 ./
drwxr-xr-x root/root 0 2002-03-28 13:44:49 ./sbin/
-rwxr-xr-x root/root 31656 2002-03-28 13:44:49 ./sbin/parted
drwxr-xr-x root/root 0 2002-03-28 13:44:38 ./usr/
drwxr-xr-x root/root 0 2002-03-28 13:44:41 ./usr/share/
drwxr-xr-x root/root 0 2002-03-28 13:44:38 ./usr/share/man/
drwxr-xr-x root/root 0 2002-03-28 13:44:52 ./usr/share/man/man8/
-rw-r--r-- root/root 1608 2002-03-28 13:44:37 ./usr/share/man/man8/parted.8.gz
drwxr-xr-x root/root 0 2002-03-28 13:44:41 ./usr/share/doc/
drwxr-xr-x root/root 0 2002-03-28 13:44:52 ./usr/share/doc/parted/
-rw-r--r-- root/root 1880 2002-03-07 14:20:08 ./usr/share/doc/parted/README.Debian
-rw-r--r-- root/root 1347 2002-02-27 01:40:50 ./usr/share/doc/parted/copyright
-rw-r--r-- root/root 6444 2002-03-28 13:37:33 ./usr/share/doc/parted/changelog.Debian.gz
-rw-r--r-- root/root 15523 2002-03-28 02:36:43 ./usr/share/doc/parted/changelog.gz
</PRE
></FONT
></TD
></TR
></TABLE
><P
>&#13;It must be the last file in the deb archive.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN74"
></A
>3.3. control.tar.gz</H2
><P
>&#13;In our example this file has the following content:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;-rw-r--r-- 1 root root 1336 Mar 28 2002 control
-rw-r--r-- 1 root root 388 Mar 28 2002 md5sums
-rwxr-xr-x 1 root root 253 Mar 28 2002 postinst
-rwxr-xr-x 1 root root 194 Mar 28 2002 prerm
</PRE
></FONT
></TD
></TR
></TABLE
><P
>&#13;'md5sums' contains for each file in data.tar.gz the md5sum. In our example the content looks like this:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;1d15dcfb6bb23751f76a2b7b844d3c57 sbin/parted
4eb9cc2e192f1b997cf13ff0b921af74 usr/share/man/man8/parted.8.gz
2f356768104a09092e26a6abb012c95e usr/share/doc/parted/README.Debian
a6259bd193f8f150c171c88df2158e3e usr/share/doc/parted/copyright
7f8078127a689d647586420184fc3953 usr/share/doc/parted/changelog.Debian.gz
98f217a3bf8a7407d66fd6ac8c5589b7 usr/share/doc/parted/changelog.gz
</PRE
></FONT
></TD
></TR
></TABLE
><P
>&#13;
Don't worry, the 'md5sum' file as well as the 'postinst' and
'prerm' files are not mandatory for your first package.
But please take a note of their
existence, every proper official Debian package has them
for good reasons.</P
><P
>&#13;
'prerm' and 'postinst' seem to take care of removing old documentation files
and adding a link from doc to share/doc.
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
><A
NAME="postinst"
></A
>$ cat postinst
#!/bin/sh
set -e
# Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then
if [ -d /usr/doc -a ! -e /usr/doc/parted -a -d /usr/share/doc/parted ]; then
ln -sf ../share/doc/parted /usr/doc/parted
fi
fi
# End automatically added section
$ cat prerm
#!/bin/sh
set -e
# Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/parted ]; then
rm -f /usr/doc/parted
fi
# End automatically added section
</PRE
></FONT
></TD
></TR
></TABLE
><P
>&#13;
And finally the most interesting file:
</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;$ cat control
Package: parted
Version: 1.4.24-4
Section: admin
Priority: optional
Architecture: i386
Depends: e2fsprogs (&#62;= 1.27-2), libc6 (&#62;= 2.2.4-4), libncurses5 (&#62;= \
5.2.20020112a-1), libparted1.4 (&#62;= 1.4.13+14pre1), libreadline4 (&#62;= \
4.2a-4), libuuid1
Suggests: parted-doc
Conflicts: fsresize
Replaces: fsresize
Installed-Size: 76
Maintainer: Timshel Knoll &#60;timshel@debian.org&#62;
Description: The GNU Parted disk partition resizing program
GNU Parted is a program that allows you to create, destroy,
resize, move and copy hard disk partitions. This is useful
for creating space for new operating systems, reorganizing
disk usage, and copying data to new hard disks.
.
This package contains the Parted binary and manual page.
.
Parted currently supports DOS, Mac, Sun, BSD, GPT and PC98
disklabels/partition tables, as well as a 'loop' (raw disk)
type which allows use on RAID/LVM. Filesystems supported are
ext2, ext3, FAT (FAT16 and FAT32) and linux-swap. Parted can
also detect HFS (Mac OS), JFS, NTFS, ReiserFS, UFS and XFS
filesystems, but cannot create/remove/resize/check these
filesystems yet.
.
The nature of this software means that any bugs could cause
massive data loss. While there are no known bugs at the moment,
they could exist, so please back up all important files before
running it, and do so at your own risk.
</PRE
></FONT
></TD
></TR
></TABLE
><P
>&#13;Further information about the control file can be obtained via '<TT
CLASS="literal"
>man 5 deb-control</TT
>'.
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x48.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x88.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Getting Started</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Hands On</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>