3 # Installs debian/changelog. If another filename is passed to it, installs
4 # that file as the upstream changelog.
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.
10 BEGIN { push @INC, "debian", "/usr/share/debhelper" }
16 if (isnative($dh{MAINPACKAGE}) && defined $upstream) {
17 error("Cannot specify an upstream changelog for a native debian package.");
20 if (isnative($dh{MAINPACKAGE})) {
21 $changelog_name='changelog';
24 $changelog_name='changelog.Debian';
27 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
28 $TMP=tmpdir($PACKAGE);
29 $changelog=pkgfile($PACKAGE,"changelog");
32 $changelog="debian/changelog";
35 if (! -e $changelog) {
36 error("could not find changelog $changelog");
39 if (! -d "$TMP/usr/doc/$PACKAGE") {
40 doit("install","-d","$TMP/usr/doc/$PACKAGE");
42 doit("install","-o","root","-g","root","-p","-m644",$changelog,
43 "$TMP/usr/doc/$PACKAGE/$changelog_name");
46 if ($upstream=~m/\.html?$/i) {
48 doit("install","-o","root","-g","root","-p","-m644",
49 $upstream,"$TMP/usr/doc/$PACKAGE/changelog.html");
50 doit("ln", "-sf", 'changelog.html',
51 "$TMP/usr/doc/$PACKAGE/changelog");
54 doit("install","-o","root","-g","root","-p","-m644",
55 $upstream,"$TMP/usr/doc/$PACKAGE/changelog");
58 # Install symlink to original name of the upstream changelog file.
59 # Use basename in case original file was in a subdirectory or something.
60 doit("ln","-sf","changelog","$TMP/usr/doc/$PACKAGE/".Dh_Lib::basename($upstream));