summaryrefslogtreecommitdiff
path: root/dh_md5sums
blob: 634e2fd6c0bf8c4faa93b1deb279999db9b62e61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh -e
#
# Generate a DEBIAN/md5sums file, that lists the md5sums of all
# non-conffiles in the package

PATH=debian:$PATH:/usr/lib/debhelper
. dh_lib

for PACKAGE in $DH_DOPACKAGES; do
	TMP=`tmpdir $PACKAGE`

	if [ ! -d "debian/$TMP/DEBIAN" ]; then
		doit "install -d debian/$TMP/DEBIAN"
	fi

	doit "pushd debian/$TMP" >/dev/null
	# Doit isn't smart enough to hande this next command so echo by hand. (sigh)
	verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums </dev/null'
	md5sum `find * -type f ! -regex "^DEBIAN/.*"` >DEBIAN/md5sums </dev/null
	doit "chown root.root DEBIAN/md5sums"
	doit "popd 2>/dev/null" >/dev/null 
done