]> git.donarmstrong.com Git - debhelper.git/blob - dh_installchangelogs
r1: Initial revision
[debhelper.git] / dh_installchangelogs
1 #!/bin/sh -e
2 #
3 # Installs debian/changelog. If another filename is passed to it, installs
4 # that file as the upstream changelog.
5 #
6 # Looks at debian/control to determine if this is a native debian package,
7 # if so, the debian changelog is just installed as "changelog", and it is an 
8 # error to specify an upstream changelog on the command line.
9
10 PATH=debian:$PATH:/usr/lib/debhelper
11 source dh_lib
12
13 UPSTREAM=$1
14
15 if [ "$NATIVE" -a "$UPSTREAM" ]; then
16         error "Cannot specify an upstream changelog for a native package."
17 fi
18
19 if [ "$NATIVE" ]; then
20         CHANGELOG_NAME=changelog
21 else
22         CHANGELOG_NAME=changelog.Debian
23 fi
24
25 if [ ! -d debian/tmp/usr/doc/$PACKAGE ]; then
26         doit "install -d debian/tmp/usr/doc/$PACKAGE"
27 fi
28 doit "install -p -m644 debian/changelog debian/tmp/usr/doc/$PACKAGE/$CHANGELOG_NAME"
29
30 if [ "$UPSTREAM" ]; then
31         doit "install -p -m644 $UPSTREAM debian/tmp/usr/doc/$PACKAGE/changelog"
32 fi