]> git.donarmstrong.com Git - debhelper.git/blob - dh_installchangelogs
r102: Initial Import
[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 . dh_lib
12
13 UPSTREAM=$1
14
15 if isnative && [ "$UPSTREAM" ]; then
16         error "Cannot specify an upstream changelog for a native debian package."
17 fi
18
19 if isnative; then
20         CHANGELOG_NAME=changelog
21 else
22         CHANGELOG_NAME=changelog.Debian
23 fi
24
25 for PACKAGE in $DH_DOPACKAGES; do
26         TMP=`tmpdir $PACKAGE`
27
28         changelog=`pkgfile $PACKAGE changelog`
29         if [ ! "$changelog" ]; then
30                 changelog=debian/changelog
31         fi
32
33         if [ ! -d $TMP/usr/doc/$PACKAGE ]; then
34                 doit "install -d $TMP/usr/doc/$PACKAGE"
35         fi
36         doit "install -p -m644 $changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME"
37
38         if [ "$UPSTREAM" ]; then
39                 doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog"
40         fi
41 done