[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
        dpkg-gencontrol

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.

#!/bin/sh

# 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

PACKAGE=$1

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
fi

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

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

# 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
	fi
done

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

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.";
		else
			if [ ! -d debian/tmp/usr/man/$SECTION ]; then
				install -d debian/tmp/usr/man/$SECTION
			fi
			install $i debian/tmp/usr/man/$SECTION/$NAME
			echo "Manpage $NAME added."
		fi
	fi
	fi
done

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

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: