summaryrefslogtreecommitdiff
path: root/dh_installchangelogs
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:12:54 +0000
committerjoey <joey>1999-08-17 04:12:54 +0000
commit938b66ee19e113785e6655b1c3e73e9003e6464c (patch)
treed06bd22faa3da8940bec71ba2e34e2028b6e7764 /dh_installchangelogs
r1: Initial revision
Diffstat (limited to 'dh_installchangelogs')
-rwxr-xr-xdh_installchangelogs32
1 files changed, 32 insertions, 0 deletions
diff --git a/dh_installchangelogs b/dh_installchangelogs
new file mode 100755
index 0000000..935a87a
--- /dev/null
+++ b/dh_installchangelogs
@@ -0,0 +1,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