[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Helpful script for package maintenance

I got a little bit unnerved with permissions not being right, forgetting
to copy some configuration file to tmp/DEBIAN, having to manually generate
all those directories etc etc.

Here is a script that is called from debian/rules which is sensing what
kind of configuration files are in the debian directory and then installs
them correctly. Just put this script into the debian directory and call
this script from debian/rules with

	debian/debstd <packagename> <documentationfiles>

In the ppp package it is called like this:
        debian/debstd ppp debian/win95.ppp README.linux
        dpkg-shlibdeps pppd/pppd

In an ideal situation this will enable you to simply call the install
routine of the original package and then run debian/debstd to set up
all the debian scripts.

This script also will search for manpages in the package and install all
of them.


# Script to be called from debian/rules to setup all the debian specifc
# required files
# Christoph Lameter, <clameter@debian.org> October 10, 1996
# Script is called with one parameter which is the package name and a list
# of documentation files to install


cd debian

install -d tmp/usr/doc/$PACKAGE tmp/DEBIAN
# Required files in /usr/doc/package
install -m644 copyright tmp/usr/doc/$PACKAGE
install -m644 changelog tmp/usr/doc/$PACKAGE/changelog.Debian

# Special README
if [ -f README.debian ]; then
	install -m644 README.debian tmp/usr/doc/$PACKAGE

# Installation scripts
for i in postinst preinst prerm postrm; do
	if [ -f debian/$i ]; then
		install $i tmp/DEBIAN

if [ -f conffiles ]; then
	install -m644 conffiles tmp/DEBIAN

# Deal with scripts in etc directories
for i in cron.daily cron.weekly cron.monthy init.d; do
	if [ -f $i ]; then
		install -d tmp/etc/$i
		install $i tmp/etc/$i/$PACKAGE

if [ -x ../$PACKAGE ]; then
	cd ..
	dpkg-shlibdeps $PACKAGE

cd ..

# Install manpages that might be somewhere in the package
for i in `find * -name "*.[1-8]"`; do
	if ! expr $i : 'debian/tmp/.*' >/dev/null; then
	if file $i|grep -q troff; then
		echo -n "$i: "
	  	NAME=`expr $i : '.*/\(.*\)'`
		SECTION=man`expr $NAME : '.*\.\([12345678]\)'`
		if [ -f tmp/usr/man/$SECTION/$NAME ]; then
			echo "Manpage $NAME exists.";
			if [ ! -d debian/tmp/usr/man/$SECTION ]; then
				install -d debian/tmp/usr/man/$SECTION
			install $i debian/tmp/usr/man/$SECTION/$NAME
			echo "Manpage $NAME added."

# Install Documentation files specified on the commandline
while [ "$1" != "" ]; do
	install $1 debian/tmp/usr/doc/$PACKAGE

exit 0

{}  Consulting available for Networking / Unix / Crossplatform integration    {}
{}  Snail Mail:   FTS Box 466, 135 N.Oakland Ave, Pasadena, CA 91182          {}
PGP Public Key  =  FB 9B 31 21 04 1E 3A 33  C7 62 2F C0 CD 81 CA B5 

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com

Reply to: