summaryrefslogtreecommitdiff
path: root/dh_installchangelogs
blob: 935a87a687e43fdf95a35bda7548c38baf846eee (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
#!/bin/sh -e
#
# Installs debian/changelog. If another filename is passed to it, installs
# that file as the upstream changelog.
#
# Looks at debian/control to determine if this is a native debian package,
# if so, the debian changelog is just installed as "changelog", and it is an 
# error to specify an upstream changelog on the command line.

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

UPSTREAM=$1

if [ "$NATIVE" -a "$UPSTREAM" ]; then
	error "Cannot specify an upstream changelog for a native package."
fi

if [ "$NATIVE" ]; then
	CHANGELOG_NAME=changelog
else
	CHANGELOG_NAME=changelog.Debian
fi

if [ ! -d debian/tmp/usr/doc/$PACKAGE ]; then
	doit "install -d debian/tmp/usr/doc/$PACKAGE"
fi
doit "install -p -m644 debian/changelog debian/tmp/usr/doc/$PACKAGE/$CHANGELOG_NAME"

if [ "$UPSTREAM" ]; then
	doit "install -p -m644 $UPSTREAM debian/tmp/usr/doc/$PACKAGE/changelog"
fi