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 use Debian::Debhelper::Dh_Lib;
15 if (isnative($dh{MAINPACKAGE}) && defined $upstream) {
16 error("Cannot specify an upstream changelog for a native debian package.");
19 if (isnative($dh{MAINPACKAGE})) {
20 $changelog_name='changelog';
23 $changelog_name='changelog.Debian';
26 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
27 $TMP=tmpdir($PACKAGE);
28 $changelog=pkgfile($PACKAGE,"changelog");
31 $changelog="debian/changelog";
34 if (! -e $changelog) {
35 error("could not find changelog $changelog");
38 if (! -d "$TMP/usr/share/doc/$PACKAGE") {
39 doit("install","-d","$TMP/usr/share/doc/$PACKAGE");
41 doit("install","-o",0,"-g",0,"-p","-m644",$changelog,
42 "$TMP/usr/share/doc/$PACKAGE/$changelog_name");
46 if ($upstream=~m/\.html?$/i) {
48 doit("install","-o",0,"-g",0,"-p","-m644",
49 $upstream,"$TMP/usr/share/doc/$PACKAGE/changelog.html");
50 complex_doit("lynx -dump $upstream > $TMP/usr/share/doc/$PACKAGE/changelog");
51 $link_to='changelog.html';
54 doit("install","-o",0,"-g",0,"-p","-m644",
55 $upstream,"$TMP/usr/share/doc/$PACKAGE/changelog");
59 # Install symlink to original name of the upstream changelog file.
60 # Use basename in case original file was in a subdirectory or something.
61 doit("ln","-sf",$link_to,"$TMP/usr/share/doc/$PACKAGE/".Debian::Debhelper::Dh_Lib::basename($upstream));