Reference

debmstd(1)

Tool for generating single + multi binary packages and setting up scriptfiles

NAME

debstd - Tool for generating single + multi binary packages and setting up scriptfiles

SYNOPSIS

debstd [-m] package [documentation ...]

DESCRIPTION

NOTE: Please replace all occurences of debstd with debmstd in this document. debmstd will replace debstd in the future.

debstd is to be called from the debian/rules file to generate files into debian/tmp which are later used by dpkg to generate a .deb file.

MULTI-BINARY SUPPORT

A scan will be made for multiple "Package:" lines in the debian/control file. For the first package (the base package) debstd will work in the usual way. The second and following "Package:" lines are processed in order to generate additional binary packages. For additional binary packages to work you need to generate a directory named after the package in the debian directory. Put all configuration files (as supported by normal packages in the debian directory) which are special for that package into the directory debian/<packagename>.

Create a file with the name files in that directory and list all directories and files which you want to be in that Package instead of the main in that file. When debstd is called it will move those files out of debian/tmp into the special binary directory for that partial package and generate a package based on the contents of that directory. If you generate the directory debian/<package>/tmp yourself in the rules file then you can put binaries into the package the same way done for debian/tmp (the base package) and avoid using the files to list the parts to be moved over to the other package. The pathnames listed MUST NOT begin with a slash (/). A slash might be disastrous for your systems health!

A script named prebuild in the package directory will be executed if it exists after debmstd has changed all the ownerships of the files to root.root and set the permissions to defaults. prebuild may contain statements to set special permissions. The current directory is the tmp directory when called.

ACTIONS PERFORMED

debstd looks for control files in the debian subdirectory and installs them in the proper locations in debian/tmp (generating the necessary directories) or performs some more complex action (see the list of controlfiles below).
A search for manpages of the form *.[1-8] will be done throughout the sourcecode archive. Each manpage will be checked if it is installed in debian/tmp. If not those manpages are installed (unless the -m option is specified).
All the files mentioned after the packagename on the commandline are put into the proper directory for documentation.
debstd will search through the binary archive that is generated and look for ELF binaries. dpkg-shlibdeps will be run on those binaries.

Debstd will look through the generated usr/doc usr/info and usr/man and compress files according to the appropriate current policy (if debstd is up to date ...). debstd will automatically convert manpages that contain only an .so command to a symlink.

A pass will then be made through the whole binary package looking for dangling symlinks and symlinks that were pointing to files now compressed. Those symlinks are fixed up or a message is generated.

debstd will also search the binary package for libraries provides in /lib /usr/lib and /usr/X11R6/lib. Those libraries are properly registered with dpkg and a ldconfig call is placed into postinst.

debstd will add appropriate commands to the installation scripts postinst, postrm, prerm preinst if certain control files are present in the debian subdirectory. If those scripts are also supplied by the package maintainer then those scripts should not end with an exit command! debstd will add commands to the end of those files and thus the added things will not work.

OPTIONS

-m

will switch off the automatic installation of manpages found in the source archive.

SUPPORTED CONTROLFILES in debian directory

copyright

A required file containing a description of the packages copyrights. That file is installed /usr/doc/package. It is required and processed only for the base package.

changelog

A required file containing the history of changes to the package. The file is copied and will be installed in /usr/doc/package/changelog.Debian. Required and processed only for the base package.

README.debian

Optional file containing debian specific instructions for the package. Installed in /usr/doc/package. Only processed for the base package.

postinst postrm preinst prerm

These are optional scripts to be executed on installation or deinstallation of the package. They are copied into the proper location for control scripts.
Please avoid using the scripts in favor of having debstd automatically write the scripts for you. Be aware that debstd will add necessary housekeeping commands to the end of the files if you use any of the features that need to execute scripts on installation.

conffiles

An optional file containing the list of configuration files of the package. Installed in the location for control information about the package.

cron.daily cron.weekly cron.monthly rc.boot

Scripts to perform maintenance for the package. They are installed finally into the proper directory in /etc/xxxx.

init.d init

Scripts to be put into /etc/init.d. The script is named according to the package name if init.d is used. Using init means that the last "d" should be removed from the package name to generate the scriptname in /etc/init.d. This is commonly done for daemons.
If one of these scripts is present then appropriate commands are generated in the postinst, postrm,prerm script for the maintenance of the links in /etc/rc?.d. If there is a FLAGS= line in the init-script then the contents of that variable can be used to customize the way update-rc.d is called.

If the script contains the word NO_RESTART_ON_UPGRADE then the daemon will not be restarted when upgrading the system.

purge

This file should contain a list of files/directories to be removed when the package is purged from the system. The presence of this file will lead to commands being added to the postrm script to erase the files listed in "purge".

examples

This file should contain a list of files/directories to be installed in /usr/doc/package/examples.

docs

This file can contain a list of files/directories to be installed in usr/doc/package. This is in addition to the possibility of naming doc files on invocation of debstd. The docs-file is the preferred way of installing documentation.

info

If this file is present then the necessary calls to install a info files are included in the scripts. Get the template from /usr/lib/deb-make/debian/info.ex and customize it.

services inittab crontab protocols profile shells rpc

shells syslog.conf conf.modules modules X11/Xresources X11/config X11/window-managers X11/xinit
If any of those files is present in the debian directory then debstd will generate scripts to add the contents of these files to the corresponding config file in /etc. The lines that were added will stay in these files in /etc until the package is purged from the system. The user may change these lines manually later therefore the contents will not be overwritten on an update! If you want an update to put your additions into those configfiles in /etc then setup a postinst script that erases the sections you want to upgrade from those configfiles. Have a look at /usr/lib/deb-make/etc.postrm to see how it can be accomplished with the way debstd encapsulates package specific parts of configuration files.

diversions

debstd will generate calls to set up diversions if this file is present. The file should not contain any comments but just lines with 3 elements separated by blanks. First the name of the file to be diverted. Second the file it should be diverted to and thirdly the package name that the file to be diverted belongs to.

inetd.conf

debstd will create calls to add a line (contained in this file) to inetd.conf using update-inetd on installation and also take care of the proper script setup for removal

SEE ALSO

deb-make(1), debchange(1), dch(1) and dpkg(1) .

AUTHOR

Christoph Lameter <[email protected]>