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/share/doc/$PACKAGE") {
40 doit("install","-d","$TMP/usr/share/doc/$PACKAGE");
42 doit("install","-o","root","-g","root","-p","-m644",$changelog,
43 "$TMP/usr/share/doc/$PACKAGE/$changelog_name");
47 if ($upstream=~m/\.html?$/i) {
49 doit("install","-o","root","-g","root","-p","-m644",
50 $upstream,"$TMP/usr/share/doc/$PACKAGE/changelog.html");
51 complex_doit("lynx -dump $upstream > $TMP/usr/share/doc/$PACKAGE/changelog");
52 $link_to='changelog.html';
55 doit("install","-o","root","-g","root","-p","-m644",
56 $upstream,"$TMP/usr/share/doc/$PACKAGE/changelog");
60 # Install symlink to original name of the upstream changelog file.
61 # Use basename in case original file was in a subdirectory or something.
62 doit("ln","-sf",$link_to,"$TMP/usr/share/doc/$PACKAGE/".Dh_Lib::basename($upstream));