#!/bin/sh -e # # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the # package. PATH=debian:$PATH:/usr/lib/debhelper . dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` if [ ! -d "$TMP/DEBIAN" ]; then doit "install -d $TMP/DEBIAN" fi # Check if we should exclude conffiles. if [ ! "$DH_INCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then # Generate exclude regexp. Using perl here may be overkill, # but it does insure conffiles with spaces in them work. exclude=`perl -ne 'chomp; s/^\///; print "! -path \"$_\" "' $TMP/DEBIAN/conffiles` fi olddir=`pwd` complex_doit "cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir" doit "chmod 644 $TMP/DEBIAN/md5sums" doit "chown root.root $TMP/DEBIAN/md5sums" done