summaryrefslogtreecommitdiff
path: root/dh_installdebfiles
blob: ada82155ac80f5a4fdb82b2e4dc1ff3d5464995a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh -e
#
# Install files from debian/ into the package's DEBIAN directory.
# Also generates the control file.

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

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

# Install executable files.
for file in postinst preinst prerm postrm; do
	if [ -f debian/$file ]; then
		doit "install -p debian/$file debian/tmp/DEBIAN"
	fi
done

# Install non-executable files
for file in shlibs conffiles; do
	if [ -f debian/$file ]; then
		doit "install -m 644 -p debian/$file debian/tmp/DEBIAN"
	fi                                               
done

# Run dpkg-shlibdeps to generate dependancies.
# This ends up running dpkg-shlibdeps on scripts, but that is no big deal.
files=`find debian/tmp -type f -perm +111 | tr "\n" " "`
if [ "$files" ]; then
	doit "dpkg-shlibdeps $files"
fi

# Generate and install control file.
doit "dpkg-gencontrol -p$PACKAGE"